diff options
author | Graham Dobbins <gdobbins@protonmail.com> | 2017-03-19 21:06:18 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-03-21 20:45:31 -0400 |
commit | bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d (patch) | |
tree | 4403ee8941c901aeca3c0fb8c26a22a4bf34312d | |
parent | 3bb5af3a32dd131926fb9cbb5c8db5cd5d97d91c (diff) | |
download | emacs-bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d.tar.gz emacs-bcb6c7b7cd954fc653fe54c20aa4a5d8dd97d76d.tar.bz2 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.el | 5 |
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." (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) |