emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master bcb6c7b 1/2: * lisp/emacs-lisp/lisp-mode.el (indent


From: Noam Postavsky
Subject: [Emacs-diffs] master bcb6c7b 1/2: * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Fix null endpos case
Date: Tue, 21 Mar 2017 20:45:18 -0400 (EDT)

branch: master
commit bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d
Author: Graham Dobbins <address@hidden>
Commit: Noam Postavsky <address@hidden>

    * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Fix null endpos case
    
    Copyright-paperwork-exempt: yes
---
 lisp/emacs-lisp/lisp-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index eb07c18..d6293c0 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]