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).
This commit is contained in:
parent
2a0a368ddc
commit
d2849cc645
1 changed files with 5 additions and 4 deletions
|
@ -1075,10 +1075,11 @@ is the buffer position of the start of the containing expression."
|
||||||
;; Handle prefix characters and whitespace
|
;; Handle prefix characters and whitespace
|
||||||
;; following an open paren. (Bug#1012)
|
;; following an open paren. (Bug#1012)
|
||||||
(backward-prefix-chars)
|
(backward-prefix-chars)
|
||||||
(while (not (or (looking-back "^[ \t]*\\|([ \t]+"
|
(while (not (save-excursion
|
||||||
(line-beginning-position))
|
(skip-chars-backward " \t")
|
||||||
(and containing-sexp
|
(or (= (point) (line-beginning-position))
|
||||||
(>= (1+ containing-sexp) (point)))))
|
(and containing-sexp
|
||||||
|
(= (point) (1+ containing-sexp))))))
|
||||||
(forward-sexp -1)
|
(forward-sexp -1)
|
||||||
(backward-prefix-chars))
|
(backward-prefix-chars))
|
||||||
(setq calculate-lisp-indent-last-sexp (point)))
|
(setq calculate-lisp-indent-last-sexp (point)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue