[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Wed Dec 19 11:02:11 UTC 2007


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv29422/Drei

Modified Files:
	unicode-commands.lisp misc-commands.lisp 
	lisp-syntax-commands.lisp editing.lisp core-commands.lisp 
	basic-commands.lisp 
Log Message:
Use the default value of the parameter for parameters specified to use
the value of the numeric argument, when no numeric argument is
provided.

Changed Drei command definitions to handle this.


--- /project/mcclim/cvsroot/mcclim/Drei/unicode-commands.lisp	2006/11/08 01:15:33	1.1
+++ /project/mcclim/cvsroot/mcclim/Drei/unicode-commands.lisp	2007/12/19 11:02:01	1.2
@@ -34,7 +34,7 @@
            'self-insert-table (list (code-char i))))
 
 (define-command (com-insert-charcode :name t :command-table self-insert-table)
-    ((code 'integer :prompt "Code point") (count 'integer))
+    ((code 'integer :prompt "Code point") (count 'integer :default 1))
   (let ((char (code-char code)))
     (loop repeat count do (insert-character char))))
 
--- /project/mcclim/cvsroot/mcclim/Drei/misc-commands.lisp	2007/11/19 20:28:43	1.3
+++ /project/mcclim/cvsroot/mcclim/Drei/misc-commands.lisp	2007/12/19 11:02:01	1.4
@@ -32,7 +32,7 @@
 
 (define-command (com-eval-expression :name t :command-table editor-table)
     ((exp 'expression :prompt "Eval")
-     (insertp 'boolean :prompt "Insert?"))
+     (insertp 'boolean :prompt "Insert?" :default nil))
   "Prompt for and evaluate a lisp expression.
 With a numeric argument inserts the result at point as a string; 
 otherwise prints the result."
@@ -66,7 +66,7 @@
 	  (chars (abs (- (offset (point)) (offset (mark))))))
     (display-message "Region has ~D line~:P, ~D character~:P." (1+ lines) chars)))
 
-(set-key `(com-eval-expression ,*unsupplied-argument-marker* ,*numeric-argument-p*)
+(set-key `(com-eval-expression ,*unsupplied-argument-marker* ,*numeric-argument-marker*)
 	 'editor-table
 	 '((#\: :shift :meta)))
 
--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-commands.lisp	2007/12/17 06:47:13	1.13
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-commands.lisp	2007/12/19 11:02:02	1.14
@@ -70,7 +70,7 @@
                      t)))))
 
 (define-command (com-indent-expression :name t :command-table lisp-table)
-    ((count 'integer :prompt "Number of expressions"))
+    ((count 'integer :prompt "Number of expressions" :default 1))
   (let ((mark (point)))
     (if (plusp count)
         (loop repeat count do (forward-expression mark (current-syntax)))
@@ -150,7 +150,7 @@
     (eval-region mark point (current-syntax))))
 
 (define-command (com-eval-last-expression :name t :command-table pane-lisp-table)
-    ((insertp 'boolean :prompt "Insert?"))
+    ((insertp 'boolean :prompt "Insert?" :default nil))
   "Evaluate the expression before point in the local Lisp image."
   (let ((token (form-before (current-syntax) (offset (point)))))
     (if token
@@ -240,7 +240,7 @@
          'pane-lisp-table
          '((#\c :control) (#\r :control)))
 
-(set-key `(com-eval-last-expression ,*numeric-argument-p*)
+(set-key `(com-eval-last-expression ,*numeric-argument-marker*)
          'pane-lisp-table
          '((#\c :control) (#\e :control)))
 
--- /project/mcclim/cvsroot/mcclim/Drei/editing.lisp	2007/12/08 08:53:50	1.7
+++ /project/mcclim/cvsroot/mcclim/Drei/editing.lisp	2007/12/19 11:02:02	1.8
@@ -254,7 +254,7 @@
 (defun backward-kill-object (mark &optional (count 1) concatenate-p limit-action)
   "Kill `count' objects backwards beginning from `mark'."
   (let ((start (offset mark)))
-    (handler-case (progn (forward-object mark count)
+    (handler-case (progn (backward-object mark count)
                          (if concatenate-p
                              (if (plusp count)
                                  (kill-ring-concatenating-push
--- /project/mcclim/cvsroot/mcclim/Drei/core-commands.lisp	2007/12/17 06:47:13	1.10
+++ /project/mcclim/cvsroot/mcclim/Drei/core-commands.lisp	2007/12/19 11:02:05	1.11
@@ -99,7 +99,7 @@
 	 '((#\z :meta)))
 
 (define-command (com-open-line :name t :command-table editing-table)
-    ((numarg 'integer :prompt "How many lines?"))
+    ((numarg 'integer :prompt "How many lines?" :default 1))
   "Insert a #\Newline and leave point before it.
 With a numeric argument greater than 1, insert that many #\Newlines."
   (open-line (point) numarg))
@@ -125,7 +125,7 @@
       `(define-command (,(symbol "COM-MARK-" unit)
                          :name t
                          :command-table ,command-table)
-           ((count 'integer :prompt ,(concat "Number of " plural)))
+           ((count 'integer :prompt ,(concat "Number of " plural) :default 1))
          ,(if (not (null move-point))
               (concat "Place point and mark around the current " noun ".
 Put point at the beginning of the current " noun ", and mark at the end. 
@@ -349,17 +349,17 @@
 
 (define-command (com-delete-horizontal-space :name t :command-table deletion-table)
     ((backward-only-p
-      'boolean :prompt "Delete backwards only?"))
+      'boolean :prompt "Delete backwards only?" :default nil))
   "Delete whitespace around point.
 With a numeric argument, only delete whitespace before point."
   (delete-horizontal-space (point) (current-syntax) backward-only-p))
 
-(set-key `(com-delete-horizontal-space ,*numeric-argument-p*)
+(set-key `(com-delete-horizontal-space ,*numeric-argument-marker*)
 	 'deletion-table
 	 '((#\\ :meta)))
 
 (define-command (com-just-one-space :name t :command-table deletion-table)
-    ((count 'integer :prompt "Number of spaces"))
+    ((count 'integer :prompt "Number of spaces" :default 1))
   "Delete whitespace around point, leaving a single space.
 With a positive numeric argument, leave that many spaces.
 
@@ -402,7 +402,7 @@
 	 '((#\x :control) (#\x :control)))
 
 (define-command (com-sort-lines :name t :command-table editing-table)
-    ((sort-ascending 'boolean :prompt "Sort in ascending order"))
+    ((sort-ascending 'boolean :prompt "Sort in ascending order" :default nil))
   "Sort the lines in the region delimited by current point and
 mark. The lines will be lexicographically sorted, ignoring all
 non-character objects in the lines. When the command is run, it
@@ -481,7 +481,7 @@
 	 '((#\y :meta)))
 
 (define-command (com-resize-kill-ring :name t :command-table editing-table) 
-    ((size 'integer :prompt "New kill ring size"))
+    ((size 'integer :prompt "New kill ring size" :default 5))
   "Prompt for a new size for the kill ring.
 The default is 5. A number less than 5 will be replaced by 5."
      (setf (kill-ring-max-size *kill-ring*) size))
@@ -572,8 +572,8 @@
 	 '((#\/ :meta)))
 
 (define-command (com-mark-page :name t :command-table marking-table)
-    ((count 'integer :prompt "Move how many pages")
-     (numargp 'boolean :prompt "Move to another page?"))
+    ((count 'integer :prompt "Move how many pages" :default 1)
+     (numargp 'boolean :prompt "Move to another page?" :default nil))
   "Place point and mark around the current page.
 With a numeric argument, move point that many 
 pages forward (backward if negative) before marking the 
@@ -589,7 +589,7 @@
   (setf (offset (mark)) (offset (point)))
   (forward-page (mark) (current-syntax) 1))
 
-(set-key `(com-mark-page ,*numeric-argument-marker* ,*numeric-argument-p*)
+(set-key `(com-mark-page ,*numeric-argument-marker* ,*numeric-argument-marker*)
 	 'marking-table
 	 '((#\x :control) (#\p :control)))
 
@@ -608,15 +608,15 @@
   (insert-pair mark syntax count #\( #\)))
 
 (define-command (com-insert-parentheses :name t :command-table editing-table)
-    ((count 'integer :prompt "Number of expressions")
-     (wrap-p 'boolean :prompt "Wrap expressions?"))
+    ((count 'integer :prompt "Number of expressions" :default 1)
+     (wrap-p 'boolean :prompt "Wrap expressions?" :default nil))
   "Insert a pair of parentheses, leaving point in between.
 With a numeric argument, enclose that many expressions 
 forward (backward if negative)."
   (unless wrap-p (setf count 0))
   (insert-parentheses (point) (current-syntax) count))
 
-(set-key `(com-insert-parentheses ,*numeric-argument-marker* ,*numeric-argument-p*)
+(set-key `(com-insert-parentheses ,*numeric-argument-marker* ,*numeric-argument-marker*)
 	 'editing-table
 	 '((#\( :meta)))
 
--- /project/mcclim/cvsroot/mcclim/Drei/basic-commands.lisp	2007/12/08 08:53:50	1.8
+++ /project/mcclim/cvsroot/mcclim/Drei/basic-commands.lisp	2007/12/19 11:02:05	1.9
@@ -85,7 +85,7 @@
       `(PROGN
          (DEFINE-COMMAND (,com-forward :NAME T
                                        :COMMAND-TABLE ,command-table)
-             ((COUNT 'INTEGER :PROMPT ,(concat "Number of " plural)))
+             ((COUNT 'INTEGER :PROMPT ,(concat "Number of " plural) :default 1))
            ,(concat "Move point forward by one " noun ".
 With a numeric argument N, move point forward by N " plural ".
 With a negative argument -N, move point backward by N " plural ".")
@@ -93,10 +93,9 @@
              (,forward (point)
                        (current-syntax)
                        COUNT)))
-         (DEFINE-COMMAND (,com-backward
-                          :NAME T
+         (DEFINE-COMMAND (,com-backward :NAME T
                           :COMMAND-TABLE ,command-table)
-             ((COUNT 'INTEGER :PROMPT ,(concat "Number of " plural)))
+             ((COUNT 'INTEGER :PROMPT ,(concat "Number of " plural) :default 1))
            ,(concat "Move point backward by one " noun ".
 With a numeric argument N, move point backward by N " plural ".
 With a negative argument -N, move point forward by N " plural ".")
@@ -119,7 +118,7 @@
 ;; and BACKWARD-OBJECT is part of the buffer protocol, not the
 ;; high-level motion abstraction.
 (define-command (com-forward-object :name t :command-table movement-table)
-    ((count 'integer :prompt "Number of objects"))
+    ((count 'integer :prompt "Number of objects" :default 1))
   "Move point forward by one object.
 With a numeric argument N, move point forward by N objects.
 With a negative argument -N, move point backward by M objects."
@@ -128,7 +127,7 @@
                     count)))
 
 (define-command (com-backward-object :name t :command-table movement-table)
-    ((count 'integer :prompt "number of objects"))
+    ((count 'integer :prompt "number of objects" :default 1))
   "Move point backward by one object.
 With a numeric argument N, move point backward by N objects.
 With a negative argument -N, move point forward by N objects."
@@ -278,7 +277,7 @@
            ;; Kill Unit
            (define-command (,com-kill :name t
                                       :command-table ,command-table)
-               ((count 'integer :prompt ,(concat "Number of " plural)))
+               ((count 'integer :prompt ,(concat "Number of " plural) :default 1))
              ,(concat "Kill " plural " up to the next " noun " end.
 With a numeric argument, kill forward (backward if negative) 
 that many " plural ".
@@ -294,7 +293,7 @@
            (define-command (,com-backward-kill
                             :name t
                             :command-table ,command-table)
-               ((count 'integer :prompt ,(concat "Number of " plural)))
+               ((count 'integer :prompt ,(concat "Number of " plural) :default 1))
              ,(concat "Kill from point until the previous " noun " beginning.
 With a numeric argument, kill backward (forward, if negative) 
 that many " plural ".
@@ -308,14 +307,14 @@
 
            ;; Delete Unit
            (define-command (,com-delete :name t :command-table ,command-table)
-               ((count 'integer :prompt ,(concat "Number of " plural)))
+               ((count 'integer :prompt ,(concat "Number of " plural) :default 1))
              ,(concat "Delete from point until the next " noun " end.
 With a positive numeric argument, delete that many " plural " forward.")
              (,backward-delete (point) (current-syntax) count))
 
            ;; Backward Delete Unit
            (define-command (,com-backward-delete :name t :command-table ,command-table)
-               ((count 'integer :prompt ,(concat "Number of " plural)))
+               ((count 'integer :prompt ,(concat "Number of " plural) :default 1))
              ,(concat "Delete from point until the previous " noun " beginning.
 With a positive numeric argument, delete that many " plural " backward.")
              (,backward-delete (point) (current-syntax) count)))))))
@@ -363,8 +362,8 @@
   (transpose-objects (point)))
 
 (define-command (com-delete-object :name t :command-table deletion-table)
-    ((count 'integer :prompt "Number of Objects")
-     (killp 'boolean :prompt "Kill?"))
+    ((count 'integer :prompt "Number of Objects" :default 1)
+     (killp 'boolean :prompt "Kill?" :default nil))
   "Delete the object after point.
 With a numeric argument, kill that many objects 
 after (or before, if negative) point."
@@ -374,8 +373,8 @@
         (forward-delete-object (point) count))))
 
 (define-command (com-backward-delete-object :name t :command-table deletion-table)
-    ((count 'integer :prompt "Number of Objects")
-     (killp 'boolean :prompt "Kill?"))
+    ((count 'integer :prompt "Number of Objects" :default 1)
+     (killp 'boolean :prompt "Kill?" :default nil))
   "Delete the object before point.
 With a numeric argument, kills that many objects 
 before (or after, if negative) point."
@@ -415,8 +414,8 @@
       (delete-region start mark))))
 
 (define-command (com-kill-line :name t :command-table deletion-table)
-    ((numarg 'integer :prompt "Kill how many lines?")
-     (numargp 'boolean :prompt "Kill entire lines?"))
+    ((numarg 'integer :prompt "Kill how many lines?" :default 1)
+     (numargp 'boolean :prompt "Kill entire lines?" :default nil))
   "Kill the objects on the current line after point.
 When at the end of a line, kill the #\\Newline. 
 With a numeric argument of 0, kill the objects on the current line before point.
@@ -456,17 +455,17 @@
 	 '((#\x :control) (#\t :control)))
 
 (set-key `(com-delete-object ,*numeric-argument-marker*
-			     ,*numeric-argument-p*)
+			     ,*numeric-argument-marker*)
 	 'deletion-table
 	 '(#\Rubout))
 
 (set-key `(com-delete-object ,*numeric-argument-marker*
-			     ,*numeric-argument-p*)
+			     ,*numeric-argument-marker*)
 	 'deletion-table
 	 '((#\d :control)))
 
 (set-key `(com-backward-delete-object ,*numeric-argument-marker*
-				      ,*numeric-argument-p*)
+				      ,*numeric-argument-marker*)
 	 'deletion-table
 	 '(#\Backspace))
 
@@ -474,7 +473,7 @@
 	 'editing-table
 	 '((#\t :control)))
 
-(set-key `(com-kill-line ,*numeric-argument-marker* ,*numeric-argument-p*)
+(set-key `(com-kill-line ,*numeric-argument-marker* ,*numeric-argument-marker*)
 	 'deletion-table
 	 '((#\k :control)))
 
@@ -485,7 +484,7 @@
 ;;; These are what do the basic keypress->character inserted in buffer
 ;;; mapping.
 
-(define-command com-self-insert ((count 'integer))
+(define-command com-self-insert ((count 'integer :default 1))
   (loop repeat count do (insert-character *current-gesture*)))
 
 (loop for code from (char-code #\Space) to (char-code #\~)




More information about the Mcclim-cvs mailing list