* gnus-nocem.el (gnus-nocem-scan-groups): Add autoload cookie; scan latest
[gnus] / lisp / gnus-group.el
index f791c25..14b5a9b 100644 (file)
@@ -1010,8 +1010,9 @@ Setter function for custom variables."
     (with-current-buffer gnus-group-buffer
       (gnus-group-make-tool-bar t))))
 
-;; The default will be changed when the new icons have been checked in:
-(defcustom gnus-group-tool-bar 'gnus-group-tool-bar-retro
+(defcustom gnus-group-tool-bar (if (eq gmm-tool-bar-style 'gnome)
+                                  'gnus-group-tool-bar-gnome
+                                'gnus-group-tool-bar-retro)
   "Specifies the Gnus group tool bar.
 
 It can be either a list or a symbol refering to a list.  See
@@ -1031,30 +1032,35 @@ Pre-defined symbols include `gnus-group-tool-bar-gnome' and
 
 (defcustom gnus-group-tool-bar-gnome
   '((gnus-group-post-news "mail/compose")
-    (gnus-group-get-new-news "mail/inbox") ;; Add... nil :visible gnus-plugged ?
-    ;; FIXME: gnus-*-read-group should have a better help text.
-    (gnus-topic-read-group "open" nil :visible gnus-topic-mode)
-    (gnus-group-read-group "open" nil :visible (not gnus-topic-mode))
-    ;; (gnus-group-find-new-groups "???" nil)
-    (gnus-group-save-newsrc "save")
-    (gnus-group-describe-group "describe")
-    (gnus-group-unsubscribe-current-group "gnus/toggle-subscription")
-    ;; (gnus-group-subscribe "subscribe" t
-    ;;                           :help "Subscribe to the current group")
-    ;; (gnus-group-unsubscribe "unsubscribe" t
-    ;;                             :help "Unsubscribe from the current group")
-    ;;
     ;; Some useful agent icons?  I don't use the agent so agent users should
     ;; suggest useful commands:
+    (gnus-agent-toggle-plugged "connect" t
+                              :visible (and gnus-agent (not gnus-plugged)))
+    (gnus-agent-toggle-plugged "disconnect" t
+                              :visible (and gnus-agent gnus-plugged))
+    ;; FIXME: gnus-agent-toggle-plugged (in gnus-agent-group-make-menu-bar)
+    ;; should have a better help text.
     (gnus-group-send-queue "mail/outbox" t
                           :visible (and gnus-agent gnus-plugged)
                           :help "Send articles from the queue group")
-    (gnus-agent-toggle-plugged "connect" nil
-                              :visible (and gnus-agent (not gnus-plugged)))
-    (gnus-agent-toggle-plugged "disconnect" nil
-                              :visible (and gnus-agent gnus-plugged))
-    ;;
+    (gnus-group-get-new-news "mail/inbox" nil
+                            :visible (or (not gnus-agent)
+                                         gnus-plugged))
+    ;; FIXME: gnus-*-read-group should have a better help text.
+    (gnus-topic-read-group "open" nil
+                          :visible (and (boundp 'gnus-topic-mode)
+                                        gnus-topic-mode))
+    (gnus-group-read-group "open" nil
+                          :visible (not (and (boundp 'gnus-topic-mode)
+                                             gnus-topic-mode)))
+    ;; (gnus-group-find-new-groups "???" nil)
+    (gnus-group-save-newsrc "save")
+    (gnus-group-describe-group "describe")
+    (gnus-group-unsubscribe-current-group "gnus/toggle-subscription")
+    (gnus-group-prev-unread-group "left-arrow")
+    (gnus-group-next-unread-group "right-arrow")
     (gnus-group-exit "exit")
+    (gmm-customize-mode "preferences" t :help "Edit mode preferences")
     (gnus-info-find-node "help"))
   "List of functions for the group tool bar (GNOME style).
 
@@ -1066,15 +1072,15 @@ See `gmm-tool-bar-from-list' for the format of the list."
   :group 'gnus-group)
 
 (defcustom gnus-group-tool-bar-retro
-  '((gnus-group-get-new-news "get-news")
-    (gnus-group-get-new-news-this-group "gnntg")
-    (gnus-group-catchup-current "catchup")
-    (gnus-group-describe-group "describe-group")
-    (gnus-group-subscribe "subscribe" t
+  '((gnus-group-get-new-news "gnus/get-news")
+    (gnus-group-get-new-news-this-group "gnus/gnntg")
+    (gnus-group-catchup-current "gnus/catchup")
+    (gnus-group-describe-group "gnus/describe-group")
+    (gnus-group-subscribe "gnus/subscribe" t
                          :help "Subscribe to the current group")
-    (gnus-group-unsubscribe "unsubscribe" t
+    (gnus-group-unsubscribe "gnus/unsubscribe" t
                            :help "Unsubscribe from the current group")
-    (gnus-group-exit "exit-gnus" gnus-group-mode-map))
+    (gnus-group-exit "gnus/exit-gnus" gnus-group-mode-map))
   "List of functions for the group tool bar (retro look).
 
 See `gmm-tool-bar-from-list' for the format of the list."
@@ -1116,11 +1122,13 @@ When FORCE, rebuild the tool bar."
             ;; Why?  --rsteib
             (or (not gnus-group-tool-bar-map) force))
     (let* ((load-path
-           (gmm-image-load-path "gnus" "gnus/toggle-subscription.xpm"
-                                'load-path))
+           (gmm-image-load-path-for-library "gnus"
+                                            "gnus/toggle-subscription.xpm"
+                                            nil t))
           (image-load-path
-           (gmm-image-load-path "gnus" "gnus/toggle-subscription.xpm"
-                                'image-load-path))
+           (gmm-image-load-path-for-library "gnus"
+                                            "gnus/toggle-subscription.xpm"
+                                            'image-load-path t))
           (map (gmm-tool-bar-from-list gnus-group-tool-bar
                                        gnus-group-tool-bar-zap-list
                                        'gnus-group-mode-map)))
@@ -1498,6 +1506,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)
@@ -1562,8 +1582,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))
@@ -1578,6 +1600,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))
@@ -3760,7 +3788,10 @@ re-scanning.  If ARG is non-nil and not a number, this will force
 
     ;; We might read in new NoCeM messages here.
     (when (and gnus-use-nocem
-              (null arg))
+              (or (and (numberp gnus-use-nocem)
+                       (numberp arg)
+                       (>= arg gnus-use-nocem))
+                  (not arg)))
       (gnus-nocem-scan-groups))
     ;; If ARG is not a number, then we read the active file.
     (when (and arg (not (numberp arg)))