[mcclim-cvs] CVS mcclim/Drei

ahefner ahefner at common-lisp.net
Sat Dec 8 23:25:23 UTC 2007


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

Modified Files:
	core-commands.lisp core.lisp lisp-syntax-commands.lisp 
	packages.lisp 
Log Message:
Fix insert-pair, add move-past-close-and-reindent, bind M-), C-M-Delete,
and C-M-Backspace as expected.


--- /project/mcclim/cvsroot/mcclim/Drei/core-commands.lisp	2007/12/08 08:53:50	1.7
+++ /project/mcclim/cvsroot/mcclim/Drei/core-commands.lisp	2007/12/08 23:25:23	1.8
@@ -611,9 +611,7 @@
      (wrap-p 'boolean :prompt "Wrap expressions?"))
   "Insert a pair of parentheses, leaving point in between.
 With a numeric argument, enclose that many expressions 
-forward (backward if negative).
-
-FIXME: no it doesn't."
+forward (backward if negative)."
   (unless wrap-p (setf count 0))
   (insert-parentheses (point) (current-syntax) count))
 
@@ -626,6 +624,15 @@
   (setf (region-visible-p *drei-instance*)
         (not (region-visible-p *drei-instance*))))
 
+(define-command (com-move-past-close-and-reindent :name t :command-table editing-table)
+    ()
+  "Move past the next `)' and reindent"
+  (move-past-close-and-reindent (current-view) (point)))
+
+(set-key `(com-move-past-close-and-reindent)
+	 'editing-table
+	 '((#\) :meta)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 
 ;;; Rectangle editing
--- /project/mcclim/cvsroot/mcclim/Drei/core.lisp	2007/12/08 08:53:50	1.8
+++ /project/mcclim/cvsroot/mcclim/Drei/core.lisp	2007/12/08 23:25:23	1.9
@@ -81,16 +81,27 @@
 	 (setf count (- count))
 	 (loop repeat count do (backward-expression mark syntax))))
   (unless (or (beginning-of-buffer-p mark)
-	      (whitespacep syntax (object-before mark)))
+              (char= open (object-before mark))
+              (whitespacep syntax (object-before mark)))
     (insert-object mark #\Space))
   (insert-object mark open)
-  (let ((here (clone-mark mark)))
+  (let ((saved-offset (offset mark)))
     (loop repeat count
-	  do (forward-expression here syntax))
-    (insert-object here close)
-    (unless (or (end-of-buffer-p here)
-		(whitespacep syntax (object-after here)))
-      (insert-object here #\Space))))
+	  do (forward-expression mark syntax))
+    (insert-object mark close)
+
+    (unless (or (end-of-buffer-p mark)
+                (char= close (object-after mark))
+		(whitespacep syntax
+                             (object-after mark)))
+      (insert-object mark #\Space))
+    (setf (offset mark) saved-offset)))
+
+(defun move-past-close-and-reindent (view point)
+  (loop until (eql (object-after point) #\))
+	do (forward-object point))
+  (forward-object point)
+  (indent-current-line view point))
 
 (defun goto-position (mark pos)
   (setf (offset mark) pos))
--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-commands.lisp	2007/12/08 08:53:50	1.11
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax-commands.lisp	2007/12/08 23:25:23	1.12
@@ -243,3 +243,12 @@
 (set-key `(com-eval-last-expression ,*numeric-argument-p*)
          'pane-lisp-table
          '((#\c :control) (#\e :control)))
+
+(set-key `(com-backward-kill-expression ,*numeric-argument-marker*)
+	 'lisp-table
+	 '((#\Backspace :control :meta)))
+
+(set-key `(com-kill-expression ,*numeric-argument-marker*)
+	 'lisp-table
+	 '((#\Delete :control :meta)))
+
--- /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2007/12/08 08:53:49	1.19
+++ /project/mcclim/cvsroot/mcclim/Drei/packages.lisp	2007/12/08 23:25:23	1.20
@@ -422,6 +422,7 @@
            #:delete-horizontal-space
            #:indent-current-line
            #:insert-pair
+           #:move-past-close-and-reindent
            #:downcase-word #:upcase-word #:capitalize-word
            #:indent-region
            #:fill-line #:fill-region




More information about the Mcclim-cvs mailing list