git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52a301e)
Make Emacs perl-mode indent more like perltidy.
2019年1月13日 19:32:31 +0000 (11:32 -0800)
2019年1月13日 19:32:31 +0000 (11:32 -0800)
This especially helps braces that surround code blocks. Back-patch to
v11, where commit 56fb890ace8ac0ca955ae0803c580c2074f876f6 first
appeared; before that, settings were even more distant from perltidy.

Reviewed by Andrew Dunstan.

Discussion: https://postgr.es/m/20190103055355.GB267595@gust.leadboat.com


diff --git a/.dir-locals.el b/.dir-locals.el
index eff4671ef882de95186b93754584f8d47efc1d41..ab6208b6983a5c58557c89076a30e396fb2800d0 100644 (file)
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -9,7 +9,7 @@
(indent-tabs-mode . nil)))
(perl-mode . ((perl-indent-level . 4)
(perl-continued-statement-offset . 2)
- (perl-continued-brace-offset . 4)
+ (perl-continued-brace-offset . -2)
(perl-brace-offset . 0)
(perl-brace-imaginary-offset . 0)
(perl-label-offset . -2)
diff --git a/src/tools/editors/emacs.samples b/src/tools/editors/emacs.samples
index a7152b04bc9119fc711a6fb0dbb029cff04402fe..529c98a9ebacd71c4d72c7f9abb5f98cd610786b 100644 (file)
--- a/src/tools/editors/emacs.samples
+++ b/src/tools/editors/emacs.samples
@@ -47,10 +47,13 @@
(interactive)
(setq perl-brace-imaginary-offset 0)
(setq perl-brace-offset 0)
- (setq perl-continued-brace-offset 4)
(setq perl-continued-statement-offset 2)
+ (setq perl-continued-brace-offset (- perl-continued-statement-offset))
(setq perl-indent-level 4)
(setq perl-label-offset -2)
+ ;; Next two aren't marked safe-local-variable, so .dir-locals.el omits them.
+ (setq perl-indent-continued-arguments 4)
+ (setq perl-indent-parens-as-block t)
(setq indent-tabs-mode t)
(setq tab-width 4))
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /