summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/lisp-mode-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-07-19 06:40:54 -0400
committerNoam Postavsky <npostavs@gmail.com>2018-07-21 21:07:07 -0400
commit1b4b96597c7868d9c24389d83089097a521206a5 (patch)
treedd9f8556ba019a88b8fd11c250ff592f831fdab3 /test/lisp/emacs-lisp/lisp-mode-tests.el
parent59e8533286cc8b5abc80b0966ef4b9fb676fbdfe (diff)
downloademacs-1b4b96597c7868d9c24389d83089097a521206a5.tar.gz
Fix indent-sexp of #s(...) (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Look for a sexp that ends after the current line. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-go): New test.
Diffstat (limited to 'test/lisp/emacs-lisp/lisp-mode-tests.el')
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 8598d419788..0b052e9fc30 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -113,6 +113,18 @@ noindent\" 3
;; we're indenting ends on the previous line.
(should (equal (buffer-string) original)))))
+(ert-deftest indent-sexp-go ()
+ "Make sure `indent-sexp' doesn't stop after #s."
+ ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31984.
+ (with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "#s(foo\nbar)\n")
+ (goto-char (point-min))
+ (indent-sexp)
+ (should (equal (buffer-string) "\
+#s(foo
+ bar)\n"))))
+
(ert-deftest lisp-indent-region ()
"Test basics of `lisp-indent-region'."
(with-temp-buffer