[beirc-cvs] CVS beirc

dlichteblau dlichteblau at common-lisp.net
Sat Feb 24 19:33:38 UTC 2007


Update of /project/beirc/cvsroot/beirc
In directory clnet:/tmp/cvs-serv13990

Modified Files:
	application.lisp 
Log Message:

"repaired define-window-switcher", take #2.

While the previous check-in was correct, it was still converting pages
to panes and back to pages.  Here's a new version using just pages.


--- /project/beirc/cvsroot/beirc/application.lisp	2007/02/24 19:25:49	1.86
+++ /project/beirc/cvsroot/beirc/application.lisp	2007/02/24 19:33:37	1.87
@@ -419,30 +419,28 @@
                     ()
                   (let* ((tab-layout
 			  (find-pane-named *application-frame* 'query))
-			 (current-pane (tab-page-pane
-                                        (tab-layout-enabled-page tab-layout)))
-                         (list-of-panes (mapcar #'tab-page-pane
-						(tab-layout-pages tab-layout)))
-                         (n-panes (length list-of-panes))
-                         (current-pane-position (position current-pane list-of-panes))
-                         (position current-pane-position)
+			 (current-page (tab-layout-enabled-page tab-layout))
+                         (list-of-pages (tab-layout-pages tab-layout))
+                         (n-pages (length list-of-pages))
+                         (current-page-position (position current-page list-of-pages))
+                         (position current-page-position)
                          (predicate ,predicate)
                          (step-by ,direction)
-                         (start-position (- current-pane-position (* step-by n-panes)))
-                         (end-position (+ current-pane-position (* step-by n-panes))))
-                    (when list-of-panes
+                         (start-position (- current-page-position (* step-by n-pages)))
+                         (end-position (+ current-page-position (* step-by n-pages))))
+                    (when list-of-pages
                       (setf position
                             (loop for i = (+ step-by start-position) then (+ i step-by)
                                   until (or (= i end-position)
-                                            (funcall predicate (nth (mod (+ n-panes i) n-panes) list-of-panes)))
+                                            (funcall predicate (nth (mod (+ n-pages i) n-pages) list-of-pages)))
                                   finally (return i)))
-                      (switch-to-page (sheet-to-page (nth (mod (+ n-panes position) n-panes) list-of-panes))))))))
-  (labels ((pane-interesting-p (pane)
-             (let ((receiver (receiver-from-tab-page (sheet-to-page pane))))
+                      (switch-to-page (nth (mod (+ n-pages position) n-pages) list-of-pages)))))))
+  (labels ((page-interesting-p (page)
+             (let ((receiver (receiver-from-tab-page page)))
                (or (> (messages-directed-to-me receiver) 0)
                    (> (unseen-messages receiver) 0)))))
-    (define-window-switcher com-interesting-window-next (#\Tab :control) 1 #'pane-interesting-p)
-    (define-window-switcher com-interesting-window-previous (:iso-left-tab :control :shift) -1 #'pane-interesting-p)
+    (define-window-switcher com-interesting-window-next (#\Tab :control) 1 #'page-interesting-p)
+    (define-window-switcher com-interesting-window-previous (:iso-left-tab :control :shift) -1 #'page-interesting-p)
     (define-window-switcher com-window-next (:next :control) 1 (constantly t))
     (define-window-switcher com-window-previous (:prior :control) -1 (constantly t))))
 




More information about the Beirc-cvs mailing list