[climacs-cvs] CVS update: climacs/window-commands.lisp climacs/gui.lisp
Dave Murray
dmurray at common-lisp.net
Sun Nov 13 09:24:47 UTC 2005
Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv24708
Modified Files:
window-commands.lisp gui.lisp
Log Message:
Replaced (typep x 'extended-pane) tests with new gf buffer-pane-p.
Fixed command-table bug with non-buffer panes. Still need a way to
choose command-tables for non-buffer panes e.g. help panes.
Date: Sun Nov 13 10:24:46 2005
Author: dmurray
Index: climacs/window-commands.lisp
diff -u climacs/window-commands.lisp:1.1 climacs/window-commands.lisp:1.2
--- climacs/window-commands.lisp:1.1 Sat Nov 12 10:38:32 2005
+++ climacs/window-commands.lisp Sun Nov 13 10:24:45 2005
@@ -194,7 +194,7 @@
(define-command (com-switch-to-this-window :name nil :command-table window-table)
((window 'pane) (x 'integer) (y 'integer))
(other-window window)
- (when (typep window 'extended-pane)
+ (when (buffer-pane-p window)
(setf (offset (point window))
(click-to-offset window x y))))
@@ -207,7 +207,7 @@
(define-command (com-mouse-save :name nil :command-table window-table)
((window 'pane) (x 'integer) (y 'integer))
- (when (and (typep window 'extended-pane)
+ (when (and (buffer-pane-p window)
(eq window (current-window)))
(setf (offset (mark window))
(click-to-offset window x y))
@@ -223,7 +223,7 @@
(define-command (com-yank-here :name nil :command-table window-table)
((window 'pane) (x 'integer) (y 'integer))
- (when (typep window 'extended-pane)
+ (when (buffer-pane-p window)
(other-window window)
(setf (offset (point window))
(click-to-offset window x y))
Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.196 climacs/gui.lisp:1.197
--- climacs/gui.lisp:1.196 Sun Nov 13 00:09:34 2005
+++ climacs/gui.lisp Sun Nov 13 10:24:45 2005
@@ -37,6 +37,16 @@
(dabbrev-expansion-mark :initform nil)
(overwrite-mode :initform nil)))
+(defgeneric buffer-pane-p (pane)
+ (:documentation "Returns T when a pane contains a buffer."))
+
+(defmethod buffer-pane-p (pane)
+ (declare (ignore pane))
+ nil)
+
+(defmethod buffer-pane-p ((pane extended-pane))
+ T)
+
(defclass climacs-info-pane (info-pane)
()
(:default-initargs
@@ -149,7 +159,7 @@
(defmethod redisplay-frame-panes :around ((frame climacs) &rest args)
(declare (ignore args))
(let ((buffers (remove-duplicates (loop for pane in (windows frame)
- when (typep pane 'extended-pane)
+ when (buffer-pane-p pane)
collect (buffer pane)))))
(loop for buffer in buffers
do (update-syntax buffer (syntax buffer)))
@@ -226,7 +236,7 @@
(defmethod execute-frame-command :around ((frame climacs) command)
(handler-case
- (if (typep (current-window) 'extended-pane)
+ (if (buffer-pane-p (current-window))
(with-undo ((buffer (current-window)))
(call-next-method))
(call-next-method))
@@ -252,8 +262,10 @@
(defmethod find-applicable-command-table ((frame climacs))
(or
- (let ((syntax (syntax (buffer (current-window)))))
- (and (slot-exists-p syntax 'command-table)
+ (let ((syntax (and (buffer-pane-p (current-window))
+ (syntax (buffer (current-window))))))
+ (and syntax
+ (slot-exists-p syntax 'command-table)
(slot-boundp syntax 'command-table)
(slot-value syntax 'command-table)))
(find-command-table 'global-climacs-table)))
More information about the Climacs-cvs
mailing list