summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2007-07-21 09:06:17 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2007-07-21 09:06:17 +0000
commit26716cc246dafe884123457cc1cd6bb17c39cf88 (patch)
treea52a2e565b1c419bcbd0c3264cf74d580538e403 /lisp/emacs-lisp
parent1d2646ccb61b4163dd1aae11ac5ddb2a7b03a563 (diff)
downloademacs-26716cc246dafe884123457cc1cd6bb17c39cf88.tar.gz
emacs-26716cc246dafe884123457cc1cd6bb17c39cf88.tar.bz2
emacs-26716cc246dafe884123457cc1cd6bb17c39cf88.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.el10
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))