Update of /project/mcclim/cvsroot/mcclim/Drei In directory clnet:/tmp/cvs-serv29818/Drei
Modified Files: core.lisp base.lisp Log Message: Loop fixups for CLISP.
--- /project/mcclim/cvsroot/mcclim/Drei/core.lisp 2006/12/03 22:50:13 1.2 +++ /project/mcclim/cvsroot/mcclim/Drei/core.lisp 2007/01/14 17:57:01 1.3 @@ -102,9 +102,9 @@ (loop with m = (clone-mark (low-mark (buffer mark)) :right) initially (beginning-of-buffer m) - do (end-of-line m) + repeat (1- line-number) until (end-of-buffer-p m) - repeat (1- line-number) + do (end-of-line m) do (incf (offset m)) (end-of-line m) finally (beginning-of-line m) @@ -202,16 +202,16 @@ with line-beginning-offset = (offset begin-mark) with walking-mark = (clone-mark begin-mark) while (mark< walking-mark mark) - as object = (object-after walking-mark) - do (case object - (#\Space - (setf (offset begin-mark) (offset walking-mark)) - (incf column)) - (#\Tab - (setf (offset begin-mark) (offset walking-mark)) - (incf column (- tab-width (mod column tab-width)))) - (t - (incf column))) + do (let ((object (object-after walking-mark))) + (case object + (#\Space + (setf (offset begin-mark) (offset walking-mark)) + (incf column)) + (#\Tab + (setf (offset begin-mark) (offset walking-mark)) + (incf column (- tab-width (mod column tab-width)))) + (t + (incf column)))) (when (and (>= column fill-column) (/= (offset begin-mark) line-beginning-offset)) (when compress-whitespaces @@ -266,8 +266,8 @@ (let ((mark2 (clone-mark mark))) (beginning-of-line mark2) (loop until (end-of-buffer-p mark2) - as object = (object-after mark2) - while (or (eql object #\Space) (eql object #\Tab)) + while (or (eql (object-after mark2) #\Space) + (eql (object-after mark2) #\Tab)) do (delete-range mark2 1)) (loop until (zerop indentation) do (cond ((and tab-width (>= indentation tab-width)) --- /project/mcclim/cvsroot/mcclim/Drei/base.lisp 2006/11/14 10:17:13 1.3 +++ /project/mcclim/cvsroot/mcclim/Drei/base.lisp 2007/01/14 17:57:01 1.4 @@ -268,14 +268,16 @@ constituent character of the line." (let ((mark2 (clone-mark mark))) (beginning-of-line mark2) - (loop with indentation = 0 - until (end-of-buffer-p mark2) - as object = (object-after mark2) - while (or (eql object #\Space) (eql object #\Tab)) - do (incf indentation - (if (eql (object-after mark2) #\Tab) tab-width 1)) - (incf (offset mark2)) - finally (return indentation)))) + (if (end-of-line-p mark2) + 0 + (loop with indentation = 0 + as object = (object-after mark2) + until (end-of-buffer-p mark2) + while (or (eql object #\Space) (eql object #\Tab)) + do (incf indentation + (if (eql (object-after mark2) #\Tab) tab-width 1)) + (incf (offset mark2)) + finally (return indentation)))))
(defmethod buffer-number-of-lines-in-region (buffer offset1 offset2) "Helper method for number-of-lines-in-region. Count newline