annotate lisp/vm/vm-toolbar.el @ 146:2af401a6ecca r20-2p1

Import from CVS: tag r20-2p1
author cvs
date Mon, 13 Aug 2007 09:34:46 +0200
parents 1370575f1259
children 43dd3413c7c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Toolbar related functions and commands
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
2 ;;; Copyright (C) 1995-1997 Kyle E. Jones
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (provide 'vm-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (defvar vm-toolbar-specifier nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (defvar vm-toolbar-next-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 [vm-toolbar-next-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 vm-toolbar-next-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 "Go to the next message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 The command `vm-toolbar-next-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
28 fbound to `vm-next-message'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (fset 'vm-toolbar-next-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defvar vm-toolbar-next-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (or (fboundp 'vm-toolbar-next-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (fset 'vm-toolbar-next-command 'vm-next-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (defvar vm-toolbar-previous-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 [vm-toolbar-previous-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 vm-toolbar-previous-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "Go to the previous message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 The command `vm-toolbar-previous-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
42 fbound to `vm-previous-message'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (fset 'vm-toolbar-previous-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (defvar vm-toolbar-previous-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (or (fboundp 'vm-toolbar-previous-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (fset 'vm-toolbar-previous-command 'vm-previous-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (defvar vm-toolbar-autofile-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 [vm-toolbar-autofile-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 vm-toolbar-autofile-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (vm-toolbar-can-autofile-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 "Save the current message to a folder selected using vm-auto-folder-alist."])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defvar vm-toolbar-autofile-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (defvar vm-toolbar-file-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 [vm-toolbar-file-icon vm-toolbar-file-command (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "Save the current message to a folder.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 The command `vm-toolbar-file-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
61 fbound to `vm-save-message'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (fset 'vm-toolbar-file-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defvar vm-toolbar-file-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (or (fboundp 'vm-toolbar-file-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (fset 'vm-toolbar-file-command 'vm-save-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
69 (defvar vm-toolbar-getmail-button
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
70 [vm-toolbar-getmail-icon vm-toolbar-getmail-command
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
71 (vm-toolbar-mail-waiting-p)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
72 "Retrieve spooled mail for the current folder.\n
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
73 The command `vm-toolbar-getmail-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
74 fbound to `vm-get-new-mail'.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
75 You can make this button run some other command by using a Lisp
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
76 s-expression like this one in your .vm file:
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
77 (fset 'vm-toolbar-getmail-command 'some-other-command)"])
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
78 (defvar vm-toolbar-getmail-icon nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
79 (or (fboundp 'vm-toolbar-getmail-command)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
80 (fset 'vm-toolbar-getmail-command 'vm-get-new-mail))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
81
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defvar vm-toolbar-print-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 [vm-toolbar-print-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 vm-toolbar-print-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 "Print the current message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 The command `vm-toolbar-print-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
88 fbound to `vm-print-message'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (fset 'vm-toolbar-print-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defvar vm-toolbar-print-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (or (fboundp 'vm-toolbar-print-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (fset 'vm-toolbar-print-command 'vm-print-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (defvar vm-toolbar-visit-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 [vm-toolbar-visit-icon vm-toolbar-visit-command t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 "Visit a different folder.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 The command `vm-toolbar-visit-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
100 fbound to `vm-visit-folder'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (fset 'vm-toolbar-visit-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (defvar vm-toolbar-visit-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (or (fboundp 'vm-toolbar-visit-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (fset 'vm-toolbar-visit-command 'vm-visit-folder))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (defvar vm-toolbar-reply-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 [vm-toolbar-reply-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 vm-toolbar-reply-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 "Reply to the current message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 The command `vm-toolbar-reply-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
114 fbound to `vm-followup-include-text'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (fset 'vm-toolbar-reply-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defvar vm-toolbar-reply-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (or (fboundp 'vm-toolbar-reply-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (fset 'vm-toolbar-reply-command 'vm-followup-include-text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (defvar vm-toolbar-compose-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 [vm-toolbar-compose-icon vm-toolbar-compose-command t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 "Compose a new message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 The command `vm-toolbar-compose-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
126 fbound to `vm-mail'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (fset 'vm-toolbar-compose-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defvar vm-toolbar-compose-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (or (fboundp 'vm-toolbar-compose-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (fset 'vm-toolbar-compose-command 'vm-mail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
134 (defvar vm-toolbar-decode-mime-button
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
135 [vm-toolbar-decode-mime-icon vm-toolbar-decode-mime-command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
136 (vm-toolbar-can-decode-mime-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
137 "Decode the MIME objects in the current message.\n
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
138 The objects might be displayed immediately, or buttons might be
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
139 displayed that you need to click on to view the object. See the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
140 documentation for the variables vm-mime-internal-content-types
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
141 and vm-mime-external-content-types-alist to see how to control
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
142 whether you see buttons or objects.\n
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
143 The command `vm-toolbar-decode-mime-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
144 fbound to `vm-decode-mime-messages'.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
145 You can make this button run some other command by using a Lisp
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
146 s-expression like this one in your .vm file:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
147 (fset 'vm-toolbar-decode-mime-command 'some-other-command)"])
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
148 (defvar vm-toolbar-decode-mime-icon nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
149 (or (fboundp 'vm-toolbar-decode-mime-command)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
150 (fset 'vm-toolbar-decode-mime-command 'vm-decode-mime-message))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
151
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (defvar vm-toolbar-delete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (defvar vm-toolbar-undelete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (defvar vm-toolbar-delete/undelete-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 [vm-toolbar-delete/undelete-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 vm-toolbar-delete/undelete-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 "Delete the current message, or undelete it if it is already deleted."])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (defvar vm-toolbar-delete/undelete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (make-variable-buffer-local 'vm-toolbar-delete/undelete-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defvar vm-toolbar-help-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (defvar vm-toolbar-recover-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defvar vm-toolbar-helper-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (make-variable-buffer-local 'vm-toolbar-helper-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defvar vm-toolbar-help-button
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
172 [vm-toolbar-helper-icon vm-toolbar-helper-command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
173 (vm-toolbar-can-help-p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "Don't Panic.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 VM uses this button to offer help if you're in trouble.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 Under normal circumstances, this button runs `vm-help'.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 If the current folder looks out-of-date relative to its auto-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 file then this button will run `recover-file'."])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defvar vm-toolbar-helper-command nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (make-variable-buffer-local 'vm-toolbar-helper-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defun vm-toolbar-helper-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (setq this-command vm-toolbar-helper-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (call-interactively vm-toolbar-helper-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defvar vm-toolbar-quit-button
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
189 [vm-toolbar-quit-icon vm-toolbar-quit-command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
190 (vm-toolbar-can-quit-p)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
191 "Quit visiting this folder.\n
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 The command `vm-toolbar-quit-command' is run, which is normally
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 100
diff changeset
193 fbound to `vm-quit'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (fset 'vm-toolbar-quit-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defvar vm-toolbar-quit-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (or (fboundp 'vm-toolbar-quit-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (fset 'vm-toolbar-quit-command 'vm-quit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (defun vm-toolbar-any-messages-p ()
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
202 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
203 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
204 (vm-check-for-killed-folder)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
205 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
206 vm-message-list)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
207 (error nil)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defun vm-toolbar-delete/undelete-message (&optional prefix-arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (vm-error-if-folder-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (let ((current-prefix-arg prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (if (vm-deleted-flag (car vm-message-pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (call-interactively 'vm-undelete-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (call-interactively 'vm-delete-message))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defun vm-toolbar-can-autofile-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (interactive)
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
223 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
224 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
225 (vm-check-for-killed-folder)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
226 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
227 (and vm-message-pointer
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
228 (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
229 (error nil)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (defun vm-toolbar-autofile-message ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (vm-error-if-folder-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (let ((file (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (if file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (vm-save-message file 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (message "Message saved to %s" file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (error "No match for message in vm-auto-folder-alist."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (defun vm-toolbar-can-recover-p ()
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
246 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
247 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
248 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
249 (and vm-folder-read-only
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
250 buffer-file-name
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
251 buffer-auto-save-file-name
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
252 (null (buffer-modified-p))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
253 (file-newer-than-file-p
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
254 buffer-auto-save-file-name
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
255 buffer-file-name)))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
256 (error nil)))
20
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 10
diff changeset
257
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
258 (defun vm-toolbar-can-decode-mime-p ()
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
259 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
260 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
261 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
262 (and
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
263 vm-display-using-mime
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
264 vm-message-pointer
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
265 vm-presentation-buffer
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
266 (not vm-mime-decoded)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
267 (not (vm-mime-plain-message-p (car vm-message-pointer)))))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
268 (error nil)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
269
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
270 (defun vm-toolbar-can-quit-p ()
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
271 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
272 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
273 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
274 (memq major-mode '(vm-mode vm-virtual-mode)))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
275 (error nil)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
276
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
277 (defun vm-toolbar-mail-waiting-p ()
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
278 (condition-case nil
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
279 (save-excursion
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
280 (vm-select-folder-buffer)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
281 vm-spooled-mail-waiting)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
282 (error nil)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
283
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
284 (fset 'vm-toolbar-can-help-p 'vm-toolbar-can-quit-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
285
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (defun vm-toolbar-update-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (if (and vm-message-pointer (vm-deleted-flag (car vm-message-pointer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (setq vm-toolbar-delete/undelete-icon vm-toolbar-undelete-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (cond ((vm-toolbar-can-recover-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (setq vm-toolbar-helper-command 'recover-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 vm-toolbar-helper-icon vm-toolbar-recover-icon))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
293 ((vm-toolbar-mail-waiting-p)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
294 (setq vm-toolbar-helper-command 'vm-get-new-mail
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
295 vm-toolbar-helper-icon vm-toolbar-getmail-icon))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
296 ((vm-toolbar-can-decode-mime-p)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
297 (setq vm-toolbar-helper-command 'vm-decode-mime-message
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
298 vm-toolbar-helper-icon vm-toolbar-decode-mime-icon))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (setq vm-toolbar-helper-command 'vm-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 vm-toolbar-helper-icon vm-toolbar-help-icon)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (if vm-summary-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (vm-copy-local-variables vm-summary-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 'vm-toolbar-delete/undelete-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 'vm-toolbar-helper-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 'vm-toolbar-helper-icon))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
307 (if vm-presentation-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
308 (vm-copy-local-variables vm-presentation-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
309 'vm-toolbar-delete/undelete-icon
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
310 'vm-toolbar-helper-command
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
311 'vm-toolbar-helper-icon))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (and vm-toolbar-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (progn
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
314 (set-specifier vm-toolbar-specifier (cons (current-buffer) nil))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
315 (set-specifier vm-toolbar-specifier (cons (current-buffer)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
316 vm-toolbar)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (defun vm-toolbar-install-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (vm-toolbar-initialize)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
320 (let ((height (+ 4 (glyph-height (car vm-toolbar-help-icon))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (width (+ 4 (glyph-width (car vm-toolbar-help-icon))))
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
322 (frame (selected-frame))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
323 (buffer (current-buffer))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
324 (tag-set '(win))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
325 (myframe (vm-created-this-frame-p))
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
326 toolbar )
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
327 ;; glyph-width and glyph-height return 0 at startup sometimes
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
328 ;; use reasonable values if they fail.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
329 (if (= width 4)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
330 (setq width 68))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
331 (if (= height 4)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
332 (setq height 46))
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
333 ;; honor user setting of vm-toolbar if they are daring enough
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
334 ;; to set it.
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
335 (if vm-toolbar
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
336 (setq toolbar vm-toolbar)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
337 (setq toolbar (vm-toolbar-make-toolbar-spec)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
338 vm-toolbar toolbar))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (cond ((eq vm-toolbar-orientation 'right)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (setq vm-toolbar-specifier right-toolbar)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
341 (if myframe
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
342 (set-specifier right-toolbar toolbar frame tag-set))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
343 (set-specifier right-toolbar toolbar buffer)
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
344 (set-specifier right-toolbar-width width frame tag-set))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 ((eq vm-toolbar-orientation 'left)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (setq vm-toolbar-specifier left-toolbar)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
347 (if myframe
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
348 (set-specifier left-toolbar toolbar frame tag-set))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
349 (set-specifier left-toolbar toolbar buffer)
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
350 (set-specifier left-toolbar-width width frame tag-set))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 ((eq vm-toolbar-orientation 'bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (setq vm-toolbar-specifier bottom-toolbar)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
353 (if myframe
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
354 (set-specifier bottom-toolbar toolbar frame tag-set))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
355 (set-specifier bottom-toolbar toolbar buffer)
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
356 (set-specifier bottom-toolbar-height height frame tag-set))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (setq vm-toolbar-specifier top-toolbar)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
359 (if myframe
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
360 (set-specifier top-toolbar toolbar frame tag-set))
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
361 (set-specifier top-toolbar toolbar buffer)
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
362 (set-specifier top-toolbar-height height frame tag-set)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (defun vm-toolbar-make-toolbar-spec ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (let ((button-alist '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (autofile . vm-toolbar-autofile-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (compose . vm-toolbar-compose-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (delete/undelete . vm-toolbar-delete/undelete-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (file . vm-toolbar-file-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (help . vm-toolbar-help-button)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
371 (mime . vm-toolbar-decode-mime-button)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (next . vm-toolbar-next-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (previous . vm-toolbar-previous-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (print . vm-toolbar-print-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (quit . vm-toolbar-quit-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (reply . vm-toolbar-reply-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (visit . vm-toolbar-visit-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (button-list vm-use-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (toolbar nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (while button-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (if (null (car button-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (setq toolbar (cons nil toolbar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (setq cons (assq (car button-list) button-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (if cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (setq toolbar (cons (symbol-value (cdr cons)) toolbar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (setq button-list (cdr button-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (nreverse toolbar) ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (defun vm-toolbar-initialize ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ;; drag these in now instead of waiting for them to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 ;; autoloaded. the "loading..." messages could come at a bad
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 ;; moment and wipe an important echo area message, like "Auto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 ;; save file is newer..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (require 'vm-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (require 'vm-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 ((null vm-toolbar-help-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (let ((tuples
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (if (featurep 'xpm)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
402 (list
146
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
403 (if (and (device-on-window-system-p)
2af401a6ecca Import from CVS: tag r20-2p1
cvs
parents: 126
diff changeset
404 (>= (device-bitplanes) 16))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
405 '(vm-toolbar-decode-mime-icon "mime-colorful-up.xpm"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
406 "mime-colorful-dn.xpm"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
407 "mime-colorful-xx.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
408 '(vm-toolbar-decode-mime-icon "mime-simple-up.xpm"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
409 "mime-simple-dn.xpm"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
410 "mime-simple-xx.xpm"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
411 '(vm-toolbar-next-icon "next-up.xpm" "next-dn.xpm" "next-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
412 '(vm-toolbar-previous-icon "previous-up.xpm" "previous-dn.xpm"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 "previous-dn.xpm")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
414 '(vm-toolbar-delete-icon "delete-up.xpm" "delete-dn.xpm" "delete-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
415 '(vm-toolbar-undelete-icon "undelete-up.xpm" "undelete-dn.xpm"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 "undelete-dn.xpm")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
417 '(vm-toolbar-autofile-icon "autofile-up.xpm" "autofile-dn.xpm"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 "autofile-dn.xpm")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
419 '(vm-toolbar-getmail-icon "getmail-up.xpm" "getmail-dn.xpm" "getmail-dn.xpm")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
420 '(vm-toolbar-file-icon "file-up.xpm" "file-dn.xpm" "file-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
421 '(vm-toolbar-reply-icon "reply-up.xpm" "reply-dn.xpm" "reply-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
422 '(vm-toolbar-compose-icon "compose-up.xpm" "compose-dn.xpm" "compose-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
423 '(vm-toolbar-print-icon "print-up.xpm" "print-dn.xpm" "print-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
424 '(vm-toolbar-visit-icon "visit-up.xpm" "visit-dn.xpm" "visit-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
425 '(vm-toolbar-quit-icon "quit-up.xpm" "quit-dn.xpm" "quit-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
426 '(vm-toolbar-help-icon "help-up.xpm" "help-dn.xpm" "help-dn.xpm")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
427 '(vm-toolbar-recover-icon "recover-up.xpm" "recover-dn.xpm" "recover-dn.xpm")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 '(
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
430 (vm-toolbar-decode-mime-icon "mime-up.xbm" "mime-dn.xbm" "mime-xx.xbm")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (vm-toolbar-next-icon "next-up.xbm" "next-dn.xbm" "next-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (vm-toolbar-previous-icon "previous-up.xbm" "previous-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 "previous-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (vm-toolbar-delete-icon "delete-up.xbm" "delete-dn.xbm" "delete-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (vm-toolbar-undelete-icon "undelete-up.xbm" "undelete-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 "undelete-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (vm-toolbar-autofile-icon "autofile-up.xbm" "autofile-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 "autofile-xx.xbm")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
439 (vm-toolbar-getmail-icon "getmail-up.xbm" "getmail-dn.xbm" "getmail-xx.xbm")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (vm-toolbar-file-icon "file-up.xbm" "file-dn.xbm" "file-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (vm-toolbar-reply-icon "reply-up.xbm" "reply-dn.xbm" "reply-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (vm-toolbar-compose-icon "compose-up.xbm" "compose-dn.xbm" "compose-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (vm-toolbar-print-icon "print-up.xbm" "print-dn.xbm" "print-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (vm-toolbar-visit-icon "visit-up.xbm" "visit-dn.xbm" "visit-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (vm-toolbar-quit-icon "quit-up.xbm" "quit-dn.xbm" "quit-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (vm-toolbar-help-icon "help-up.xbm" "help-dn.xbm" "help-xx.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (vm-toolbar-recover-icon "recover-up.xbm" "recover-dn.xbm" "recover-xx.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 tuple files var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (if (not (file-directory-p vm-toolbar-pixmap-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (error "Bad toolbar pixmap directory: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 vm-toolbar-pixmap-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (while tuples
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (setq tuple (car tuples)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 var (car tuple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 files (cdr tuple))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (set var (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (lambda (f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (make-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (expand-file-name f vm-toolbar-pixmap-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (setq tuples (cdr tuples)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
465 (setq-default vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (setq vm-toolbar-helper-command 'vm-help)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
467 (setq vm-toolbar-helper-icon vm-toolbar-help-icon)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
468 (setq-default vm-toolbar-helper-icon vm-toolbar-help-icon))