Mercurial > emacs
comparison lisp/electric.el @ 110188:92e4fa270c92
* lisp/electric.el (electric-indent-post-self-insert-function):
Don't reindent with a sloppy indentation function.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 05 Sep 2010 00:54:58 +0200 |
parents | c9b982e5aefd |
children | e6399f46aefa |
comparison
equal
deleted
inserted
replaced
110187:98d8e4cd2326 | 110188:92e4fa270c92 |
---|---|
196 ;; Not in a string or comment. | 196 ;; Not in a string or comment. |
197 (not (nth 8 (syntax-ppss)))) | 197 (not (nth 8 (syntax-ppss)))) |
198 ;; For newline, we want to reindent both lines and basically behave like | 198 ;; For newline, we want to reindent both lines and basically behave like |
199 ;; reindent-then-newline-and-indent (whose code we hence copied). | 199 ;; reindent-then-newline-and-indent (whose code we hence copied). |
200 (when (and (eq last-command-event ?\n) | 200 (when (and (eq last-command-event ?\n) |
201 ;; Don't reindent the previous line if the indentation function | |
202 ;; is not a real one. | |
203 (not (memq indent-line-function | |
204 '(indent-relative indent-relative-maybe))) | |
201 ;; Sanity check. | 205 ;; Sanity check. |
202 (eq (char-before) last-command-event)) | 206 (eq (char-before) last-command-event)) |
203 (let ((pos (copy-marker (1- (point)) t))) | 207 (let ((pos (copy-marker (1- (point)) t))) |
204 (save-excursion | 208 (save-excursion |
205 (goto-char pos) | 209 (goto-char pos) |