summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-08-16 07:26:40 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-08-17 09:42:34 -0400
commitbcd0115e4db49791a77566b80fabc4384d9ebf57 (patch)
treeeb5024d4e633eb5e21c83f3ca1e50a9dd46ac6f9 /test/lisp/emacs-lisp
parent5f992d1990d9f351cf907dcf2066f573e0fe9407 (diff)
downloademacs-bcd0115e4db49791a77566b80fabc4384d9ebf57.tar.gz
emacs-bcd0115e4db49791a77566b80fabc4384d9ebf57.tar.bz2
emacs-bcd0115e4db49791a77566b80fabc4384d9ebf57.zip
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.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el6
1 files changed, 5 insertions, 1 deletions
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