* gnus-sum.el (gnus-summary-tool-bar-gnome): Add
authorReiner Steib <Reiner.Steib@gmx.de>
Tue, 28 Feb 2006 15:30:29 +0000 (15:30 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Tue, 28 Feb 2006 15:30:29 +0000 (15:30 +0000)
gnus-summary-next-page.  Re-order.

* gnus-group.el (gnus-group-tool-bar-gnome): prev-node and
next-node are now included.
(gnus-group-redraw-line-number): New internal variable.
(gnus-group-redraw-check): Helper function for updating the tool
bar.
(gnus-group-tool-bar-update): Add gnus-group-redraw-check.

* gmm-utils.el (gmm-tool-bar-item): Add TODO about modifiers.

lisp/ChangeLog
lisp/gmm-utils.el
lisp/gnus-group.el
lisp/gnus-sum.el

index cb25922..f22c9b1 100644 (file)
@@ -1,5 +1,17 @@
 2006-02-28  Reiner Steib  <Reiner.Steib@gmx.de>
 
+       * gnus-sum.el (gnus-summary-tool-bar-gnome): Add
+       gnus-summary-next-page.  Re-order.
+
+       * gnus-group.el (gnus-group-tool-bar-gnome): prev-node and
+       next-node are now included.
+       (gnus-group-redraw-line-number): New internal variable.
+       (gnus-group-redraw-check): Helper function for updating the tool
+       bar.
+       (gnus-group-tool-bar-update): Add gnus-group-redraw-check.
+
+       * gmm-utils.el (gmm-tool-bar-item): Add TODO about modifiers.
+
        * spam.el (spam-spamassassin-score-regexp): New internal variable.
        (spam-extra-header-to-number, spam-check-spamassassin-headers):
        Use it to match format of Spamassassin 3.0 and later.  Reported by
index 2d9121f..7a29fb3 100644 (file)
@@ -112,6 +112,21 @@ This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
 ;; version will provide customizable tool bar buttons using a different
 ;; interface.
 
+;; TODO: Extend API so that the "Command" entry can be a function or a plist.
+;; In case of a list it should have the format...
+;;
+;;  (:none command-without-modifier
+;;   :shift command-with-shift-pressed
+;;   :control command-with-ctrl-pressed
+;;   :control-shift command-with-control-and-shift-pressed
+;;   ;; mouse-2 and mouse-3 can't be used in Emacs yet.
+;;   :mouse-2 command-on-mouse-2-press
+;;   :mouse-3 command-on-mouse-3-press) ;; typically a menu of related commands
+;;
+;; Combinations of mouse-[23] plus shift and/or controll might be overkill.
+;;
+;; Then use (plist-get rs-command :none), (plist-get rs-command :shift)
+
 (define-widget 'gmm-tool-bar-item (if (gmm-widget-p 'lazy) 'lazy 'gmm-lazy)
   "Tool bar list item."
   :tag "Tool bar item"
index 4f146f2..096e05d 100644 (file)
@@ -999,6 +999,31 @@ simple manner.")
 
 (defvar gnus-group-tool-bar-map nil)
 
+;; Work around for Emacs not updating the tool bar, see
+; http://www.google.com/groups?as_umsgid=v9u0an3hti.fsf@marauder.physik.uni-ulm.de
+(defvar gnus-group-redraw-line-number nil
+  "When non-nil, redraw the Group buffer frame when idle.
+Internal variable.")
+;; Don't make this customizable yet.
+
+(defun gnus-group-redraw-check ()
+  "Check if we need to redraw the frame."
+  (when (and gnus-group-redraw-line-number
+            (not (featurep 'xemacs))
+            (boundp 'tool-bar-mode)
+            tool-bar-mode)
+    (let ((no (if (fboundp 'line-number-at-pos) ;; Emacs 22 only
+                 (line-number-at-pos)
+               ;; Not equivalent to `line-number-at-pos' but good enough
+               ;; here:
+               (1+ (count-lines (point-min) (point))))))
+      (unless (eq gnus-group-redraw-line-number no)
+       (setq gnus-group-redraw-line-number no)
+       ;; (run-with-idle-timer 1 nil 'menu-bar-update-buffers t)
+       ;; (run-with-idle-timer 1 nil 'redraw-frame (selected-frame))
+       (run-with-idle-timer 1 nil 'force-window-update)
+        t))))
+
 (defun gnus-group-tool-bar-update (&optional symbol value)
   "Update group buffer toolbar.
 Setter function for custom variables."
@@ -1008,6 +1033,9 @@ Setter function for custom variables."
   ;; (use-local-map gnus-group-mode-map)
   (when (gnus-alive-p)
     (with-current-buffer gnus-group-buffer
+      (when gnus-group-redraw-line-number
+       (add-to-list (make-local-variable 'post-command-hook)
+                    'gnus-group-redraw-check))
       (gnus-group-make-tool-bar t))))
 
 ;; The default will be changed when the new icons have been checked in:
@@ -1052,8 +1080,8 @@ Pre-defined symbols include `gnus-group-tool-bar-gnome' and
     (gnus-group-save-newsrc "save")
     (gnus-group-describe-group "describe")
     (gnus-group-unsubscribe-current-group "gnus/toggle-subscription")
-    (gnus-group-prev-unread-group "prev-node") ;; Emacs 22
-    (gnus-group-next-unread-group "next-node") ;; Emacs 22
+    (gnus-group-prev-unread-group "left-arrow")
+    (gnus-group-next-unread-group "right-arrow")
     (gnus-group-exit "exit")
     (gnus-info-find-node "help"))
   "List of functions for the group tool bar (GNOME style).
index 6cd8407..d8a1b54 100644 (file)
@@ -2681,28 +2681,27 @@ Pre-defined symbols include `gnus-summary-tool-bar-gnome' and
     (gnus-summary-save-article "mail/save")
     (gnus-summary-search-article-forward "search")
     (gnus-summary-print-article "print")
+    (gnus-summary-tick-article-forward "flag-followup" nil :visible nil)
+    ;; Some new commands that may need more suitable icons:
+    (gnus-summary-save-newsrc "save" nil :visible nil)
+    ;; (gnus-summary-show-article "stock_message-display" nil :visible nil)
+    (gnus-summary-prev-article "left-arrow")
+    (gnus-summary-next-article "right-arrow")
+    (gnus-summary-next-page "next-page")
+    ;; (gnus-summary-enter-digest-group "right_arrow" nil :visible nil)
+    ;;
+    ;; Maybe some sort-by-... could be added:
+    ;; (gnus-summary-sort-by-author "sort-a-z" nil :visible nil)
+    ;; (gnus-summary-sort-by-date "sort-1-9" nil :visible nil)
     (gnus-summary-mark-as-expirable
      "delete" nil
      :visible (gnus-check-backend-function 'request-expire-articles
                                           gnus-newsgroup-name))
-    (gnus-summary-tick-article-forward "flag-followup" nil :visible nil)
     (gnus-summary-mark-as-spam
      "mail/spam" t :visible (spam-group-ham-contents-p gnus-newsgroup-name)
      :help "Mark as spam")
     (gnus-summary-mark-as-read-forward
      "mail/not-spam" nil :visible (spam-group-spam-contents-p gnus-newsgroup-name))
-    ;; Some new commands that may need more suitable icons:
-    (gnus-summary-save-newsrc "save" nil :visible nil)
-    ;; (gnus-summary-show-article "stock_message-display" nil :visible nil)
-    (gnus-summary-prev-article "left-arrow" nil :visible nil)  ;; Emacs 22
-    (gnus-summary-next-article "right-arrow" nil :visible nil) ;; Emacs 22
-    (gnus-summary-prev-unread-article "prev-node") ;; Emacs 22
-    (gnus-summary-next-unread-article "next-node") ;; Emacs 22
-    (gnus-summary-enter-digest-group "right_arrow" nil :visible nil)
-    ;;
-    ;; Maybe some sort-by-... could be added:
-    ;; (gnus-summary-sort-by-author "sort-a-z" nil :visible nil)
-    ;; (gnus-summary-sort-by-date "sort-1-9" nil :visible nil)
     ;;
     (gnus-summary-exit "exit")
     ;; (customize-group 'gnus-summary) "preferences"