changeset 81907:d330cbad60ac

(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 Mon, 16 Jul 2007 14:57:31 +0000
parents e9d6a41a04c6
children 51950d0d44d8
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	Mon Jul 16 13:22:13 2007 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Mon Jul 16 14:57:31 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))