diff options
author | Thien-Thi Nguyen <ttn@gnuvola.org> | 2007-07-16 14:59:10 +0000 |
---|---|---|
committer | Thien-Thi Nguyen <ttn@gnuvola.org> | 2007-07-16 14:59:10 +0000 |
commit | 1499cfbada1d9e6c0f23bc24649e23cd66fa4c78 (patch) | |
tree | c1ca4af5db4f4e5eb0fc8a42e0d3ad3866f74bd2 /lisp/emacs-lisp | |
parent | 413a79ad664be5cf43a3b1b1136f5625bf14bc8f (diff) | |
download | emacs-1499cfbada1d9e6c0f23bc24649e23cd66fa4c78.tar.gz emacs-1499cfbada1d9e6c0f23bc24649e23cd66fa4c78.tar.bz2 emacs-1499cfbada1d9e6c0f23bc24649e23cd66fa4c78.zip |
(calculate-lisp-indent): In the case of alignment under a constant symbol,
find and consider the sexp actually at indentation to be the "last sexp".
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 374d3ae2327..3160af5d80d 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -932,6 +932,16 @@ is the buffer position of the start of the containing expression." (goto-char indent-point) (skip-chars-forward " \t") (looking-at ":")) + ;; The last sexp may not be at the indentation + ;; where it begins, so find that one, instead. + (save-excursion + (goto-char calculate-lisp-indent-last-sexp) + (while (and (not (looking-back "^[ \t]*")) + (or (not containing-sexp) + (< (1+ containing-sexp) (point)))) + (forward-sexp -1) + (backward-prefix-chars)) + (setq calculate-lisp-indent-last-sexp (point))) (> calculate-lisp-indent-last-sexp (save-excursion (goto-char (1+ containing-sexp)) |