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

Robert Strandh rstrandh at common-lisp.net
Sat Jan 29 07:05:46 UTC 2005


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

Modified Files:
	base.lisp gui.lisp 
Log Message:
The functions delete-word and backward-delete-word now
take an optional count argument.

The corresponding Climacs commands now accept numeric arguments. 


Date: Fri Jan 28 23:05:42 2005
Author: rstrandh

Index: climacs/base.lisp
diff -u climacs/base.lisp:1.27 climacs/base.lisp:1.28
--- climacs/base.lisp:1.27	Fri Jan 28 22:53:44 2005
+++ climacs/base.lisp	Fri Jan 28 23:05:42 2005
@@ -194,16 +194,16 @@
 		 while (constituentp (object-before mark))
 		 do (decf (offset mark)))))
 
-(defun delete-word (mark)
+(defun delete-word (mark &optional (count 1))
   "Delete until the end of the word"
   (let ((mark2 (clone-mark mark)))
-    (forward-word mark2)
+    (forward-word mark2 count)
     (delete-region mark mark2)))
 
-(defun backward-delete-word (mark)
+(defun backward-delete-word (mark &optional (count 1))
   "Delete until the beginning of the word"
   (let ((mark2 (clone-mark mark)))
-    (backward-word mark2)
+    (backward-word mark2 count)
     (delete-region mark mark2)))
 
 (defun previous-word (mark)


Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.102 climacs/gui.lisp:1.103
--- climacs/gui.lisp:1.102	Fri Jan 28 22:53:44 2005
+++ climacs/gui.lisp	Fri Jan 28 23:05:42 2005
@@ -471,11 +471,11 @@
 (define-named-command com-backward-word ((count 'integer :prompt "Number of words"))
   (backward-word (point (current-window)) count))
 
-(define-named-command com-delete-word ()
-  (delete-word (point (current-window))))
+(define-named-command com-delete-word ((count 'integer :prompt "Number of words"))
+  (delete-word (point (current-window)) count))
 
-(define-named-command com-backward-delete-word ()
-  (backward-delete-word (point (current-window))))
+(define-named-command com-backward-delete-word ((count 'integer :prompt "Number of words"))
+  (backward-delete-word (point (current-window)) count))
 
 (define-named-command com-upcase-region ()
   (let ((cw (current-window)))
@@ -1284,8 +1284,8 @@
 (global-set-key '(#\m :meta) 'com-back-to-indentation)
 (global-set-key '(#\^ :shift :meta) 'com-delete-indentation)
 (global-set-key '(#\q :meta) 'com-fill-paragraph)
-(global-set-key '(#\d :meta) 'com-delete-word)
-(global-set-key '(#\Backspace :meta) 'com-backward-delete-word)
+(global-set-key '(#\d :meta) `(com-delete-word ,*numeric-argument-marker*))
+(global-set-key '(#\Backspace :meta) `(com-backward-delete-word ,*numeric-argument-marker*))
 (global-set-key '(#\/ :meta) 'com-dabbrev-expand)
 (global-set-key '(#\a :control :meta) 'com-beginning-of-paragraph)
 (global-set-key '(#\e :control :meta) 'com-end-of-paragraph)




More information about the Climacs-cvs mailing list