# HG changeset patch # User Thien-Thi Nguyen # Date 1185008721 0 # Node ID b22beb3e496f769f401d28d3f8a2b1a0c4af1c9c # Parent d01bc1c34d891fa4c2ec0c03ec0c0afb814d501d (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 -r d01bc1c34d89 -r b22beb3e496f lisp/emacs-lisp/lisp-mode.el --- 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))