]> git.eshelyaron.com Git - emacs.git/commitdiff
(calculate-lisp-indent): In the
authorThien-Thi Nguyen <ttn@gnuvola.org>
Sat, 21 Jul 2007 09:06:17 +0000 (09:06 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Sat, 21 Jul 2007 09:06:17 +0000 (09:06 +0000)
case of alignment under a constant symbol, find and consider
the sexp actually at indentation to be the "last sexp".

lisp/ChangeLog
lisp/emacs-lisp/lisp-mode.el

index b6a9389a734b71c17528036502ec415aaed88b62..a37a2b0a6589662741edb3da68912db752124f38 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * emacs-lisp/lisp-mode.el (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".
+
 2007-07-20  Eli Zaretskii  <eliz@gnu.org>
 
        * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
index 374d3ae2327e90ec06c00ad9f6a2d41a8bdf5b26..3160af5d80d42f311c8897caf3fd7450f6819bdf 100644 (file)
@@ -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))