Content-Length: 297771 | pFad | http://github.com/postgrespro/postgres/commit/5fcb58baca7a78e688b84275958c450670ba62a8

4B Add Perl emacs formatting macros to src/tools/editors/emacs.samples. · postgrespro/postgres@5fcb58b · GitHub
Skip to content

Commit 5fcb58b

Browse files
committed
Add Perl emacs formatting macros to src/tools/editors/emacs.samples.
Peter Eisentraut
1 parent c36b06a commit 5fcb58b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/tools/editors/emacs.samples

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414

15+
;;; Mode for C files to match src/tools/pgindent/pgindent formatting
16+
1517
;;; This set is known to work with old versions of emacs
1618

1719
(setq auto-mode-alist
@@ -80,6 +82,26 @@
8082

8183
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8284

85+
;;; Mode for Perl files to match src/tools/pgindent/perltidyrc formatting
86+
87+
(defun pgsql-perl-style ()
88+
"Perl style adjusted for PostgreSQL project"
89+
(interactive)
90+
(setq tab-width 4)
91+
(setq perl-indent-level 4)
92+
(setq perl-continued-statement-offset 4)
93+
(setq perl-continued-brace-offset 4)
94+
(setq perl-brace-offset 0)
95+
(setq perl-brace-imaginary-offset 0)
96+
(setq perl-label-offset -2))
97+
98+
(add-hook 'perl-mode-hook
99+
(lambda ()
100+
(if (string-match "postgresql" buffer-file-name)
101+
(pgsql-perl-style))))
102+
103+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104+
83105
;;; To work on the documentation, the following (or a variant, as above)
84106
;;; can be helpful.
85107

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/5fcb58baca7a78e688b84275958c450670ba62a8

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy