From: Thien-Thi Nguyen Date: Sat, 21 Jul 2007 09:06:17 +0000 (+0000) Subject: (calculate-lisp-indent): In the X-Git-Tag: emacs-pretest-22.1.90~1232 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=26716cc246dafe884123457cc1cd6bb17c39cf88;p=emacs.git (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". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b6a9389a734..a37a2b0a658 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-07-21 Thien-Thi Nguyen + + * 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 * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets. 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))