found 37045 26.1 tags 37045 + patch quit eschulte@grammatech.com writes: > Indent-region sometimes hangs when indenting a lisp file. A minimal > example is the file just containing the characters "|#" followed by a > newline. It's actually any unfinished string literal (in Common Lisp, |...| is treated by Emacs as a string literal, though technically it's an escaped symbol). > This hang is due to an infinite loop in the while loop in the > `lisp-indent-calc-next' function. The following version of this > function fixes this problem, but is certainly not the appropriate > long-term fix. I think the right fix is just to check for end of buffer: @@ -810,7 +810,7 @@ lisp-indent-calc-next (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)) Full patch with test (and some other comment updates) attached below. Is this okay for emacs-26? The bug is a regression from Emacs 25.