aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2021-10-22 10:16:17 +0200
committerMartin Rudalics2021-10-22 10:16:17 +0200
commitd2849cc645f349080fd74ffbe082178bc12cd02b (patch)
tree9b4cb8241a5a0321a7bf0b0cb71cb11513912658
parent2a0a368ddcd9b4eed067ddc114f3fb18b13bbe14 (diff)
downloademacs-d2849cc645f349080fd74ffbe082178bc12cd02b.tar.gz
emacs-d2849cc645f349080fd74ffbe082178bc12cd02b.zip
Fix 'calculate-lisp-indent' when "[" starts containing sexp (Bug#51312)
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Handle arbitrary paren syntax after skipping whitespace backwards within containing sexp (Bug#51312).
-rw-r--r--lisp/emacs-lisp/lisp-mode.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index fc7a7362cd7..bb00a97f8e3 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1075,10 +1075,11 @@ is the buffer position of the start of the containing expression."
1075 ;; Handle prefix characters and whitespace 1075 ;; Handle prefix characters and whitespace
1076 ;; following an open paren. (Bug#1012) 1076 ;; following an open paren. (Bug#1012)
1077 (backward-prefix-chars) 1077 (backward-prefix-chars)
1078 (while (not (or (looking-back "^[ \t]*\\|([ \t]+" 1078 (while (not (save-excursion
1079 (line-beginning-position)) 1079 (skip-chars-backward " \t")
1080 (and containing-sexp 1080 (or (= (point) (line-beginning-position))
1081 (>= (1+ containing-sexp) (point))))) 1081 (and containing-sexp
1082 (= (point) (1+ containing-sexp))))))
1082 (forward-sexp -1) 1083 (forward-sexp -1)
1083 (backward-prefix-chars)) 1084 (backward-prefix-chars))
1084 (setq calculate-lisp-indent-last-sexp (point))) 1085 (setq calculate-lisp-indent-last-sexp (point)))