]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Fix null endpos case
authorGraham Dobbins <gdobbins@protonmail.com>
Mon, 20 Mar 2017 01:06:18 +0000 (21:06 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 22 Mar 2017 00:45:31 +0000 (20:45 -0400)
Copyright-paperwork-exempt: yes

lisp/emacs-lisp/lisp-mode.el

index eb07c18b03db70f26ebbd97ca4d79d6d70512f6c..d6293c030407427e0fe5ef3d774fb8d7b33c4716 100644 (file)
@@ -1083,7 +1083,8 @@ ENDPOS is encountered."
          (init-depth (car state))
          (next-depth init-depth)
          (last-depth init-depth)
-         (last-syntax-point (point)))
+         (last-syntax-point (point))
+         (real-endpos endpos))
     (unless endpos
       ;; Get error now if we don't have a complete sexp after point.
       (save-excursion (forward-sexp 1)
@@ -1116,6 +1117,8 @@ ENDPOS is encountered."
                 last-depth (- last-depth next-depth)
                 next-depth init-depth))
         (forward-line 1)
+        (when (and (not real-endpos) (<= next-depth init-depth))
+          (goto-char endpos))
         (when (< (point) endpos)
           (let ((depth-delta (- next-depth last-depth)))
             (cond ((< depth-delta 0)