mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 14:52:08 +02:00
Add Perl emacs formatting macros to src/tools/editors/emacs.samples.
Peter Eisentraut
This commit is contained in:
parent
c36b06a70d
commit
5fcb58baca
@ -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
|
;;; This set is known to work with old versions of emacs
|
||||||
|
|
||||||
(setq auto-mode-alist
|
(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)
|
;;; To work on the documentation, the following (or a variant, as above)
|
||||||
;;; can be helpful.
|
;;; can be helpful.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user