[climacs-cvs] CVS climacs

thenriksen thenriksen at common-lisp.net
Fri Nov 16 09:25:04 UTC 2007


Update of /project/climacs/cvsroot/climacs
In directory clnet:/tmp/cvs-serv31013

Modified Files:
	gui.lisp core.lisp 
Log Message:
Made code for buffer switching in Climacs a bit more centralised, you
no longer have to use `switch-to-buffer' or experience pain.


--- /project/climacs/cvsroot/climacs/gui.lisp	2007/02/19 22:06:18	1.236
+++ /project/climacs/cvsroot/climacs/gui.lisp	2007/11/16 09:25:03	1.237
@@ -61,6 +61,14 @@
                 (setf (active pane) nil)))
           (windows (pane-frame climacs-pane))))
 
+(defmethod (setf buffer) :before ((buffer climacs-buffer) (pane climacs-pane))
+  (with-accessors ((buffers buffers)) *application-frame*
+    (unless (member buffer buffers)
+      (error "Attempting to switch to a buffer not known to Climacs"))
+    (setf buffers (delete buffer buffers))
+    (push buffer buffers)
+    (full-redisplay pane)))
+
 (defmethod command-table ((drei climacs-pane))
   (command-table (pane-frame drei)))
 
--- /project/climacs/cvsroot/climacs/core.lisp	2007/08/24 13:13:00	1.12
+++ /project/climacs/cvsroot/climacs/core.lisp	2007/11/16 09:25:03	1.13
@@ -68,16 +68,7 @@
 (defgeneric switch-to-buffer (pane buffer))
 
 (defmethod switch-to-buffer ((pane drei) (buffer drei-buffer))
-  (with-accessors ((buffers buffers)) *application-frame*
-   (let* ((position (position buffer buffers))
-          (pane (current-window)))
-     (when position
-       (setf buffers (delete buffer buffers)))
-     (push buffer buffers)
-     (setf (offset (point (buffer pane))) (offset (point pane)))
-     (setf (buffer pane) buffer)
-     (full-redisplay pane)
-     buffer)))
+  (setf (buffer pane) buffer))
 
 (defmethod switch-to-buffer ((pane typeout-pane) (buffer drei-buffer))
   (let ((usable-pane (or (find-if #'(lambda (pane)




More information about the Climacs-cvs mailing list