Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 75977:2e16068bd4fb
(calculate-lisp-indent): Added indentation for the constants of Lisp.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 17 Feb 2007 11:34:22 +0000 |
parents | 8496bd7b062a |
children | b72eb510e3d7 dd7c098af727 |
comparison
equal
deleted
inserted
replaced
75976:22b8991d91fe | 75977:2e16068bd4fb |
---|---|
907 ;; or if the desired indentation has already been computed. | 907 ;; or if the desired indentation has already been computed. |
908 (let ((normal-indent (current-column))) | 908 (let ((normal-indent (current-column))) |
909 (cond ((elt state 3) | 909 (cond ((elt state 3) |
910 ;; Inside a string, don't change indentation. | 910 ;; Inside a string, don't change indentation. |
911 nil) | 911 nil) |
912 ((save-excursion | |
913 ;; test whether current line begins with a constant | |
914 (goto-char indent-point) | |
915 (skip-chars-forward " \t") | |
916 (looking-at ":")) | |
917 (let ((desired-indent | |
918 (save-excursion | |
919 (goto-char (1+ containing-sexp)) | |
920 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) | |
921 (point))) | |
922 (parse-sexp-ignore-comments t)) | |
923 ;; Align a constant symbol under the last constant symbol | |
924 (goto-char calculate-lisp-indent-last-sexp) | |
925 (while (> (point) desired-indent) | |
926 (if (looking-at ":") | |
927 (setq desired-indent (point)) | |
928 (backward-sexp 1)))) | |
929 (current-column)) | |
912 ((and (integerp lisp-indent-offset) containing-sexp) | 930 ((and (integerp lisp-indent-offset) containing-sexp) |
913 ;; Indent by constant offset | 931 ;; Indent by constant offset |
914 (goto-char containing-sexp) | 932 (goto-char containing-sexp) |
915 (+ (current-column) lisp-indent-offset)) | 933 (+ (current-column) lisp-indent-offset)) |
916 (desired-indent) | 934 (desired-indent) |