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

Aleksandar Bakic abakic at common-lisp.net
Sun Jan 9 02:42:19 UTC 2005


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

Modified Files:
	gui.lisp packages.lisp 
Log Message:
Overwrite mode: first iteration (no protocol changes).

Date: Sun Jan  9 03:42:15 2005
Author: abakic

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.57 climacs/gui.lisp:1.58
--- climacs/gui.lisp:1.57	Sat Jan  8 18:16:19 2005
+++ climacs/gui.lisp	Sun Jan  9 03:42:14 2005
@@ -104,13 +104,18 @@
 (defun display-message (format-string &rest format-args)
   (apply #'format *standard-input* format-string format-args))
 
+(defvar *overwrite-mode* nil)
+
 (defun display-info (frame pane)
   (let* ((win (win frame))
 	 (buf (buffer win))
-	 (name-info (format nil "   ~a   ~a   Syntax: ~a"
+	 (name-info (format nil "   ~a   ~a   Syntax: ~a ~a"
 			    (if (needs-saving buf) "**" "--")
 			    (name buf)
-			    (name (syntax win)))))
+			    (name (syntax win))
+			    (if *overwrite-mode*
+				"Ovwrt"
+				(format nil "L~d" (line-number (point win)))))))
     (princ name-info pane)))
 
 (defun display-win (frame pane)
@@ -236,10 +241,18 @@
 (define-named-command (com-quit) ()
   (frame-exit *application-frame*))
 
+(define-named-command com-toggle-overwrite-mode ()
+  (setf *overwrite-mode* (not *overwrite-mode*)))
+
 (define-command com-self-insert ()
-  (unless (constituentp *current-gesture*)
-    (possibly-expand-abbrev (point (win *application-frame*))))
-  (insert-object (point (win *application-frame*)) *current-gesture*))
+  (let ((point (point (win *application-frame*))))
+    (unless (constituentp *current-gesture*)
+      (possibly-expand-abbrev point))
+    (if (and *overwrite-mode* (not (end-of-line-p point)))
+	(progn
+	  (delete-range point)
+	  (insert-object point *current-gesture*))
+	(insert-object point *current-gesture*))))
 
 (define-named-command com-beginning-of-line ()
   (beginning-of-line (point (win *application-frame*))))
@@ -707,6 +720,8 @@
 (global-set-key '(:end :control) 'com-end-of-buffer)
 (global-set-key #\Rubout 'com-delete-object)
 (global-set-key #\Backspace 'com-backward-delete-object)
+
+(global-set-key '(:insert) 'com-toggle-overwrite-mode)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 


Index: climacs/packages.lisp
diff -u climacs/packages.lisp:1.22 climacs/packages.lisp:1.23
--- climacs/packages.lisp:1.22	Fri Jan  7 14:07:45 2005
+++ climacs/packages.lisp	Sun Jan  9 03:42:14 2005
@@ -33,7 +33,7 @@
 	   #:beginning-of-line-p #:end-of-line-p
 	   #:line-number #:column-number
 	   #:insert-buffer-object #:insert-buffer-sequence
-	   #:insert-object #:insert-sequence
+	   #:update-object #:insert-object #:insert-sequence
 	   #:delete-buffer-range #:delete-range
 	   #:delete-region
 	   #:buffer-object #:buffer-sequence




More information about the Climacs-cvs mailing list