diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-09-07 01:12:07 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-09-07 01:12:07 +0000 |
commit | adce3b5f3dd43653e27eb6f501e4dd165f24e9db (patch) | |
tree | 6d65badd5b83bd6201e25d19534018824456839a /lisp/emacs-lisp | |
parent | f656ec48c3a4f2f164dd0bdb31560c14f191d59d (diff) | |
download | emacs-adce3b5f3dd43653e27eb6f501e4dd165f24e9db.tar.gz emacs-adce3b5f3dd43653e27eb6f501e4dd165f24e9db.tar.bz2 emacs-adce3b5f3dd43653e27eb6f501e4dd165f24e9db.zip |
(move-past-close-and-reindent):
Don't move closeparen back onto the end of a comment.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 20 |
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." (while (save-excursion ; this is my contribution (let ((before-paren (point))) (back-to-indentation) - (= (point) before-paren))) + (and (= (point) before-paren) + (progn + ;; Move to end of previous line. + (beginning-of-line) + (forward-char -1) + ;; Verify it doesn't end within a string or comment. + (let ((end (point)) + state) + (beginning-of-line) + ;; Get state at start of line. + (setq state (list 0 nil nil + (null (calculate-lisp-indent)) + nil nil nil nil + nil)) + ;; Parse state across the line to get state at end. + (setq state (parse-partial-sexp (point) end nil nil + state)) + ;; Check not in string or comment. + (and (not (elt state 3)) (not (elt state 4)))))))) (delete-indentation)) (forward-char 1) (newline-and-indent)) |