# HG changeset patch # User Eli Zaretskii # Date 1171712062 0 # Node ID 2e16068bd4fb6ff75a417541be05df65a41015b1 # Parent 22b8991d91fec4371f283ced872f9cd284c7beb6 (calculate-lisp-indent): Added indentation for the constants of Lisp. diff -r 22b8991d91fe -r 2e16068bd4fb lisp/emacs-lisp/lisp-mode.el --- a/lisp/emacs-lisp/lisp-mode.el Sat Feb 17 11:28:18 2007 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Sat Feb 17 11:34:22 2007 +0000 @@ -909,6 +909,24 @@ (cond ((elt state 3) ;; Inside a string, don't change indentation. nil) + ((save-excursion + ;; test whether current line begins with a constant + (goto-char indent-point) + (skip-chars-forward " \t") + (looking-at ":")) + (let ((desired-indent + (save-excursion + (goto-char (1+ containing-sexp)) + (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) + (point))) + (parse-sexp-ignore-comments t)) + ;; Align a constant symbol under the last constant symbol + (goto-char calculate-lisp-indent-last-sexp) + (while (> (point) desired-indent) + (if (looking-at ":") + (setq desired-indent (point)) + (backward-sexp 1)))) + (current-column)) ((and (integerp lisp-indent-offset) containing-sexp) ;; Indent by constant offset (goto-char containing-sexp)