aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGraham Dobbins2017-03-19 21:06:18 -0400
committerNoam Postavsky2017-03-21 20:45:31 -0400
commitbcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d (patch)
tree4403ee8941c901aeca3c0fb8c26a22a4bf34312d
parent3bb5af3a32dd131926fb9cbb5c8db5cd5d97d91c (diff)
downloademacs-bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d.tar.gz
emacs-bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d.zip
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Fix null endpos case
Copyright-paperwork-exempt: yes
-rw-r--r--lisp/emacs-lisp/lisp-mode.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index eb07c18b03d..d6293c03040 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1083,7 +1083,8 @@ ENDPOS is encountered."
1083 (init-depth (car state)) 1083 (init-depth (car state))
1084 (next-depth init-depth) 1084 (next-depth init-depth)
1085 (last-depth init-depth) 1085 (last-depth init-depth)
1086 (last-syntax-point (point))) 1086 (last-syntax-point (point))
1087 (real-endpos endpos))
1087 (unless endpos 1088 (unless endpos
1088 ;; Get error now if we don't have a complete sexp after point. 1089 ;; Get error now if we don't have a complete sexp after point.
1089 (save-excursion (forward-sexp 1) 1090 (save-excursion (forward-sexp 1)
@@ -1116,6 +1117,8 @@ ENDPOS is encountered."
1116 last-depth (- last-depth next-depth) 1117 last-depth (- last-depth next-depth)
1117 next-depth init-depth)) 1118 next-depth init-depth))
1118 (forward-line 1) 1119 (forward-line 1)
1120 (when (and (not real-endpos) (<= next-depth init-depth))
1121 (goto-char endpos))
1119 (when (< (point) endpos) 1122 (when (< (point) endpos)
1120 (let ((depth-delta (- next-depth last-depth))) 1123 (let ((depth-delta (- next-depth last-depth)))
1121 (cond ((< depth-delta 0) 1124 (cond ((< depth-delta 0)