From: yamaoka Date: Wed, 8 Mar 2006 22:36:01 +0000 (+0000) Subject: Synch to No Gnus 200603081441. X-Git-Tag: t-gnus-6_17_4-quimby-~49 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1f2da44de81d8e68dfe803c89608bd7a6dbf9a4;p=elisp%2Fgnus.git- Synch to No Gnus 200603081441. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b44fac..40ba7ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2006-03-08 Reiner Steib + + * gnus-util.el (gnus-tool-bar-update): New function. + + * gnus-group.el (gnus-group-update-tool-bar): New variable. + (gnus-group-insert-group-line): Add gnus-tool-bar-update. + + * gnus-topic.el (gnus-topic-prepare-topic): Add gnus-tool-bar-update. + + * gnus-group.el (gnus-group-redraw-when-idle) + (gnus-group-redraw-check): Remove. + (gnus-group-make-tool-bar): Remove gnus-group-redraw-check. + 2006-03-08 Katsumi Yamaoka * nnmail.el (nnmail-split-it): Invert match-partial-words behavior diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 62e198a..fa3ef6f 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1009,19 +1009,6 @@ simple manner.") (defvar gnus-group-tool-bar-map nil) -;; Work around for Emacs not updating the tool bar automatically, see -; http://www.google.com/groups?as_umsgid=v9u0an3hti.fsf@marauder.physik.uni-ulm.de -;; Don't make this customizable yet. -(defvar gnus-group-redraw-when-idle 2 - "When non-nil, redraw the Group buffer frame when idle. -Internal variable.") - -(defun gnus-group-redraw-check () - "Check if we need to redraw the frame." - (when gnus-group-redraw-when-idle - (run-with-idle-timer gnus-group-redraw-when-idle - nil 'force-window-update))) - (defun gnus-group-tool-bar-update (&optional symbol value) "Update group buffer toolbar. Setter function for custom variables." @@ -1144,8 +1131,6 @@ When FORCE, rebuild the tool bar." ;; The Gnus 5.10.6 code checked (default-value 'tool-bar-mode). ;; Why? --rsteib (or (not gnus-group-tool-bar-map) force)) - (when gnus-group-redraw-when-idle - (add-hook 'post-command-hook 'gnus-group-redraw-check nil t)) (let* ((load-path (gmm-image-load-path-for-library "gnus" "gnus/toggle-subscription.xpm" @@ -1560,6 +1545,18 @@ if it is a string, only list groups matching REGEXP." (gnus-range-difference (list active) (gnus-info-read info)) seen)))))) +(defcustom gnus-group-update-tool-bar + (and (not (featurep 'xemacs)) + (boundp 'tool-bar-mode) + tool-bar-mode + ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs 21 might + ;; be confusing, so maybe we shouldn't call it by default. + (fboundp 'force-window-update)) + "Force updating the group buffer tool bar." + :group 'gnus-group + :version "22.1" + :type 'boolean) + (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level gnus-tmp-marked number gnus-tmp-method) @@ -1624,8 +1621,10 @@ if it is a string, only list groups matching REGEXP." (if (member gnus-tmp-group gnus-group-marked) gnus-process-mark ? )) (buffer-read-only nil) + beg end header gnus-tmp-header) ; passed as parameter to user-funcs. (beginning-of-line) + (setq beg (point)) (gnus-add-text-properties (point) (prog1 (1+ (point)) @@ -1640,6 +1639,12 @@ if it is a string, only list groups matching REGEXP." gnus-marked ,gnus-tmp-marked-mark gnus-indentation ,gnus-group-indentation gnus-level ,gnus-tmp-level)) + (setq end (point)) + (when gnus-group-update-tool-bar + (gnus-put-text-property beg end 'point-entered + 'gnus-tool-bar-update) + (gnus-put-text-property beg end 'point-left + 'gnus-tool-bar-update)) (forward-line -1) (when (inline (gnus-visual-p 'group-highlight 'highlight)) (gnus-run-hooks 'gnus-group-update-hook)) diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index 0d29945..438a2c0 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -584,6 +584,11 @@ articles in the topic and its subtopics." (not (eq (nth 2 type) 'hidden)) level all-entries unread)) (gnus-topic-update-unreads (car type) unread) + (when gnus-group-update-tool-bar + (gnus-put-text-property beg end 'point-entered + 'gnus-tool-bar-update) + (gnus-put-text-property beg end 'point-left + 'gnus-tool-bar-update)) (goto-char end) unread)) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index de60d31..19b4e7d 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1457,6 +1457,23 @@ Return nil otherwise." display)) display))))) +(defun gnus-tool-bar-update (&rest ignore) + "Update the tool bar." + (when (and (boundp 'tool-bar-mode) + tool-bar-mode) + (let* ((args nil) + (func (cond ((featurep 'xemacs) + 'ignore) + ((fboundp 'tool-bar-update) + 'tool-bar-update) + ((fboundp 'force-window-update) + 'force-window-update) + ((fboundp 'redraw-frame) + (setq args (list (selected-frame))) + 'redraw-frame) + (t 'ignore)))) + (apply func args)))) + ;; Fixme: This has only one use (in gnus-agent), which isn't worthwhile. (defmacro gnus-mapcar (function seq1 &rest seqs2_n) "Apply FUNCTION to each element of the sequences, and make a list of the results.