From 85fd80023e674a28cb941637fc1db0ded29d1a60 Mon Sep 17 00:00:00 2001 From: Reiner Steib Date: Wed, 8 Mar 2006 14:27:20 +0000 Subject: [PATCH] * 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. --- lisp/gnus/ChangeLog | 9 +++++++++ lisp/gnus/gnus-group.el | 20 ++++++++++++++++++++ lisp/gnus/gnus-topic.el | 5 +++++ lisp/gnus/gnus-util.el | 17 +++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 43bfc71eb5e..f2a76109562 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +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. + 2006-03-06 Katsumi Yamaoka * mm-view.el (mm-w3m-cid-retrieve-1): Check carefully whether diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 933c3762ed9..3d20af8b0df 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1379,6 +1379,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) @@ -1447,8 +1459,10 @@ if it is a string, only list groups matching REGEXP." (bbb-grouplens-group-p gnus-tmp-group)) "")) (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)) @@ -1463,6 +1477,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/gnus-topic.el b/lisp/gnus/gnus-topic.el index fc80a26f6b9..45585526bcf 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -585,6 +585,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/gnus-util.el b/lisp/gnus/gnus-util.el index c9a3f8c965a..686fe1cf837 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1459,6 +1459,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. -- 2.39.2