aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-03-15 22:35:47 -0400
committerNoam Postavsky2017-04-22 14:09:57 -0400
commit8bb5d7adaf45264900385530c7f76175ba490a77 (patch)
tree2b4a30f93876031ed2072cd93673ee57820623b0
parent43c84577a3055d5ddf1f5d1b999e6ecca6139f60 (diff)
downloademacs-8bb5d7adaf45264900385530c7f76175ba490a77.tar.gz
emacs-8bb5d7adaf45264900385530c7f76175ba490a77.zip
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Clean up marker.
-rw-r--r--lisp/emacs-lisp/lisp-mode.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 607a4c3d11d..810fc95614d 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1089,12 +1089,13 @@ ENDPOS is encountered."
1089 (next-depth init-depth) 1089 (next-depth init-depth)
1090 (last-depth init-depth) 1090 (last-depth init-depth)
1091 (last-syntax-point (point))) 1091 (last-syntax-point (point)))
1092 (unless endpos 1092 ;; We need a marker because we modify the buffer
1093 ;; Get error now if we don't have a complete sexp after point. 1093 ;; text preceding endpos.
1094 (save-excursion (forward-sexp 1) 1094 (setq endpos (copy-marker
1095 ;; We need a marker because we modify the buffer 1095 (if endpos endpos
1096 ;; text preceding endpos. 1096 ;; Get error now if we don't have a complete sexp
1097 (setq endpos (point-marker)))) 1097 ;; after point.
1098 (save-excursion (forward-sexp 1) (point)))))
1098 (save-excursion 1099 (save-excursion
1099 (while (< (point) endpos) 1100 (while (< (point) endpos)
1100 ;; Parse this line so we can learn the state to indent the 1101 ;; Parse this line so we can learn the state to indent the
@@ -1154,7 +1155,8 @@ ENDPOS is encountered."
1154 ;; `calculate-lisp-indent' only returns nil 1155 ;; `calculate-lisp-indent' only returns nil
1155 ;; when we're in a string, but this won't 1156 ;; when we're in a string, but this won't
1156 ;; happen because we skip strings above. 1157 ;; happen because we skip strings above.
1157 (t (error "This shouldn't happen!")))))))))))) 1158 (t (error "This shouldn't happen!"))))))))))
1159 (move-marker endpos nil)))
1158 1160
1159(defun indent-pp-sexp (&optional arg) 1161(defun indent-pp-sexp (&optional arg)
1160 "Indent each line of the list starting just after point, or prettyprint it. 1162 "Indent each line of the list starting just after point, or prettyprint it.