[climacs-cvs] CVS climacs

thenriksen thenriksen at common-lisp.net
Mon Sep 4 07:05:21 UTC 2006


Update of /project/climacs/cvsroot/climacs
In directory clnet:/tmp/cvs-serv3863

Modified Files:
	packages.lisp base.lisp 
Log Message:
Add `move-to-column' function to CLIMACS-BASE.


--- /project/climacs/cvsroot/climacs/packages.lisp	2006/09/03 21:23:29	1.114
+++ /project/climacs/cvsroot/climacs/packages.lisp	2006/09/04 07:05:21	1.115
@@ -89,6 +89,7 @@
 	   #:number-of-lines-in-region
 	   #:constituentp
            #:just-n-spaces
+           #:move-to-column
            #:buffer-whitespacep
            #:buffer-region-case
 	   #:name-mixin #:name
--- /project/climacs/cvsroot/climacs/base.lisp	2006/08/28 17:22:58	1.59
+++ /project/climacs/cvsroot/climacs/base.lisp	2006/09/04 07:05:21	1.60
@@ -266,6 +266,17 @@
                                (- existing-spaces n))
                             mark1))))))
 
+(defun move-to-column (mark column &optional force)
+  "Move the position of `mark' to column number `column'. If the
+  line is too short, put `mark' at end of line, unless `force' is
+  non-NIL, in which case spaces will be added to the end of the
+  line."
+  (let ((set-column (setf (column-number mark) column)))
+    (when (and (not (= set-column column))
+               force)
+      (insert-sequence mark (make-string (- column set-column)
+                                         :initial-element #\Space)))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 
 ;;; Character case




More information about the Climacs-cvs mailing list