* riece-display.el (riece-configure-windows-predicate): New function.
authorueno <ueno>
Fri, 30 May 2003 01:32:02 +0000 (01:32 +0000)
committerueno <ueno>
Fri, 30 May 2003 01:32:02 +0000 (01:32 +0000)
(riece-configure-windows-predicate): New user option.
(riece-redisplay-buffers): Use it.

lisp/ChangeLog
lisp/riece-display.el

index 9b8c879..ee62fc8 100644 (file)
@@ -1,5 +1,9 @@
 2003-05-30  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-display.el (riece-configure-windows-predicate): New function.
+       (riece-configure-windows-predicate): New user option.
+       (riece-redisplay-buffers): Use it.
+
        * riece-complete.el: Require 'cl for butlast.
 
        * Makefile.am (elc): Renamed from "compile".
index be5934c..b99f12b 100644 (file)
   :type 'function
   :group 'riece-looks)
 
+(defcustom riece-configure-windows-predicate
+  #'riece-configure-windows-predicate
+  "Function to check whether window reconfiguration is needed."
+  :type 'function
+  :group 'riece-looks)
+
 (defun riece-configure-windows ()
   (let ((buffer (current-buffer))
        (show-user-list
     (if (riece-identity-equal-no-server identity riece-current-channel)
        (riece-switch-to-nearest-channel pointer))))
 
+(defun riece-configure-windows-predicate ()
+  ;; The current channel is changed, and some buffers are visible.
+  (unless (equal riece-last-channel riece-current-channel)
+    (let ((buffers riece-buffer-list))
+      (catch 'found
+       (while buffers
+         (if (and (buffer-live-p (car buffers))
+                  (get-buffer-window (car buffers)))
+             (throw 'found t)
+           (setq buffers (cdr buffers))))))))
+
 (defun riece-redisplay-buffers (&optional force)
   (riece-update-buffers)
   (if (or force
-         ;; The current channel is changed, and some buffers are visible.
-         (unless (equal riece-last-channel riece-current-channel)
-           (let ((buffers riece-buffer-list))
-             (catch 'found
-               (while buffers
-                 (if (and (buffer-live-p (car buffers))
-                          (get-buffer-window (car buffers)))
-                     (throw 'found t)
-                   (setq buffers (cdr buffers))))))))
+         (funcall riece-configure-windows-predicate))
       (funcall riece-configure-windows-function)))
 
 (provide 'riece-display)