aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-07 01:12:07 +0000
committerRichard M. Stallman1997-09-07 01:12:07 +0000
commitadce3b5f3dd43653e27eb6f501e4dd165f24e9db (patch)
tree6d65badd5b83bd6201e25d19534018824456839a
parentf656ec48c3a4f2f164dd0bdb31560c14f191d59d (diff)
downloademacs-adce3b5f3dd43653e27eb6f501e4dd165f24e9db.tar.gz
emacs-adce3b5f3dd43653e27eb6f501e4dd165f24e9db.zip
(move-past-close-and-reindent):
Don't move closeparen back onto the end of a comment.
-rw-r--r--lisp/emacs-lisp/lisp.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 995e327ee9b..01e7cda43f7 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -256,7 +256,25 @@ before and after, depending on the surrounding characters."
256 (while (save-excursion ; this is my contribution 256 (while (save-excursion ; this is my contribution
257 (let ((before-paren (point))) 257 (let ((before-paren (point)))
258 (back-to-indentation) 258 (back-to-indentation)
259 (= (point) before-paren))) 259 (and (= (point) before-paren)
260 (progn
261 ;; Move to end of previous line.
262 (beginning-of-line)
263 (forward-char -1)
264 ;; Verify it doesn't end within a string or comment.
265 (let ((end (point))
266 state)
267 (beginning-of-line)
268 ;; Get state at start of line.
269 (setq state (list 0 nil nil
270 (null (calculate-lisp-indent))
271 nil nil nil nil
272 nil))
273 ;; Parse state across the line to get state at end.
274 (setq state (parse-partial-sexp (point) end nil nil
275 state))
276 ;; Check not in string or comment.
277 (and (not (elt state 3)) (not (elt state 4))))))))
260 (delete-indentation)) 278 (delete-indentation))
261 (forward-char 1) 279 (forward-char 1)
262 (newline-and-indent)) 280 (newline-and-indent))