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

Aleksandar Bakic abakic at common-lisp.net
Fri Jan 14 20:44:48 UTC 2005


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

Modified Files:
	gui.lisp 
Log Message:
Turned *overwrite-mode* variable into a slot of climacs-pane. (Perhaps
there should be pane-mixin and buffer-mixin for non-essential slots.)

Date: Fri Jan 14 21:44:47 2005
Author: abakic

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.67 climacs/gui.lisp:1.68
--- climacs/gui.lisp:1.67	Fri Jan 14 14:07:39 2005
+++ climacs/gui.lisp	Fri Jan 14 21:44:47 2005
@@ -6,6 +6,8 @@
 ;;;           Elliott Johnson (ejohnson at fasl.info)
 ;;;  (c) copyright 2005 by
 ;;;           Matthieu Villeneuve (matthieu.villeneuve at free.fr)
+;;;  (c) copyright 2005 by
+;;;           Aleksandar Bakic (a_bakic at yahoo.com)
 
 ;;; This library is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU Library General Public
@@ -46,7 +48,8 @@
    ;; for dynamic abbrev expansion
    (original-prefix :initform nil)
    (prefix-start-offset :initform nil)
-   (dabbrev-expansion-mark :initform nil)))
+   (dabbrev-expansion-mark :initform nil)
+   (overwrite-mode :initform nil)))
 
 (defmethod initialize-instance :after ((pane climacs-pane) &rest args)
   (declare (ignore args))
@@ -108,8 +111,6 @@
 (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))
@@ -117,7 +118,7 @@
 			    (if (needs-saving buf) "**" "--")
 			    (name buf)
 			    (name (syntax win))
-			    (if *overwrite-mode*
+			    (if (slot-value win 'overwrite-mode)
 				"Ovwrt"
 				""))))
     (princ name-info pane)))
@@ -255,13 +256,16 @@
   (frame-exit *application-frame*))
 
 (define-named-command com-toggle-overwrite-mode ()
-  (setf *overwrite-mode* (not *overwrite-mode*)))
+  (let ((win (win *application-frame*)))
+    (setf (slot-value win 'overwrite-mode)
+	  (not (slot-value win 'overwrite-mode)))))
 
 (define-command com-self-insert ()
-  (let ((point (point (win *application-frame*))))
+  (let* ((win (win *application-frame*))
+	 (point (point win)))
     (unless (constituentp *current-gesture*)
       (possibly-expand-abbrev point))
-    (if (and *overwrite-mode* (not (end-of-line-p point)))
+    (if (and (slot-value win 'overwrite-mode) (not (end-of-line-p point)))
 	(progn
 	  (delete-range point)
 	  (insert-object point *current-gesture*))




More information about the Climacs-cvs mailing list