diff options
author | Jim Blandy <jimb@redhat.com> | 1992-06-24 05:09:26 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1992-06-24 05:09:26 +0000 |
commit | daa3760289bd389e8c174c8d24b375cd875cd911 (patch) | |
tree | 0abe3e6108e0e5a7c98f4c4aa68a495b0ecef09a /lisp/emacs-lisp/lisp-mode.el | |
parent | a4275ad1c8f60239b0bad43cef97ca86d35a51a3 (diff) | |
download | emacs-daa3760289bd389e8c174c8d24b375cd875cd911.tar.gz emacs-daa3760289bd389e8c174c8d24b375cd875cd911.tar.bz2 emacs-daa3760289bd389e8c174c8d24b375cd875cd911.zip |
*** empty log message ***
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index f6fb07b0d2f..d3c1c519460 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -490,9 +490,11 @@ of the start of the containing expression." If optional arg ENDPOS is given, indent each line, stopping when ENDPOS is encountered." (interactive) - (let ((indent-stack (list nil)) (next-depth 0) last-depth bol - outer-loop-done inner-loop-done state this-indent - (last-point (point))) + (let ((indent-stack (list nil)) + (next-depth 0) + (starting-point (point)) + (last-point (point)) + last-depth bol outer-loop-done inner-loop-done state this-indent) ;; Get error now if we don't have a complete sexp after point. (save-excursion (forward-sexp 1)) (save-excursion @@ -529,10 +531,12 @@ ENDPOS is encountered." (setcar (nthcdr 5 state) nil)) (setq inner-loop-done t))) (and endpos - (while (<= next-depth 0) - (setq indent-stack (append indent-stack (list nil))) - (setq next-depth (1+ next-depth)) - (setq last-depth (1+ last-depth)))) + (<= next-depth 0) + (progn + (setq indent-stack (append indent-stack + (make-list (- next-depth) nil)) + last-depth (- last-depth next-depth) + next-depth 0))) (or outer-loop-done (setq outer-loop-done (<= next-depth 0))) (if outer-loop-done @@ -557,7 +561,7 @@ ENDPOS is encountered." (setq this-indent (car indent-stack)) (let ((val (calculate-lisp-indent (if (car indent-stack) (- (car indent-stack)) - last-point)))) + starting-point)))) (if (integerp val) (setcar indent-stack (setq this-indent val)) |