summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 3a03b56313d..44b27236a9c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1199,8 +1199,14 @@ ENDPOS is encountered."
(setq endpos (copy-marker
(if endpos endpos
;; Get error now if we don't have a complete sexp
- ;; after point.
- (save-excursion (forward-sexp 1) (point)))))
+ ;; after point. We actually look for a sexp which
+ ;; ends after the current line so that we properly
+ ;; indent things like #s(...). This might not be
+ ;; needed if Bug#15998 is fixed.
+ (let ((eol (line-end-position)))
+ (save-excursion (while (and (< (point) eol) (not (eobp)))
+ (forward-sexp 1))
+ (point))))))
(save-excursion
(while (let ((indent (lisp-indent-calc-next parse-state))
(ppss (lisp-indent-state-ppss parse-state)))