From daa3760289bd389e8c174c8d24b375cd875cd911 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 24 Jun 1992 05:09:26 +0000 Subject: *** empty log message *** --- lisp/emacs-lisp/lisp-mode.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') 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)) -- cgit v1.2.3