diff options
author | Eli Zaretskii <eliz@gnu.org> | 2007-02-17 11:35:22 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2007-02-17 11:35:22 +0000 |
commit | 8e1ac0634abc10422d0739b078a096e381447786 (patch) | |
tree | 550b3d03e8b61305cc49eb675b5edcac5198091d /lisp/emacs-lisp | |
parent | ead4759c9c241f5179249859a283809e43c4b1bd (diff) | |
download | emacs-8e1ac0634abc10422d0739b078a096e381447786.tar.gz |
(calculate-lisp-indent): Added indentation for the constants of Lisp.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 8c1cf918b36..5576a4882b0 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -909,6 +909,24 @@ is the buffer position of the start of the containing expression." (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) |