Synch with Oort Gnus.
authoryamaoka <yamaoka>
Tue, 17 Dec 2002 23:03:24 +0000 (23:03 +0000)
committeryamaoka <yamaoka>
Tue, 17 Dec 2002 23:03:24 +0000 (23:03 +0000)
lisp/ChangeLog
lisp/lpath.el
lisp/message.el

index aa78524..df34e13 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-17  Jesper Harder  <harder@ifa.au.dk>
+
+       * lpath.el: Add tool-bar-local-item-from-menu.
+
+       * message.el (message-tool-bar-local-item-from-menu): New function.
+       (message-tool-bar-map): Use it.
+
 2002-12-14  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-uu.el (gnus-uu-digest-headers): Mention nil value in docstring.
index 2125666..df33e31 100644 (file)
@@ -9,14 +9,15 @@
 (defun maybe-bind (args)
   (mapcar (lambda (var) (unless (boundp var) (set var nil))) args))
 
-(maybe-fbind '(create-image
-              display-graphic-p display-time-event-handler find-image
-              image-size image-type-available-p insert-image
-              make-mode-line-mouse-map make-temp-file propertize put-image
-              replace-regexp-in-string rmail-msg-is-pruned
+(maybe-fbind '(create-image display-graphic-p
+              display-time-event-handler find-image image-size
+              image-type-available-p insert-image
+              make-mode-line-mouse-map make-temp-file propertize
+              put-image replace-regexp-in-string rmail-msg-is-pruned
               rmail-msg-restore-non-pruned-header sort-coding-systems
               tool-bar-add-item tool-bar-add-item-from-menu
-              vcard-pretty-print w32-focus-frame w3m-charset-to-coding-system
+              tool-bar-local-item-from-menu vcard-pretty-print
+              w32-focus-frame w3m-charset-to-coding-system
               x-focus-frame))
 (maybe-bind '(filladapt-mode
              mc-pgp-always-sign rmail-enable-mime-composing
index dca6038..d276b55 100644 (file)
@@ -6555,6 +6555,14 @@ which specify the range to operate on."
   (defvar tool-bar-map)
   (defvar tool-bar-mode))
 
+(defun message-tool-bar-local-item-from-menu (command icon in-map &optional from-map &rest props)
+  ;; We need to make tool bar entries in local keymaps with
+  ;; `tool-bar-local-item-from-menu' in Emacs > 21.3
+  (if (fboundp 'tool-bar-local-item-from-menu)
+      ;; This is for Emacs 21.3
+      (tool-bar-local-item-from-menu command icon in-map from-map props)
+    (tool-bar-add-item-from-menu command icon from-map props)))
+
 (defun message-tool-bar-map ()
   (or message-tool-bar-map
       (setq message-tool-bar-map
@@ -6569,25 +6577,25 @@ which specify the range to operate on."
               (dolist (key '(print-buffer kill-buffer save-buffer
                                           write-file dired open-file))
                 (define-key tool-bar-map (vector key) nil))
-              (tool-bar-add-item-from-menu
-               'message-send-and-exit "mail_send" message-mode-map)
-              (tool-bar-add-item-from-menu
-               'message-kill-buffer "close" message-mode-map)
-              (tool-bar-add-item-from-menu
-               'message-dont-send "cancel" message-mode-map)
-              (tool-bar-add-item-from-menu
-               'mime-edit-insert-file "attach" message-mode-map)
-              (tool-bar-add-item-from-menu
-               'ispell-message "spell" message-mode-map)
-              (tool-bar-add-item-from-menu
+              (message-tool-bar-local-item-from-menu
+               'message-send-and-exit "mail_send" tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
+               'message-kill-buffer "close" tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
+               'message-dont-send "cancel" tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
+               'mime-edit-insert-file "attach" tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
+               'ispell-message "spell" tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
                'message-insert-importance-high "important"
-               message-mode-map)
-              (tool-bar-add-item-from-menu
+               tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
                'message-insert-importance-low "unimportant"
-               message-mode-map)
-              (tool-bar-add-item-from-menu
+               tool-bar-map message-mode-map)
+              (message-tool-bar-local-item-from-menu
                'message-insert-disposition-notification-to "receipt"
-               message-mode-map)
+               tool-bar-map message-mode-map)
               tool-bar-map)))))
 
 ;;; Group name completion.