Update of /project/climacs/cvsroot/climacs
In directory clnet:/tmp/cvs-serv3929
Modified Files:
misc-commands.lisp base.lisp
Log Message:
Fixed `indent-region': Update syntax for each indented line. Alsp
prevent infinite loops in `do-buffer-region-lines'.
--- /project/climacs/cvsroot/climacs/misc-commands.lisp 2006/04/23 12:11:26 1.6
+++ /project/climacs/cvsroot/climacs/misc-commands.lisp 2006/04/30 15:12:05 1.7
@@ -552,7 +552,12 @@
line
tab-space-count
syntax)))
- (indent-line line indentation tab-width)))))
+ (indent-line line indentation tab-width))
+ ;; We need to update the syntax every time we perform an
+ ;; indentation, so that subsequent indentations will be
+ ;; correctly indented (this matters in list forms). FIXME: This
+ ;; should probably happen automatically.
+ (update-syntax buffer syntax))))
(define-command (com-indent-region :name t :command-table indent-table) ()
"Indent every line of the current region as specified by the
--- /project/climacs/cvsroot/climacs/base.lisp 2006/03/26 14:14:48 1.46
+++ /project/climacs/cvsroot/climacs/base.lisp 2006/04/30 15:12:05 1.47
@@ -50,12 +50,13 @@
(let ((mark-sym (gensym))
(mark2-sym (gensym)))
`(progn
- (when (mark< ,mark2 ,mark1)
- (rotatef ,mark1 ,mark2))
- (let ((,mark-sym (clone-mark ,mark1))
- (,mark2-sym (clone-mark ,mark2)))
- (loop while (mark<= ,mark-sym ,mark2-sym)
- do
+ (let* ((,mark-sym (clone-mark ,mark1))
+ (,mark2-sym (clone-mark ,mark2)))
+ (when (mark< ,mark2-sym ,mark-sym)
+ (rotatef ,mark-sym ,mark2-sym))
+ (loop while (and (mark<= ,mark-sym ,mark2-sym)
+ (not (end-of-buffer-p ,mark-sym)))
+ do
(let ((,line-var (clone-mark ,mark-sym)))
,@body)
(end-of-line ,mark-sym)