summaryrefslogtreecommitdiff
path: root/src/tools/editors
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-08-30 21:40:31 -0400
committerBruce Momjian <bruce@momjian.us>2012-08-30 21:40:31 -0400
commit5fcb58baca7a78e688b84275958c450670ba62a8 (patch)
treea943b0a49d1e13eb7d11f726d4723d9c9f46d139 /src/tools/editors
parentc36b06a70d303c738f092f264585f621b6b30b29 (diff)
downloadpostgresql-5fcb58baca7a78e688b84275958c450670ba62a8.tar.gz
Add Perl emacs formatting macros to src/tools/editors/emacs.samples.
Peter Eisentraut
Diffstat (limited to 'src/tools/editors')
-rw-r--r--src/tools/editors/emacs.samples22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/editors/emacs.samples b/src/tools/editors/emacs.samples
index d9cfa2ffd8..c8d8d07a20 100644
--- a/src/tools/editors/emacs.samples
+++ b/src/tools/editors/emacs.samples
@@ -12,6 +12,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Mode for C files to match src/tools/pgindent/pgindent formatting
+
;;; This set is known to work with old versions of emacs
(setq auto-mode-alist
@@ -80,6 +82,26 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Mode for Perl files to match src/tools/pgindent/perltidyrc formatting
+
+(defun pgsql-perl-style ()
+ "Perl style adjusted for PostgreSQL project"
+ (interactive)
+ (setq tab-width 4)
+ (setq perl-indent-level 4)
+ (setq perl-continued-statement-offset 4)
+ (setq perl-continued-brace-offset 4)
+ (setq perl-brace-offset 0)
+ (setq perl-brace-imaginary-offset 0)
+ (setq perl-label-offset -2))
+
+(add-hook 'perl-mode-hook
+ (lambda ()
+ (if (string-match "postgresql" buffer-file-name)
+ (pgsql-perl-style))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
;;; To work on the documentation, the following (or a variant, as above)
;;; can be helpful.