[climacs-cvs] CVS update: climacs/base.lisp climacs/gui.lisp

Robert Strandh rstrandh at common-lisp.net
Sat Feb 19 06:19:07 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv12302

Modified Files:
	base.lisp gui.lisp 
Log Message:
open-line now takes an optional count argument.

com-open-line now accepts a numeric argument that it passes on to 
open-line.

Date: Sat Feb 19 07:19:06 2005
Author: rstrandh

Index: climacs/base.lisp
diff -u climacs/base.lisp:1.36 climacs/base.lisp:1.37
--- climacs/base.lisp:1.36	Sat Feb 19 07:09:45 2005
+++ climacs/base.lisp	Sat Feb 19 07:19:06 2005
@@ -67,14 +67,16 @@
     (beginning-of-line mark)
     (incf (offset mark) column)))
 
-(defmethod open-line ((mark left-sticky-mark))
+(defmethod open-line ((mark left-sticky-mark) &optional (count 1))
   "Create a new line in a buffer after the mark."
-  (insert-object mark #\Newline))
+  (loop repeat count
+	do (insert-object mark #\Newline)))
 
-(defmethod open-line ((mark right-sticky-mark))
+(defmethod open-line ((mark right-sticky-mark) &optional (count 1))
   "Create a new line in a buffer after the mark."
-  (insert-object mark #\Newline)
-  (decf (offset mark)))
+  (loop repeat count
+	do (insert-object mark #\Newline)
+	   (decf (offset mark))))
 
 (defun kill-line (mark)
   "Remove a line from a buffer."


Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.111 climacs/gui.lisp:1.112
--- climacs/gui.lisp:1.111	Sat Feb 19 07:09:45 2005
+++ climacs/gui.lisp	Sat Feb 19 07:19:06 2005
@@ -462,8 +462,8 @@
       (setf (slot-value win 'goal-column) (column-number point)))
     (next-line point (slot-value win 'goal-column) numarg)))
 
-(define-named-command com-open-line ()
-  (open-line (point (current-window))))
+(define-named-command com-open-line ((numarg 'integer :prompt "How many lines?"))
+  (open-line (point (current-window)) numarg))
 
 (define-named-command com-kill-line ((numarg 'integer :prompt "Kill how many lines?")
 				     (numargp 'boolean :prompt "Kill entire lines?"))
@@ -1348,7 +1348,7 @@
 (global-set-key '(#\p :control) `(com-previous-line ,*numeric-argument-marker*))
 (global-set-key '(#\l :control) 'com-full-redisplay)
 (global-set-key '(#\n :control) `(com-next-line ,*numeric-argument-marker*))
-(global-set-key '(#\o :control) 'com-open-line)
+(global-set-key '(#\o :control) `(com-open-line ,*numeric-argument-marker*))
 (global-set-key '(#\k :control) `(com-kill-line ,*numeric-argument-marker* ,*numeric-argument-p*))
 (global-set-key '(#\t :control) 'com-transpose-objects)
 (global-set-key '(#\Space :control) 'com-set-mark)




More information about the Climacs-cvs mailing list