From: ueno Date: Fri, 30 May 2003 01:32:02 +0000 (+0000) Subject: * riece-display.el (riece-configure-windows-predicate): New function. X-Git-Tag: riece-0_0_2~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33f6873820fe0add54b2152ad9691cfae5f098d8;p=elisp%2Friece.git * riece-display.el (riece-configure-windows-predicate): New function. (riece-configure-windows-predicate): New user option. (riece-redisplay-buffers): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b8c879..ee62fc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2003-05-30 Daiki Ueno + * 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". diff --git a/lisp/riece-display.el b/lisp/riece-display.el index be5934c..b99f12b 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -39,6 +39,12 @@ :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 @@ -251,18 +257,21 @@ (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)