summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorakater <nuclearspace@gmail.com>2021-11-08 07:37:51 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-08 07:38:41 +0100
commitca9fb109f75565dce7ba527f273cebc16887287e (patch)
tree9e388d05ce8e7fb3c6d4d4606fce1118218cff5b /lisp/emacs-lisp
parent51aa6cee2cb6eee48f62e3efe96f27a0d844e67d (diff)
downloademacs-ca9fb109f75565dce7ba527f273cebc16887287e.tar.gz
emacs-ca9fb109f75565dce7ba527f273cebc16887287e.tar.bz2
emacs-ca9fb109f75565dce7ba527f273cebc16887287e.zip
lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption.
* lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Preserve the point. * test/lisp/progmodes/elisp-mode-resources/flet.erts: Add corresponding test example (bug#9622).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 15afdef0252..a5613e70e0a 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1148,12 +1148,13 @@ STATE is the `parse-partial-sexp' state for current position."
;; that starts a sexp.
t)
(point))))))
- (ignore-errors
- ;; We rely on `backward-up-list' working
- ;; even when sexp is incomplete “to the right”.
- (backward-up-list 2)
- t)
- (= local-definitions-starting-point (point))))))))
+ (save-excursion
+ (ignore-errors
+ ;; We rely on `backward-up-list' working
+ ;; even when sexp is incomplete “to the right”.
+ (backward-up-list 2)
+ t)
+ (= local-definitions-starting-point (point)))))))))
(defun lisp-indent-function (indent-point state)
"This function is the normal value of the variable `lisp-indent-function'.