summaryrefslogtreecommitdiff
path: root/lisp/electric.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-09-05 00:54:58 +0200
committerStefan Monnier <monnier@iro.umontreal.ca>2010-09-05 00:54:58 +0200
commit6aeafb34372289081799c952bad2b80f19736be3 (patch)
treec96edfe4889165ded7a08f92cfd8b689bbf4dd7b /lisp/electric.el
parent2e664aab0b16b0470484b53eb09d122959a0b0e7 (diff)
downloademacs-6aeafb34372289081799c952bad2b80f19736be3.tar.gz
* lisp/electric.el (electric-indent-post-self-insert-function):
Don't reindent with a sloppy indentation function.
Diffstat (limited to 'lisp/electric.el')
-rw-r--r--lisp/electric.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/electric.el b/lisp/electric.el
index 48d865d8957..8e9d23be231 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -198,6 +198,10 @@
;; For newline, we want to reindent both lines and basically behave like
;; reindent-then-newline-and-indent (whose code we hence copied).
(when (and (eq last-command-event ?\n)
+ ;; Don't reindent the previous line if the indentation function
+ ;; is not a real one.
+ (not (memq indent-line-function
+ '(indent-relative indent-relative-maybe)))
;; Sanity check.
(eq (char-before) last-command-event))
(let ((pos (copy-marker (1- (point)) t)))