diff options
author | Glenn Morris <rgm@gnu.org> | 2019-08-20 09:01:55 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2019-08-20 09:01:55 -0700 |
commit | 8f68449c9476956425881bf1534fa727d5247448 (patch) | |
tree | 6647f6d286b2efdfab829f0a6715164743594084 /lisp/emacs-lisp/lisp-mode.el | |
parent | 65dc07f563f229faadaa44312776941abbf6e1b6 (diff) | |
parent | 0b810ebc9fe65e447e37832db40ccf634e5548d9 (diff) | |
download | emacs-8f68449c9476956425881bf1534fa727d5247448.tar.gz |
Merge from origin/emacs-26
0b810eb Fix a typo in char-width-table
3f00db7 Minor update in admin/notes/unicode
bcd0115 Fix lisp indent infloop on unfinished strings (Bug#37045)
5f992d1 Improve commentary in composite.el
3a04be2 ; Improve commentary in xdisp.c
15de1d1 Fix markup in dired-x.texi
bda7fc7 ; Fix typo in a doc string of speedbar.el
6f57ef9 * src/callproc.c (Fcall_process): Doc fix.
# Conflicts:
# doc/misc/dired-x.texi
# lisp/international/characters.el
# src/callproc.c
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fa6dc98d04c..5df52ebc98f 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -822,7 +822,7 @@ by more than one line to cross a string literal." (setq last-sexp (nth 2 ppss))) (setq depth (car ppss)) ;; Skip over newlines within strings. - (nth 3 ppss)) + (and (not (eobp)) (nth 3 ppss))) (let ((string-start (nth 8 ppss))) (setq ppss (parse-partial-sexp (point) (point-max) nil nil ppss 'syntax-table)) @@ -838,17 +838,22 @@ by more than one line to cross a string literal." indent-stack))))) (prog1 (let (indent) - (cond ((= (forward-line 1) 1) nil) - ;; Negative depth, probably some kind of syntax error. + (cond ((= (forward-line 1) 1) + ;; Can't move to the next line, apparently end of buffer. + nil) ((null indent-stack) - ;; Reset state. + ;; Negative depth, probably some kind of syntax + ;; error. Reset the state. (setq ppss (parse-partial-sexp (point) (point)))) ((car indent-stack)) ((integerp (setq indent (calculate-lisp-indent ppss))) (setf (car indent-stack) indent)) ((consp indent) ; (COLUMN CONTAINING-SEXP-START) (car indent)) - ;; This only happens if we're in a string. + ;; This only happens if we're in a string, but the + ;; loop should always skip over strings (unless we hit + ;; end of buffer, which is taken care of by the first + ;; clause). (t (error "This shouldn't happen")))) (setf (lisp-indent-state-stack state) indent-stack) (setf (lisp-indent-state-ppss-point state) ppss-point) |