changeset 44344:37801f2191c3

* gnus-group.el (gnus-group-make-tool-bar): Load tool-bar first. * message.el (message-tool-bar-map): Ditto. * gnus-sum.el (gnus-summary-make-tool-bar): Ditto.
author ShengHuo ZHU <zsh@cs.rochester.edu>
date Tue, 02 Apr 2002 20:24:32 +0000
parents 3faaa85004f2
children d2f43521efb4
files lisp/gnus/ChangeLog lisp/gnus/gnus-group.el lisp/gnus/gnus-sum.el lisp/gnus/message.el
diffstat 4 files changed, 25 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Tue Apr 02 19:37:29 2002 +0000
+++ b/lisp/gnus/ChangeLog	Tue Apr 02 20:24:32 2002 +0000
@@ -1,3 +1,11 @@
+2002-04-02  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+	* gnus-group.el (gnus-group-make-tool-bar): Load tool-bar first.
+
+	* message.el (message-tool-bar-map): Ditto.
+
+	* gnus-sum.el (gnus-summary-make-tool-bar): Ditto.
+
 2002-04-01  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
 	* nnwarchive.el (nnwarchive-mail-archive-article): Fix typo.
--- a/lisp/gnus/gnus-group.el	Tue Apr 02 19:37:29 2002 +0000
+++ b/lisp/gnus/gnus-group.el	Tue Apr 02 20:24:32 2002 +0000
@@ -822,9 +822,11 @@
 
 ;; Emacs 21 tool bar.  Should be no-op otherwise.
 (defun gnus-group-make-tool-bar ()
-  (if (and (fboundp 'tool-bar-add-item-from-menu)
-	   (default-value 'tool-bar-mode)
-	   (not gnus-group-toolbar-map))
+  (if (and 
+       (condition-case nil (require 'tool-bar) (error nil))
+       (fboundp 'tool-bar-add-item-from-menu)
+       (default-value 'tool-bar-mode)
+       (not gnus-group-toolbar-map))
       (setq gnus-group-toolbar-map
 	    (let ((tool-bar-map (make-sparse-keymap)))
 	      (tool-bar-add-item-from-menu
--- a/lisp/gnus/gnus-sum.el	Tue Apr 02 19:37:29 2002 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Apr 02 20:24:32 2002 +0000
@@ -2010,10 +2010,15 @@
 (defvar gnus-summary-tool-bar-map nil)
 
 ;; Emacs 21 tool bar.  Should be no-op otherwise.
+;; NB: A new function tool-bar-local-item-from-menu is added in Emacs
+;; 21.2.50+.  Considering many users use Emacs 21, use
+;; tool-bar-add-item-from-menu here.
 (defun gnus-summary-make-tool-bar ()
-  (if (and (fboundp 'tool-bar-add-item-from-menu)
-	   (default-value 'tool-bar-mode)
-	   (not gnus-summary-tool-bar-map))
+  (if (and
+       (condition-case nil (require 'tool-bar) (error nil))
+       (fboundp 'tool-bar-add-item-from-menu)
+       (default-value 'tool-bar-mode)
+       (not gnus-summary-tool-bar-map))
       (setq gnus-summary-tool-bar-map
 	    (let ((tool-bar-map (make-sparse-keymap)))
 	      (tool-bar-add-item-from-menu
--- a/lisp/gnus/message.el	Tue Apr 02 19:37:29 2002 +0000
+++ b/lisp/gnus/message.el	Tue Apr 02 20:24:32 2002 +0000
@@ -4491,8 +4491,10 @@
 (eval-when-compile (defvar tool-bar-map))
 (if (featurep 'xemacs)
     (require 'messagexmas)
-  (when (and (fboundp 'tool-bar-add-item-from-menu)
- 	     tool-bar-mode)
+  (when (and 
+	 (condition-case nil (require 'tool-bar) (error nil))
+	 (fboundp 'tool-bar-add-item-from-menu)
+	 tool-bar-mode)
     (defvar message-tool-bar-map
       (let ((tool-bar-map (copy-keymap tool-bar-map)))
  	;; Zap some items which aren't so relevant and take up space.