Skip to content

Commit 472e1e4

Browse files
committed
Make Emacs perl-mode indent more like perltidy.
This especially helps braces that surround code blocks. Back-patch to v11, where commit 56fb890 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
1 parent 52a301e commit 472e1e4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.dir-locals.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(indent-tabs-mode . nil)))
1010
(perl-mode . ((perl-indent-level . 4)
1111
(perl-continued-statement-offset . 2)
12-
(perl-continued-brace-offset . 4)
12+
(perl-continued-brace-offset . -2)
1313
(perl-brace-offset . 0)
1414
(perl-brace-imaginary-offset . 0)
1515
(perl-label-offset . -2)

src/tools/editors/emacs.samples

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@
4747
(interactive)
4848
(setq perl-brace-imaginary-offset 0)
4949
(setq perl-brace-offset 0)
50-
(setq perl-continued-brace-offset 4)
5150
(setq perl-continued-statement-offset 2)
51+
(setq perl-continued-brace-offset (- perl-continued-statement-offset))
5252
(setq perl-indent-level 4)
5353
(setq perl-label-offset -2)
54+
;; Next two aren't marked safe-local-variable, so .dir-locals.el omits them.
55+
(setq perl-indent-continued-arguments 4)
56+
(setq perl-indent-parens-as-block t)
5457
(setq indent-tabs-mode t)
5558
(setq tab-width 4))
5659

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy