diff options
| author | Noam Postavsky | 2018-07-27 19:41:39 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-07-27 19:41:39 -0400 |
| commit | 857910539313c0f2d89fe5626a41f1abe6c33ca7 (patch) | |
| tree | 7c4a9b8184cd09d842962fe9dcbec07651611766 /test | |
| parent | d24c5f26bf6c12bda614f90ba3345d710482005a (diff) | |
| download | emacs-857910539313c0f2d89fe5626a41f1abe6c33ca7.tar.gz emacs-857910539313c0f2d89fe5626a41f1abe6c33ca7.zip | |
Don't fail to indent-sexp before a full sexp (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only signal error if the
initial forward-sexp fails. Suppress scan-error forn any of the
forward-sexp calls after that.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-cant-go): New
test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/lisp-mode-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index 0b052e9fc30..30f606d3816 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el | |||
| @@ -125,6 +125,17 @@ noindent\" 3 | |||
| 125 | #s(foo | 125 | #s(foo |
| 126 | bar)\n")))) | 126 | bar)\n")))) |
| 127 | 127 | ||
| 128 | (ert-deftest indent-sexp-cant-go () | ||
| 129 | "`indent-sexp' shouldn't error before a sexp." | ||
| 130 | ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31984#32. | ||
| 131 | (with-temp-buffer | ||
| 132 | (emacs-lisp-mode) | ||
| 133 | (insert "(())") | ||
| 134 | (goto-char (1+ (point-min))) | ||
| 135 | ;; Paredit calls `indent-sexp' from this position. | ||
| 136 | (indent-sexp) | ||
| 137 | (should (equal (buffer-string) "(())")))) | ||
| 138 | |||
| 128 | (ert-deftest lisp-indent-region () | 139 | (ert-deftest lisp-indent-region () |
| 129 | "Test basics of `lisp-indent-region'." | 140 | "Test basics of `lisp-indent-region'." |
| 130 | (with-temp-buffer | 141 | (with-temp-buffer |