* message.el (message-tool-bar-map): Ditto.
* gnus-sum.el (gnus-summary-make-tool-bar): Ditto.
+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.
;; 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
(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
(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.