1 ;;; vm-toolbar.el --- Toolbar related functions and commands
3 ;; Copyright (C) 1995-1997, 2000, 2001 Kyle E. Jones
4 ;; Copyright (C) 2003-2006 Robert Widhopf-Fenk
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 2 of the License, or
9 ;; (at your option) any later version.
11 ;; This program is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License along
17 ;; with this program; if not, write to the Free Software Foundation, Inc.,
18 ;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 (defvar vm-toolbar-specifier nil)
23 (defvar vm-toolbar-next-button
25 vm-toolbar-next-command
26 (vm-toolbar-any-messages-p)
27 "Go to the next message.\n
28 The command `vm-toolbar-next-command' is run, which is normally
29 fbound to `vm-next-message'.
30 You can make this button run some other command by using a Lisp
31 s-expression like this one in your .vm file:
32 (fset 'vm-toolbar-next-command 'some-other-command)"])
33 (defvar vm-toolbar-next-icon nil)
34 (or (fboundp 'vm-toolbar-next-command)
35 (fset 'vm-toolbar-next-command 'vm-next-message))
37 (defvar vm-toolbar-previous-button
38 [vm-toolbar-previous-icon
39 vm-toolbar-previous-command
40 (vm-toolbar-any-messages-p)
41 "Go to the previous message.\n
42 The command `vm-toolbar-previous-command' is run, which is normally
43 fbound to `vm-previous-message'.
44 You can make this button run some other command by using a Lisp
45 s-expression like this one in your .vm file:
46 (fset 'vm-toolbar-previous-command 'some-other-command)"])
47 (defvar vm-toolbar-previous-icon nil)
48 (or (fboundp 'vm-toolbar-previous-command)
49 (fset 'vm-toolbar-previous-command 'vm-previous-message))
51 (defvar vm-toolbar-autofile-button
52 [vm-toolbar-autofile-icon
53 vm-toolbar-autofile-message
54 (vm-toolbar-can-autofile-p)
55 "Save the current message to a folder selected using vm-auto-folder-alist."])
56 (defvar vm-toolbar-autofile-icon nil)
58 (defvar vm-toolbar-file-button
59 [vm-toolbar-file-icon vm-toolbar-file-command (vm-toolbar-any-messages-p)
60 "Save the current message to a folder.\n
61 The command `vm-toolbar-file-command' is run, which is normally
62 fbound to `vm-save-message'.
63 You can make this button run some other command by using a Lisp
64 s-expression like this one in your .vm file:
65 (fset 'vm-toolbar-file-command 'some-other-command)"])
66 (defvar vm-toolbar-file-icon nil)
67 (or (fboundp 'vm-toolbar-file-command)
68 (fset 'vm-toolbar-file-command 'vm-save-message))
70 (defvar vm-toolbar-getmail-button
71 [vm-toolbar-getmail-icon vm-toolbar-getmail-command
72 (vm-toolbar-mail-waiting-p)
73 "Retrieve spooled mail for the current folder.\n
74 The command `vm-toolbar-getmail-command' is run, which is normally
75 fbound to `vm-get-new-mail'.
76 You can make this button run some other command by using a Lisp
77 s-expression like this one in your .vm file:
78 (fset 'vm-toolbar-getmail-command 'some-other-command)"])
79 (defvar vm-toolbar-getmail-icon nil)
80 (or (fboundp 'vm-toolbar-getmail-command)
81 (fset 'vm-toolbar-getmail-command 'vm-get-new-mail))
83 (defvar vm-toolbar-print-button
84 [vm-toolbar-print-icon
85 vm-toolbar-print-command
86 (vm-toolbar-any-messages-p)
87 "Print the current message.\n
88 The command `vm-toolbar-print-command' is run, which is normally
89 fbound to `vm-print-message'.
90 You can make this button run some other command by using a Lisp
91 s-expression like this one in your .vm file:
92 (fset 'vm-toolbar-print-command 'some-other-command)"])
93 (defvar vm-toolbar-print-icon nil)
94 (or (fboundp 'vm-toolbar-print-command)
95 (fset 'vm-toolbar-print-command 'vm-print-message))
97 (defvar vm-toolbar-visit-button
98 [vm-toolbar-visit-icon vm-toolbar-visit-command t
99 "Visit a different folder.\n
100 The command `vm-toolbar-visit-command' is run, which is normally
101 fbound to `vm-visit-folder'.
102 You can make this button run some other command by using a Lisp
103 s-expression like this one in your .vm file:
104 (fset 'vm-toolbar-visit-command 'some-other-command)"])
105 (defvar vm-toolbar-visit-icon nil)
106 (or (fboundp 'vm-toolbar-visit-command)
107 (fset 'vm-toolbar-visit-command 'vm-visit-folder))
109 (defvar vm-toolbar-reply-button
110 [vm-toolbar-reply-icon
111 vm-toolbar-reply-command
112 (vm-toolbar-any-messages-p)
113 "Reply to the current message.\n
114 The command `vm-toolbar-reply-command' is run, which is normally
115 fbound to `vm-followup-include-text'.
116 You can make this button run some other command by using a Lisp
117 s-expression like this one in your .vm file:
118 (fset 'vm-toolbar-reply-command 'some-other-command)"])
119 (defvar vm-toolbar-reply-icon nil)
120 (or (fboundp 'vm-toolbar-reply-command)
121 (fset 'vm-toolbar-reply-command 'vm-followup-include-text))
123 (defvar vm-toolbar-forward-button
124 [vm-toolbar-forward-icon
125 vm-toolbar-forward-command
126 (vm-toolbar-any-messages-p)
127 "Forward the current message.\n
128 The command `vm-toolbar-forward-command' is run, which is normally
129 fbound to `vm-forward-message'.
130 You can make this button run some other command by using a Lisp
131 s-expression like this one in your .vm file:
132 (fset 'vm-toolbar-forward-command 'some-other-command)"])
133 (defvar vm-toolbar-forward-icon nil)
134 (or (fboundp 'vm-toolbar-forward-command)
135 (fset 'vm-toolbar-forward-command 'vm-forward-message))
137 (defvar vm-toolbar-followup-button
138 [vm-toolbar-followup-icon
139 vm-toolbar-followup-command
140 (vm-toolbar-any-messages-p)
141 "Follow up the current message.\n
142 The command `vm-toolbar-followup-command' is run, which is normally
143 fbound to `vm-followup-message'.
144 You can make this button run some other command by using a Lisp
145 s-expression like this one in your .vm file:
146 (fset 'vm-toolbar-followup-command 'some-other-command)"])
147 (defvar vm-toolbar-followup-icon nil)
148 (or (fboundp 'vm-toolbar-followup-command)
149 (fset 'vm-toolbar-followup-command 'vm-followup))
151 (defvar vm-toolbar-compose-button
152 [vm-toolbar-compose-icon vm-toolbar-compose-command t
153 "Compose a new message.\n
154 The command `vm-toolbar-compose-command' is run, which is normally
156 You can make this button run some other command by using a Lisp
157 s-expression like this one in your .vm file:
158 (fset 'vm-toolbar-compose-command 'some-other-command)"])
159 (defvar vm-toolbar-compose-icon nil)
160 (or (fboundp 'vm-toolbar-compose-command)
161 (fset 'vm-toolbar-compose-command 'vm-mail))
163 (defvar vm-toolbar-decode-mime-button
164 [vm-toolbar-decode-mime-icon vm-toolbar-decode-mime-command
165 (vm-toolbar-can-decode-mime-p)
166 "Decode the MIME objects in the current message.\n
167 The objects might be displayed immediately, or buttons might be
168 displayed that you need to click on to view the object. See the
169 documentation for the variables vm-mime-internal-content-types
170 and vm-mime-external-content-types-alist to see how to control
171 whether you see buttons or objects.\n
172 The command `vm-toolbar-decode-mime-command' is run, which is normally
173 fbound to `vm-decode-mime-messages'.
174 You can make this button run some other command by using a Lisp
175 s-expression like this one in your .vm file:
176 (fset 'vm-toolbar-decode-mime-command 'some-other-command)"])
177 (defvar vm-toolbar-decode-mime-icon nil)
178 (or (fboundp 'vm-toolbar-decode-mime-command)
179 (fset 'vm-toolbar-decode-mime-command 'vm-decode-mime-message))
181 ;; The values of these two are used by the FSF Emacs toolbar
182 ;; code. The values don't matter as long as they are different
183 ;; (as compared with eq). Under XEmacs these values are ignored
185 (defvar vm-toolbar-delete-icon t)
186 (defvar vm-toolbar-undelete-icon nil)
188 (defvar vm-toolbar-delete/undelete-button
189 [vm-toolbar-delete/undelete-icon
190 vm-toolbar-delete/undelete-message
191 (vm-toolbar-any-messages-p)
192 "Delete the current message, or undelete it if it is already deleted."])
193 (defvar vm-toolbar-delete/undelete-icon nil)
194 (make-variable-buffer-local 'vm-toolbar-delete/undelete-icon)
196 (defvar vm-toolbar-help-icon nil)
198 (defvar vm-toolbar-recover-icon nil)
200 (defvar vm-toolbar-helper-icon nil)
201 (make-variable-buffer-local 'vm-toolbar-helper-icon)
203 (defvar vm-toolbar-help-button
204 [vm-toolbar-helper-icon vm-toolbar-helper-command
205 (vm-toolbar-can-help-p)
207 VM uses this button to offer help if you're in trouble.
208 Under normal circumstances, this button runs `vm-help'.
209 If the current folder looks out-of-date relative to its auto-save
210 file then this button will run `vm-recover-folder'.
211 If there is mail waiting in one of the spool files associated
212 with the current folder, and the `getmail' button is not on the
213 toolbar, this button will run `vm-get-new-mail'.
214 If the current message needs to be MIME decoded then this button
215 will run 'vm-decode-mime-message'."])
217 (defvar vm-toolbar-helper-command nil)
218 (make-variable-buffer-local 'vm-toolbar-helper-command)
221 (defun vm-toolbar-helper-command ()
223 (setq this-command vm-toolbar-helper-command)
224 (call-interactively vm-toolbar-helper-command))
226 (defvar vm-toolbar-quit-button
227 [vm-toolbar-quit-icon vm-toolbar-quit-command
228 (vm-toolbar-can-quit-p)
229 "Quit visiting this folder.\n
230 The command `vm-toolbar-quit-command' is run, which is normally
232 You can make this button run some other command by using a Lisp
233 s-expression like this one in your .vm file:
234 (fset 'vm-toolbar-quit-command 'some-other-command)"])
235 (defvar vm-toolbar-quit-icon nil)
236 (or (fboundp 'vm-toolbar-quit-command)
237 (fset 'vm-toolbar-quit-command 'vm-quit))
239 (defun vm-toolbar-any-messages-p ()
242 (vm-check-for-killed-folder)
243 (vm-select-folder-buffer-if-possible)
248 (defun vm-toolbar-delete/undelete-message (&optional prefix-arg)
250 (vm-follow-summary-cursor)
251 (vm-select-folder-buffer)
252 (vm-check-for-killed-summary)
253 (vm-error-if-folder-read-only)
254 (vm-error-if-folder-empty)
255 (let ((current-prefix-arg prefix-arg))
256 (if (vm-deleted-flag (car vm-message-pointer))
257 (call-interactively 'vm-undelete-message)
258 (call-interactively 'vm-delete-message))))
261 (defun vm-toolbar-can-autofile-p ()
265 (vm-check-for-killed-folder)
266 (vm-select-folder-buffer-if-possible)
267 (and vm-message-pointer
268 (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
272 (defun vm-toolbar-autofile-message ()
274 (vm-follow-summary-cursor)
275 (vm-select-folder-buffer)
276 (vm-check-for-killed-summary)
277 (vm-error-if-folder-read-only)
278 (vm-error-if-folder-empty)
279 (let ((file (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
282 (vm-save-message file 1)
283 (message "Message saved to %s" file))
284 (error "No match for message in vm-auto-folder-alist."))))
286 (defun vm-toolbar-can-recover-p ()
289 (vm-select-folder-buffer)
290 (and vm-folder-read-only
292 buffer-auto-save-file-name
293 (null (buffer-modified-p))
294 (file-newer-than-file-p
295 buffer-auto-save-file-name
299 (defun vm-toolbar-can-decode-mime-p ()
302 (vm-select-folder-buffer)
304 vm-display-using-mime
306 vm-presentation-buffer
307 (not (vm-mime-plain-message-p (car vm-message-pointer)))))
310 (defun vm-toolbar-can-quit-p ()
313 (vm-select-folder-buffer)
314 (memq major-mode '(vm-mode vm-virtual-mode)))
317 (defun vm-toolbar-mail-waiting-p ()
320 (vm-select-folder-buffer)
321 (or (not (natnump vm-mail-check-interval))
322 vm-spooled-mail-waiting))
325 (fset 'vm-toolbar-can-help-p 'vm-toolbar-can-quit-p)
327 (defun vm-toolbar-update-toolbar ()
328 (if (and vm-message-pointer (vm-deleted-flag (car vm-message-pointer)))
329 (setq vm-toolbar-delete/undelete-icon vm-toolbar-undelete-icon)
330 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon))
331 (cond ((vm-toolbar-can-recover-p)
332 (setq vm-toolbar-helper-command 'vm-recover-folder
333 vm-toolbar-helper-icon vm-toolbar-recover-icon))
334 ((and (vm-toolbar-mail-waiting-p)
335 (not (memq 'getmail vm-use-toolbar)))
336 (setq vm-toolbar-helper-command 'vm-get-new-mail
337 vm-toolbar-helper-icon vm-toolbar-getmail-icon))
338 ((and (vm-toolbar-can-decode-mime-p) (not vm-mime-decoded)
339 (not (memq 'mime vm-use-toolbar)))
340 (setq vm-toolbar-helper-command 'vm-decode-mime-message
341 vm-toolbar-helper-icon vm-toolbar-decode-mime-icon))
343 (setq vm-toolbar-helper-command 'vm-help
344 vm-toolbar-helper-icon vm-toolbar-help-icon)))
345 (if vm-summary-buffer
346 (vm-copy-local-variables vm-summary-buffer
347 'vm-toolbar-delete/undelete-icon
348 'vm-toolbar-helper-command
349 'vm-toolbar-helper-icon))
350 (if vm-presentation-buffer
351 (vm-copy-local-variables vm-presentation-buffer
352 'vm-toolbar-delete/undelete-icon
353 'vm-toolbar-helper-command
354 'vm-toolbar-helper-icon))
355 (and vm-toolbar-specifier
357 (set-specifier vm-toolbar-specifier (cons (current-buffer) nil))
358 (set-specifier vm-toolbar-specifier (cons (current-buffer)
361 (defun vm-toolbar-install-or-uninstall-toolbar ()
362 (and (vm-toolbar-support-possible-p) vm-use-toolbar
363 (vm-toolbar-install-toolbar))
364 (if (and vm-fsfemacs-p (not vm-use-toolbar))
365 (vm-toolbar-fsfemacs-uninstall-toolbar)))
367 (defcustom vm-toolbar-height nil
368 "*Desired height of the toolbar."
370 :type '(choice (const :tag "Automatic" nil) integer))
372 (defun vm-toolbar-install-toolbar ()
373 ;; drag these in now instead of waiting for them to be
374 ;; autoloaded. the "loading..." messages could come at a bad
375 ;; moment and wipe an important echo area message, like "Auto
376 ;; save file is newer..."
378 (require 'vm-summary)
380 (if (not vm-fsfemacs-toolbar-installed-p)
381 (vm-toolbar-fsfemacs-install-toolbar))
382 (if (not (vm-toolbar-pixmap-directory))
384 (message "Bad toolbar pixmap directory, can't setup toolbar.")
386 (vm-toolbar-initialize)
387 (let ((height (or vm-toolbar-height
388 (+ 5 (glyph-height (car vm-toolbar-help-icon)))))
389 (width (+ 5 (glyph-width (car vm-toolbar-help-icon))))
390 (frame (selected-frame))
391 (buffer (current-buffer))
393 (myframe (vm-created-this-frame-p))
395 ;; glyph-width and glyph-height return 0 at startup sometimes
396 ;; use reasonable values if they fail.
401 ;; honor user setting of vm-toolbar if they are daring enough
404 (setq toolbar vm-toolbar)
405 (setq toolbar (vm-toolbar-make-toolbar-spec)
407 (cond ((eq vm-toolbar-orientation 'right)
408 (setq vm-toolbar-specifier right-toolbar)
410 (set-specifier right-toolbar toolbar frame tag-set))
411 (set-specifier right-toolbar toolbar buffer)
412 (set-specifier right-toolbar-width width frame tag-set))
413 ((eq vm-toolbar-orientation 'left)
414 (setq vm-toolbar-specifier left-toolbar)
416 (set-specifier left-toolbar toolbar frame tag-set))
417 (set-specifier left-toolbar toolbar buffer)
418 (set-specifier left-toolbar-width width frame tag-set))
419 ((eq vm-toolbar-orientation 'bottom)
420 (setq vm-toolbar-specifier bottom-toolbar)
422 (set-specifier bottom-toolbar toolbar frame tag-set))
423 (set-specifier bottom-toolbar toolbar buffer)
424 (set-specifier bottom-toolbar-height height frame tag-set))
426 (setq vm-toolbar-specifier top-toolbar)
428 (set-specifier top-toolbar toolbar frame tag-set))
429 (set-specifier top-toolbar toolbar buffer)
430 (set-specifier top-toolbar-height height frame tag-set)))))))
432 (defun vm-toolbar-make-toolbar-spec ()
433 (let ((button-alist '(
434 (autofile . vm-toolbar-autofile-button)
435 (compose . vm-toolbar-compose-button)
436 (delete/undelete . vm-toolbar-delete/undelete-button)
437 (file . vm-toolbar-file-button)
438 (getmail . vm-toolbar-getmail-button)
439 (help . vm-toolbar-help-button)
440 (mime . vm-toolbar-decode-mime-button)
441 (next . vm-toolbar-next-button)
442 (previous . vm-toolbar-previous-button)
443 (print . vm-toolbar-print-button)
444 (quit . vm-toolbar-quit-button)
445 (reply . vm-toolbar-reply-button)
446 (forward . vm-toolbar-forward-button)
447 (followup . vm-toolbar-followup-button)
448 (visit . vm-toolbar-visit-button)
450 (button-list vm-use-toolbar)
454 (cond ((null (car button-list))
455 (setq toolbar (cons nil toolbar)))
456 ((integerp (car button-list))
457 (if (< 0 (car button-list))
458 (setq toolbar (cons (vector ':size (car button-list)
462 (setq cons (assq (car button-list) button-alist))
464 (setq toolbar (cons (symbol-value (cdr cons)) toolbar)))))
465 (setq button-list (cdr button-list)))
466 (nreverse toolbar) ))
468 (defun vm-toolbar-initialize ()
471 ((null vm-toolbar-help-icon)
474 '(vm-toolbar-decode-mime-icon
475 "mime-up.xpm" "mime-dn.xpm" "mime-xx.xpm")
476 '(vm-toolbar-next-icon
477 "next-up.xpm" "next-dn.xpm" "next-dn.xpm")
478 '(vm-toolbar-previous-icon
479 "previous-up.xpm" "previous-dn.xpm" "previous-dn.xpm")
480 '(vm-toolbar-delete-icon
481 "delete-up.xpm" "delete-dn.xpm" "delete-dn.xpm")
482 '(vm-toolbar-undelete-icon
483 "undelete-up.xpm" "undelete-dn.xpm" "undelete-dn.xpm")
484 '(vm-toolbar-autofile-icon
485 "autofile-up.xpm" "autofile-dn.xpm" "autofile-dn.xpm")
486 '(vm-toolbar-getmail-icon
487 "getmail-up.xpm" "getmail-dn.xpm" "getmail-dn.xpm")
488 '(vm-toolbar-file-icon
489 "file-up.xpm" "file-dn.xpm" "file-dn.xpm")
490 '(vm-toolbar-reply-icon
491 "reply-up.xpm" "reply-dn.xpm" "reply-dn.xpm")
492 '(vm-toolbar-forward-icon
493 "forward-up.xpm" "forward-dn.xpm" "forward-dn.xpm")
494 '(vm-toolbar-followup-icon
495 "followup-up.xpm" "followup-dn.xpm" "followup-dn.xpm")
496 '(vm-toolbar-compose-icon
497 "compose-up.xpm" "compose-dn.xpm" "compose-dn.xpm")
498 '(vm-toolbar-print-icon
499 "print-up.xpm" "print-dn.xpm" "print-dn.xpm")
500 '(vm-toolbar-visit-icon
501 "visit-up.xpm" "visit-dn.xpm" "visit-dn.xpm")
502 '(vm-toolbar-quit-icon
503 "quit-up.xpm" "quit-dn.xpm" "quit-dn.xpm")
504 '(vm-toolbar-help-icon
505 "help-up.xpm" "help-dn.xpm" "help-dn.xpm")
506 '(vm-toolbar-recover-icon
507 "recover-up.xpm" "recover-dn.xpm" "recover-dn.xpm")
511 (setq tuple (car tuples)
518 (expand-file-name f (vm-toolbar-pixmap-directory)))))
520 (setq tuples (cdr tuples))))))
521 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
522 (setq-default vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
523 (setq vm-toolbar-helper-command 'vm-help)
524 (setq vm-toolbar-helper-icon vm-toolbar-help-icon)
525 (setq-default vm-toolbar-helper-icon vm-toolbar-help-icon))
527 (defun vm-toolbar-fsfemacs-uninstall-toolbar ()
528 (define-key vm-mode-map [toolbar] nil)
529 (setq vm-fsfemacs-toolbar-installed-p nil))
531 (defun vm-toolbar-fsfemacs-install-toolbar ()
532 (let ((button-list (reverse vm-use-toolbar))
533 (dir (vm-toolbar-pixmap-directory))
535 item t-spec sym name images)
536 (defvar tool-bar-map)
537 ;; hide the toolbar entries that are in the global keymap so
538 ;; VM has full control of the toolbar in its buffers.
539 (if (and (boundp 'tool-bar-map)
540 (consp tool-bar-map))
541 (let ((map (cdr tool-bar-map))
544 (aset v 1 (car (car map)))
545 (define-key vm-mode-map v 'undefined)
546 (setq map (cdr map)))))
548 (setq sym (car button-list))
550 ;; can't do flushright in FSF Emacs
553 ;; can't do separators in FSF Emacs
555 ((memq sym '(autofile compose file getmail
556 mime next previous print quit
557 reply followup forward visit))
558 (setq t-spec (symbol-value
559 (intern (format "vm-toolbar-%s-button"
563 (setq name (symbol-name sym))
564 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
566 (if (eq sym 'mime) nil 'heuristic)))
571 ':enable (aref t-spec 2)
572 ; ':button '(:toggle nil)
574 (define-key vm-mode-map (vector 'tool-bar sym) item))
575 ((eq sym 'delete/undelete)
576 (setq t-spec vm-toolbar-delete/undelete-button)
578 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
579 name extension dir 'heuristic))
584 ':visible '(eq vm-toolbar-delete/undelete-icon
585 vm-toolbar-delete-icon)
586 ':enable (aref t-spec 2)
587 ; ':button '(:toggle nil)
589 (define-key vm-mode-map (vector 'tool-bar 'delete) item)
590 (setq name "undelete")
591 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
592 name extension dir 'heuristic))
597 ':visible '(eq vm-toolbar-delete/undelete-icon
598 vm-toolbar-undelete-icon)
599 ':enable (aref t-spec 2)
600 ; ':button '(:toggle nil)
602 (define-key vm-mode-map (vector 'tool-bar 'undelete) item))
604 (setq t-spec vm-toolbar-help-button)
606 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
607 name extension dir 'heuristic))
612 ':visible '(eq vm-toolbar-helper-command 'vm-help)
613 ':enable (aref t-spec 2)
614 ; ':button '(:toggle nil)
616 (define-key vm-mode-map (vector 'tool-bar 'help-help) item)
617 (setq name "recover")
618 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
619 name extension dir 'heuristic))
624 ':visible '(eq vm-toolbar-helper-command
626 ':enable (aref t-spec 2)
627 ; ':button '(:toggle nil)
629 (define-key vm-mode-map (vector 'tool-bar 'help-recover) item)
630 (setq name "getmail")
631 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
632 name extension dir 'heuristic))
637 ':visible '(eq vm-toolbar-helper-command
639 ':enable (aref t-spec 2)
640 ; ':button '(:toggle nil)
642 (define-key vm-mode-map (vector 'tool-bar 'help-getmail) item)
644 (setq images (vm-toolbar-make-fsfemacs-toolbar-image-spec
645 name extension dir nil))
650 ':visible '(eq vm-toolbar-helper-command
651 'vm-decode-mime-message)
652 ':enable (aref t-spec 2)
653 ; ':button '(:toggle nil)
655 (define-key vm-mode-map (vector 'tool-bar 'help-mime) item)))
656 (setq button-list (cdr button-list))))
657 (setq vm-fsfemacs-toolbar-installed-p t))
659 (defun vm-toolbar-make-fsfemacs-toolbar-image-spec (name extension dir mask)
660 (if (string= extension "xpm")
663 ':type (intern extension)
665 ':file (expand-file-name
670 ':type (intern extension)
672 ':file (expand-file-name
677 ':type (intern extension)
679 ':file (expand-file-name
684 ':type (intern extension)
686 ':file (expand-file-name
692 ':type (intern extension)
694 ':file (expand-file-name
699 ':type (intern extension)
701 ':file (expand-file-name
706 ':type (intern extension)
708 ':file (expand-file-name
713 ':type (intern extension)
715 ':file (expand-file-name
720 (provide 'vm-toolbar)
722 ;;; vm-toolbar.el ends here