summaryrefslogtreecommitdiff
path: root/lisp/progmodes/perl-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-10-30 10:24:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2017-10-30 10:24:47 -0400
commitedde35e6f8c21979035824ae1845c33e0a5e0da0 (patch)
tree66e7bd3a8ab84794bf06fe4b2236c80a670fa8de /lisp/progmodes/perl-mode.el
parent056587c45fd964c0367e970c52914260977f889d (diff)
downloademacs-edde35e6f8c21979035824ae1845c33e0a5e0da0.tar.gz
* lisp/progmodes/perl-mode.el: Fix electric indentation with RET
(perl-electric-noindent-p): The `eolp' check should not apply to RET. Reported in https://emacs.stackexchange.com/questions/36337.
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r--lisp/progmodes/perl-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 2f9a4c3db55..24b934ce6c2 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -678,7 +678,9 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
(define-obsolete-function-alias 'electric-perl-terminator
'perl-electric-terminator "22.1")
(defun perl-electric-noindent-p (_char)
- (unless (eolp) 'no-indent))
+ ;; To reproduce the old behavior, ;, {, }, and : are made electric, but
+ ;; we only want them to be electric at EOL.
+ (unless (or (bolp) (eolp)) 'no-indent))
(defun perl-electric-terminator (arg)
"Insert character and maybe adjust indentation.