diff options
author | Glenn Morris <rgm@gnu.org> | 2019-04-29 09:08:19 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2019-04-29 09:08:19 -0700 |
commit | 666293861985480bc658f9fa399009027bc39f1e (patch) | |
tree | cbab6e4c77be3e5ee965b0e15b681b1030f2c3bb /lisp/emacs-lisp | |
parent | f1a3a7d6caeb3f250d338217dfd4c476e812bc6e (diff) | |
parent | 0e8d452c1c166ff65a0325de23bc04b57aea68d8 (diff) | |
download | emacs-666293861985480bc658f9fa399009027bc39f1e.tar.gz emacs-666293861985480bc658f9fa399009027bc39f1e.tar.bz2 emacs-666293861985480bc658f9fa399009027bc39f1e.zip |
Merge from origin/emacs-26
0e8d452 ; * doc/lispref/nonascii.texi (Coding System Basics): Fix gra...
25a2ff7 ; Add missing space in custom.texi
9ec18fb * admin/admin.el (set-version): Check for increase in version...
93912ba Be more careful about indent-sexp going over eol (Bug#35286)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 4c7a8bea3fb..fa6dc98d04c 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1210,19 +1210,25 @@ ENDPOS is encountered." ;; Get error now if we don't have a complete sexp ;; after point. (save-excursion + (forward-sexp 1) (let ((eol (line-end-position))) - (forward-sexp 1) ;; We actually look for a sexp which ends ;; after the current line so that we properly ;; indent things like #s(...). This might not ;; be needed if Bug#15998 is fixed. - (condition-case () - (while (and (< (point) eol) (not (eobp))) - (forward-sexp 1)) - ;; But don't signal an error for incomplete - ;; sexps following the first complete sexp - ;; after point. - (scan-error nil))) + (when (and (< (point) eol) + ;; Check if eol is within a sexp. + (> (nth 0 (save-excursion + (parse-partial-sexp + (point) eol))) + 0)) + (condition-case () + (while (< (point) eol) + (forward-sexp 1)) + ;; But don't signal an error for incomplete + ;; sexps following the first complete sexp + ;; after point. + (scan-error nil)))) (point))))) (save-excursion (while (let ((indent (lisp-indent-calc-next parse-state)) |