annotate lisp/vm/vm-toolbar.el @ 10:49a24b4fd526 r19-15b6

Import from CVS: tag r19-15b6
author cvs
date Mon, 13 Aug 2007 08:47:52 +0200
parents 376386a54a3c
children 859a2309aef8
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright (C) 1995 Kyle E. Jones
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 bound to `vm-next-message'.
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 bound to `vm-previous-message'.
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 bound to `vm-save-message'.
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (defvar vm-toolbar-print-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 [vm-toolbar-print-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 vm-toolbar-print-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "Print the current message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 The command `vm-toolbar-print-command' is run, which is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 bound to `vm-print-message'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (fset 'vm-toolbar-print-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defvar vm-toolbar-print-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (or (fboundp 'vm-toolbar-print-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (fset 'vm-toolbar-print-command 'vm-print-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defvar vm-toolbar-visit-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 [vm-toolbar-visit-icon vm-toolbar-visit-command t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 "Visit a different folder.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 The command `vm-toolbar-visit-command' is run, which is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 bound to `vm-visit-folder'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (fset 'vm-toolbar-visit-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defvar vm-toolbar-visit-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (or (fboundp 'vm-toolbar-visit-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (fset 'vm-toolbar-visit-command 'vm-visit-folder))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (defvar vm-toolbar-reply-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 [vm-toolbar-reply-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 vm-toolbar-reply-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 "Reply to the current message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 The command `vm-toolbar-reply-command' is run, which is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 bound to `vm-followup-include-text'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (fset 'vm-toolbar-reply-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defvar vm-toolbar-reply-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (or (fboundp 'vm-toolbar-reply-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (fset 'vm-toolbar-reply-command 'vm-followup-include-text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (defvar vm-toolbar-compose-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 [vm-toolbar-compose-icon vm-toolbar-compose-command t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 "Compose a new message.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 The command `vm-toolbar-compose-command' is run, which is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 bound to `vm-mail'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (fset 'vm-toolbar-compose-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defvar vm-toolbar-compose-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (or (fboundp 'vm-toolbar-compose-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (fset 'vm-toolbar-compose-command 'vm-mail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (defvar vm-toolbar-delete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defvar vm-toolbar-undelete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (defvar vm-toolbar-delete/undelete-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 [vm-toolbar-delete/undelete-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 vm-toolbar-delete/undelete-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (vm-toolbar-any-messages-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 "Delete the current message, or undelete it if it is already deleted."])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defvar vm-toolbar-delete/undelete-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (make-variable-buffer-local 'vm-toolbar-delete/undelete-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defvar vm-toolbar-help-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (defvar vm-toolbar-recover-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defvar vm-toolbar-helper-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (make-variable-buffer-local 'vm-toolbar-helper-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (defvar vm-toolbar-help-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 [vm-toolbar-helper-icon vm-toolbar-helper-command t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 "Don't Panic.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 VM uses this button to offer help if you're in trouble.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Under normal circumstances, this button runs `vm-help'.\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 If the current folder looks out-of-date relative to its auto-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 file then this button will run `recover-file'."])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (defvar vm-toolbar-helper-command nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (make-variable-buffer-local 'vm-toolbar-helper-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (defun vm-toolbar-helper-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (setq this-command vm-toolbar-helper-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (call-interactively vm-toolbar-helper-command))
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-quit-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 [vm-toolbar-quit-icon vm-toolbar-quit-command t
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
158 "Quit visiting this folder.\n
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 The command `vm-toolbar-quit-command' is run, which is normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 bound to `vm-quit'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 You can make this button run some other command by using a Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 s-expression like this one in your .vm file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (fset 'vm-toolbar-quit-command 'some-other-command)"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defvar vm-toolbar-quit-icon nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (or (fboundp 'vm-toolbar-quit-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (fset 'vm-toolbar-quit-command 'vm-quit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defun vm-toolbar-any-messages-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (vm-check-for-killed-folder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 vm-message-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (defun vm-toolbar-delete/undelete-message (&optional prefix-arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (vm-error-if-folder-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (let ((current-prefix-arg prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if (vm-deleted-flag (car vm-message-pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (call-interactively 'vm-undelete-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (call-interactively 'vm-delete-message))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (defun vm-toolbar-can-autofile-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (vm-check-for-killed-folder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (and vm-message-pointer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (defun vm-toolbar-autofile-message ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (vm-error-if-folder-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (let ((file (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (if file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (vm-save-message file 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (message "Message saved to %s" file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (error "No match for message in vm-auto-folder-alist."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defun vm-toolbar-can-recover-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (vm-check-for-killed-folder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (and vm-folder-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 buffer-auto-save-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (null (buffer-modified-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (file-newer-than-file-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 buffer-auto-save-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 buffer-file-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (defun vm-toolbar-update-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (if (and vm-message-pointer (vm-deleted-flag (car vm-message-pointer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (setq vm-toolbar-delete/undelete-icon vm-toolbar-undelete-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (cond ((vm-toolbar-can-recover-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (setq vm-toolbar-helper-command 'recover-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 vm-toolbar-helper-icon vm-toolbar-recover-icon))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (setq vm-toolbar-helper-command 'vm-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 vm-toolbar-helper-icon vm-toolbar-help-icon)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (if vm-summary-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (vm-copy-local-variables vm-summary-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 'vm-toolbar-delete/undelete-icon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 'vm-toolbar-helper-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 'vm-toolbar-helper-icon))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (and vm-toolbar-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (progn
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
237 (set-specifier vm-toolbar-specifier (cons (current-buffer) nil))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
238 (set-specifier vm-toolbar-specifier (cons (current-buffer)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
239 vm-toolbar)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (defun vm-toolbar-install-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (vm-toolbar-initialize)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
243 (let ((height (+ 4 (glyph-height (car vm-toolbar-help-icon))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (width (+ 4 (glyph-width (car vm-toolbar-help-icon))))
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
245 toolbar )
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
246 ;; honor user setting of vm-toolbar if they are daring enough
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
247 ;; to set it.
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
248 (if vm-toolbar
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
249 (setq toolbar vm-toolbar)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
250 (setq toolbar (vm-toolbar-make-toolbar-spec)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
251 vm-toolbar toolbar))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (cond ((eq vm-toolbar-orientation 'right)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (setq vm-toolbar-specifier right-toolbar)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
254 (set-specifier right-toolbar (cons (current-buffer) toolbar))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
255 (set-specifier right-toolbar-width
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
256 (cons (selected-frame) width)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ((eq vm-toolbar-orientation 'left)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (setq vm-toolbar-specifier left-toolbar)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
259 (set-specifier left-toolbar (cons (current-buffer) toolbar))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
260 (set-specifier left-toolbar-width
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
261 (cons (selected-frame) width)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ((eq vm-toolbar-orientation 'bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (setq vm-toolbar-specifier bottom-toolbar)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
264 (set-specifier bottom-toolbar (cons (current-buffer) toolbar))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
265 (set-specifier bottom-toolbar-height
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
266 (cons (selected-frame) height)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (setq vm-toolbar-specifier top-toolbar)
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
269 (set-specifier top-toolbar (cons (current-buffer) toolbar))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
270 (set-specifier top-toolbar-height
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 0
diff changeset
271 (cons (selected-frame) height))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (defun vm-toolbar-make-toolbar-spec ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (let ((button-alist '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (autofile . vm-toolbar-autofile-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (compose . vm-toolbar-compose-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (delete/undelete . vm-toolbar-delete/undelete-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (file . vm-toolbar-file-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (help . vm-toolbar-help-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (next . vm-toolbar-next-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (previous . vm-toolbar-previous-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (print . vm-toolbar-print-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (quit . vm-toolbar-quit-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (reply . vm-toolbar-reply-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (visit . vm-toolbar-visit-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (button-list vm-use-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (toolbar nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (while button-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (if (null (car button-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (setq toolbar (cons nil toolbar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (setq cons (assq (car button-list) button-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (if cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (setq toolbar (cons (symbol-value (cdr cons)) toolbar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (setq button-list (cdr button-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (nreverse toolbar) ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (defun vm-toolbar-initialize ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 ;; drag these in now instead of waiting for them to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ;; autoloaded. the "loading..." messages could come at a bad
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 ;; moment and wipe an important echo area message, like "Auto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ;; save file is newer..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (require 'vm-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (require 'vm-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 ((null vm-toolbar-help-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (let ((tuples
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (if (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (vm-toolbar-next-icon "next-up.xpm" "next-dn.xpm" "next-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (vm-toolbar-previous-icon "previous-up.xpm" "previous-dn.xpm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 "previous-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (vm-toolbar-delete-icon "delete-up.xpm" "delete-dn.xpm" "delete-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (vm-toolbar-undelete-icon "undelete-up.xpm" "undelete-dn.xpm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 "undelete-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (vm-toolbar-autofile-icon "autofile-up.xpm" "autofile-dn.xpm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 "autofile-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (vm-toolbar-file-icon "file-up.xpm" "file-dn.xpm" "file-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (vm-toolbar-reply-icon "reply-up.xpm" "reply-dn.xpm" "reply-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (vm-toolbar-compose-icon "compose-up.xpm" "compose-dn.xpm" "compose-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (vm-toolbar-print-icon "print-up.xpm" "print-dn.xpm" "print-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (vm-toolbar-visit-icon "visit-up.xpm" "visit-dn.xpm" "visit-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (vm-toolbar-quit-icon "quit-up.xpm" "quit-dn.xpm" "quit-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (vm-toolbar-help-icon "help-up.xpm" "help-dn.xpm" "help-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (vm-toolbar-recover-icon "recover-up.xpm" "recover-dn.xpm" "recover-dn.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (vm-toolbar-next-icon "next-up.xbm" "next-dn.xbm" "next-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (vm-toolbar-previous-icon "previous-up.xbm" "previous-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 "previous-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (vm-toolbar-delete-icon "delete-up.xbm" "delete-dn.xbm" "delete-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (vm-toolbar-undelete-icon "undelete-up.xbm" "undelete-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 "undelete-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (vm-toolbar-autofile-icon "autofile-up.xbm" "autofile-dn.xbm"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 "autofile-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (vm-toolbar-file-icon "file-up.xbm" "file-dn.xbm" "file-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (vm-toolbar-reply-icon "reply-up.xbm" "reply-dn.xbm" "reply-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (vm-toolbar-compose-icon "compose-up.xbm" "compose-dn.xbm" "compose-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (vm-toolbar-print-icon "print-up.xbm" "print-dn.xbm" "print-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (vm-toolbar-visit-icon "visit-up.xbm" "visit-dn.xbm" "visit-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (vm-toolbar-quit-icon "quit-up.xbm" "quit-dn.xbm" "quit-xx.xbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (vm-toolbar-help-icon "help-up.xbm" "help-dn.xbm" "help-xx.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (vm-toolbar-recover-icon "recover-up.xbm" "recover-dn.xbm" "recover-xx.xpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 tuple files var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (if (not (file-directory-p vm-toolbar-pixmap-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (error "Bad toolbar pixmap directory: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 vm-toolbar-pixmap-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (while tuples
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (setq tuple (car tuples)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 var (car tuple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 files (cdr tuple))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (set var (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (lambda (f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (make-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (expand-file-name f vm-toolbar-pixmap-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (setq tuples (cdr tuples)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (setq vm-toolbar-helper-command 'vm-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (setq vm-toolbar-helper-icon vm-toolbar-help-icon))