(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
(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
(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.