diff options
author | Martin Rudalics <rudalics@gmx.at> | 2021-10-22 10:16:17 +0200 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2021-10-22 10:16:17 +0200 |
commit | d2849cc645f349080fd74ffbe082178bc12cd02b (patch) | |
tree | 9b4cb8241a5a0321a7bf0b0cb71cb11513912658 /lisp/emacs-lisp/lisp-mode.el | |
parent | 2a0a368ddcd9b4eed067ddc114f3fb18b13bbe14 (diff) | |
download | emacs-d2849cc645f349080fd74ffbe082178bc12cd02b.tar.gz |
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).
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 9 |
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." ;; 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))) |