changeset 78180:b22beb3e496f

(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".
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Sat, 21 Jul 2007 09:05:21 +0000
parents d01bc1c34d89
children 41b71a14b2ce
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Fri Jul 20 19:50:36 2007 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Sat Jul 21 09:05:21 2007 +0000
@@ -932,6 +932,16 @@
                        (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))