summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-06-24 05:09:26 +0000
committerJim Blandy <jimb@redhat.com>1992-06-24 05:09:26 +0000
commit22316a01694698229bcb654d6ced320d4ac6eddf (patch)
treef57f9e656229e424ad457732b606975b1b570ada /lisp/emacs-lisp/lisp-mode.el
parent68a88c85f7609001f2e4cf12ee4f2160371e69bd (diff)
downloademacs-22316a01694698229bcb654d6ced320d4ac6eddf.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el20
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))