From bcd0115e4db49791a77566b80fabc4384d9ebf57 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 16 Aug 2019 07:26:40 -0400 Subject: Fix lisp indent infloop on unfinished strings (Bug#37045) * lisp/emacs-lisp/lisp-mode.el (lisp-indent-calc-next): Stop trying to skip over strings if we've hit the end of buffer. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-unfinished-string): New test. --- test/lisp/emacs-lisp/lisp-mode-tests.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/lisp/emacs-lisp/lisp-mode-tests.el') diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index 63632449ca5..e4ba929ecbd 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -284,7 +284,11 @@ Expected initialization file: `%s'\" (lisp-indent-line) (should (equal (buffer-string) "prompt> foo")))) - +(ert-deftest lisp-indent-unfinished-string () + "Don't infloop on unfinished string (Bug#37045)." + (with-temp-buffer + (insert "\"\n") + (lisp-indent-region (point-min) (point-max)))) (provide 'lisp-mode-tests) ;;; lisp-mode-tests.el ends here -- cgit v1.2.1