]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'calculate-lisp-indent' when "[" starts containing sexp (Bug#51312)
authorMartin Rudalics <rudalics@gmx.at>
Fri, 22 Oct 2021 08:16:17 +0000 (10:16 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 22 Oct 2021 08:16:17 +0000 (10:16 +0200)
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Handle
arbitrary paren syntax after skipping whitespace backwards within
containing sexp (Bug#51312).

lisp/emacs-lisp/lisp-mode.el

index fc7a7362cd731642e81a45576c5370f88296f6e1..bb00a97f8e3e785704f4f1971597f457cc80b79a 100644 (file)
@@ -1075,10 +1075,11 @@ is the buffer position of the start of the containing expression."
                       ;; Handle prefix characters and whitespace
                       ;; following an open paren.  (Bug#1012)
                        (backward-prefix-chars)
-                       (while (not (or (looking-back "^[ \t]*\\|([ \t]+"
-                                                      (line-beginning-position))
-                                       (and containing-sexp
-                                            (>= (1+ containing-sexp) (point)))))
+                       (while (not (save-excursion
+                                     (skip-chars-backward " \t")
+                                     (or (= (point) (line-beginning-position))
+                                         (and containing-sexp
+                                              (= (point) (1+ containing-sexp))))))
                          (forward-sexp -1)
                          (backward-prefix-chars))
                        (setq calculate-lisp-indent-last-sexp (point)))