From: ShengHuo ZHU Date: Tue, 2 Apr 2002 20:24:32 +0000 (+0000) Subject: * gnus-group.el (gnus-group-make-tool-bar): Load tool-bar first. X-Git-Tag: ttn-vms-21-2-B4~15822 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b1f236d8571ab2ad969c7ea6c08bddda8b8f8bf9;p=emacs.git * 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. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2cbae6ecc6b..ec62fc26e8c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,11 @@ +2002-04-02 ShengHuo ZHU + + * 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 * nnwarchive.el (nnwarchive-mail-archive-article): Fix typo. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b1473692e4a..e0f7b5cd1cf 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -822,9 +822,11 @@ For example: ;; 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 diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c1d781aed82..5ce4dd6ad2f 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2010,10 +2010,15 @@ increase the score of each group you read." (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 diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f79633e7fd1..2ad402cb88d 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4491,8 +4491,10 @@ which specify the range to operate on." (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.