Mercurial > emacs
annotate lisp/mh-e/mh-tool-bar.el @ 75177:a94a200dd7e1
(Windows Keyboard): Yet another try to make everyone happy with that passage.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 10 Jan 2007 01:17:34 +0000 |
parents | c7f90876123f |
children | e3694f1cb928 |
rev | line source |
---|---|
68465 | 1 ;;; mh-tool-bar.el --- MH-E tool bar support |
2 | |
3 ;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu> | |
6 ;; Maintainer: Bill Wohler <wohler@newt.com> | |
7 ;; Keywords: mail | |
8 ;; See: mh-e.el | |
9 | |
10 ;; This file is part of GNU Emacs. | |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
25 ;; Boston, MA 02110-1301, USA. | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;;; Change Log: | |
30 | |
31 ;;; Code: | |
32 | |
33 (require 'mh-e) | |
68597
04d228a1b5c8
* mh-tool-bar.el: Add conditional require of 'tool-bar or 'toolbar
Mark D. Baushke <mdb@gnu.org>
parents:
68470
diff
changeset
|
34 (mh-do-in-gnu-emacs |
04d228a1b5c8
* mh-tool-bar.el: Add conditional require of 'tool-bar or 'toolbar
Mark D. Baushke <mdb@gnu.org>
parents:
68470
diff
changeset
|
35 (require 'tool-bar)) |
04d228a1b5c8
* mh-tool-bar.el: Add conditional require of 'tool-bar or 'toolbar
Mark D. Baushke <mdb@gnu.org>
parents:
68470
diff
changeset
|
36 (mh-do-in-xemacs |
04d228a1b5c8
* mh-tool-bar.el: Add conditional require of 'tool-bar or 'toolbar
Mark D. Baushke <mdb@gnu.org>
parents:
68470
diff
changeset
|
37 (require 'toolbar)) |
68465 | 38 |
39 ;;; Tool Bar Commands | |
40 | |
41 (defun mh-tool-bar-search (&optional arg) | |
42 "Interactively call `mh-tool-bar-search-function'. | |
43 Optional argument ARG is not used." | |
44 (interactive "P") | |
45 (call-interactively mh-tool-bar-search-function)) | |
46 | |
47 (defun mh-tool-bar-customize () | |
48 "Call `mh-customize' from the tool bar." | |
49 (interactive) | |
50 (mh-customize t)) | |
51 | |
52 (defun mh-tool-bar-folder-help () | |
53 "Visit \"(mh-e)Top\"." | |
54 (interactive) | |
55 (info "(mh-e)Top") | |
56 (delete-other-windows)) | |
57 | |
58 (defun mh-tool-bar-letter-help () | |
59 "Visit \"(mh-e)Editing Drafts\"." | |
60 (interactive) | |
61 (info "(mh-e)Editing Drafts") | |
62 (delete-other-windows)) | |
63 | |
64 (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag) | |
65 "Generate FUNCTION that replies to RECIPIENT. | |
66 If FOLDER-BUFFER-FLAG is nil then the function generated... | |
67 When INCLUDE-FLAG is non-nil, include message body being replied to." | |
68 `(defun ,function (&optional arg) | |
69 ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply." | |
70 recipient) | |
71 (interactive "P") | |
72 ,(if folder-buffer-flag nil '(set-buffer mh-show-folder-buffer)) | |
73 (mh-reply (mh-get-msg-num nil) ,recipient arg))) | |
74 | |
75 (mh-tool-bar-reply-generator mh-tool-bar-reply-from "from" t) | |
76 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-from "from" nil) | |
77 (mh-tool-bar-reply-generator mh-tool-bar-reply-to "to" t) | |
78 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-to "to" nil) | |
79 (mh-tool-bar-reply-generator mh-tool-bar-reply-all "all" t) | |
80 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-all "all" nil) | |
81 | |
82 | |
83 | |
84 ;;; Tool Bar Creation | |
85 | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
86 ;; Shush compiler. |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
87 (defvar image-load-path) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
88 |
68465 | 89 (defmacro mh-tool-bar-define (defaults &rest buttons) |
90 "Define a tool bar for MH-E. | |
91 DEFAULTS is the list of buttons that are present by default. It | |
92 is a list of lists where the sublists are of the following form: | |
93 | |
94 (:KEYWORD FUNC1 FUNC2 FUNC3 ...) | |
95 | |
96 Here :KEYWORD is one of :folder or :letter. If it is :folder then | |
97 the default buttons in the folder and show mode buffers are being | |
98 specified. If it is :letter then the default buttons in the | |
99 letter mode are listed. FUNC1, FUNC2, FUNC3, ... are the names of | |
100 the functions that the buttons would execute. | |
101 | |
102 Each element of BUTTONS is a list consisting of four mandatory | |
103 items and one optional item as follows: | |
104 | |
105 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR) | |
106 | |
107 where, | |
108 | |
109 FUNCTION is the name of the function that will be executed when | |
110 the button is clicked. | |
111 | |
112 MODES is a list of symbols. List elements must be from \"folder\", | |
113 \"letter\" and \"sequence\". If \"folder\" is present then the button is | |
114 available in the folder and show buffer. If the name of FUNCTION is | |
115 of the form \"mh-foo\", where foo is some arbitrary string, then we | |
116 check if the function `mh-show-foo' exists. If it exists then that | |
117 function is used in the show buffer. Otherwise the original function | |
118 `mh-foo' is used in the show buffer as well. Presence of \"sequence\" | |
119 is handled similar to the above. The only difference is that the | |
120 button is shown only when the folder is narrowed to a sequence. If | |
121 \"letter\" is present in MODES, then the button is available during | |
122 draft editing and runs FUNCTION when clicked. | |
123 | |
124 ICON is the icon that is drawn in the button. | |
125 | |
126 DOC is the documentation for the button. It is used in tool-tips and | |
127 in providing other help to the user. GNU Emacs uses only the first | |
128 line of the string. So the DOC should be formatted such that the | |
129 first line is useful and complete without the rest of the string. | |
130 | |
131 Optional item ENABLE-EXPR is an arbitrary lisp expression. If it | |
132 evaluates to nil, then the button is deactivated, otherwise it is | |
133 active. If it isn't present then the button is always active." | |
134 ;; The following variable names have been carefully chosen to make code | |
135 ;; generation easier. Modifying the names should be done carefully. | |
136 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter | |
137 show-buttons show-button-setter show-seq-button-setter | |
138 letter-buttons letter-docs letter-button-setter | |
139 folder-defaults letter-defaults | |
140 folder-vectors show-vectors letter-vectors) | |
141 (dolist (x defaults) | |
142 (cond ((eq (car x) :folder) (setq folder-defaults (cdr x))) | |
143 ((eq (car x) :letter) (setq letter-defaults (cdr x))))) | |
144 (dolist (button buttons) | |
145 (unless (and (listp button) | |
146 (or (equal (length button) 4) (equal (length button) 5))) | |
147 (error "Incorrect MH-E tool-bar button specification: %s" button)) | |
148 (let* ((name (nth 0 button)) | |
149 (name-str (symbol-name name)) | |
150 (icon (nth 2 button)) | |
151 (xemacs-icon (mh-do-in-xemacs | |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
152 `(cdr (assoc (quote ,(intern icon)) mh-xemacs-icon-map)))) |
68465 | 153 (full-doc (nth 3 button)) |
154 (doc (if (string-match "\\(.*\\)\n" full-doc) | |
155 (match-string 1 full-doc) | |
156 full-doc)) | |
70114
29c303bc6423
(mh-tool-bar-define): Fix enable-expr so that one can permenently
Bill Wohler <wohler@newt.com>
parents:
69728
diff
changeset
|
157 (enable-expr (if (eql (length button) 4) t (nth 4 button))) |
68465 | 158 (modes (nth 1 button)) |
159 functions show-sym) | |
160 (when (memq 'letter modes) (setq functions `(:letter ,name))) | |
161 (when (or (memq 'folder modes) (memq 'sequence modes)) | |
162 (setq functions | |
163 (append `(,(if (memq 'folder modes) :folder :sequence) ,name) | |
164 functions)) | |
165 (setq show-sym | |
166 (if (string-match "^mh-\\(.*\\)$" name-str) | |
167 (intern (concat "mh-show-" (match-string 1 name-str))) | |
168 name)) | |
169 (setq functions | |
170 (append `(,(if (memq 'folder modes) :show :show-seq) | |
171 ,(if (fboundp show-sym) show-sym name)) | |
172 functions))) | |
173 (do ((functions functions (cddr functions))) | |
174 ((null functions)) | |
175 (let* ((type (car functions)) | |
176 (function (cadr functions)) | |
177 (type1 (substring (symbol-name type) 1)) | |
178 (vector-list (cond ((eq type :show) 'show-vectors) | |
179 ((eq type :show-seq) 'show-vectors) | |
180 ((eq type :letter) 'letter-vectors) | |
181 (t 'folder-vectors))) | |
182 (list (cond ((eq type :letter) 'mh-tool-bar-letter-buttons) | |
183 (t 'mh-tool-bar-folder-buttons))) | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
184 (key (intern (concat "mh-" type1 "-tool-bar-" name-str))) |
68465 | 185 (setter (intern (concat type1 "-button-setter"))) |
186 (mbuttons (cond ((eq type :letter) 'letter-buttons) | |
187 ((eq type :show) 'show-buttons) | |
188 ((eq type :show-seq) 'show-buttons) | |
189 (t 'folder-buttons))) | |
190 (docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs) | |
191 ((eq mbuttons 'folder-buttons) 'folder-docs)))) | |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
192 (add-to-list vector-list `(vector ,xemacs-icon ',function t ,full-doc)) |
68465 | 193 (add-to-list |
194 setter `(when (member ',name ,list) | |
195 (mh-funcall-if-exists | |
196 tool-bar-add-item ,icon ',function ',key | |
197 :help ,doc :enable ',enable-expr))) | |
198 (add-to-list mbuttons name) | |
199 (if docs (add-to-list docs doc)))))) | |
200 (setq folder-buttons (nreverse folder-buttons) | |
201 letter-buttons (nreverse letter-buttons) | |
202 show-buttons (nreverse show-buttons) | |
203 letter-docs (nreverse letter-docs) | |
204 folder-docs (nreverse folder-docs) | |
205 folder-vectors (nreverse folder-vectors) | |
206 show-vectors (nreverse show-vectors) | |
207 letter-vectors (nreverse letter-vectors)) | |
208 (dolist (x folder-defaults) | |
209 (unless (memq x folder-buttons) | |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
210 (error "Folder defaults contains unknown button %s" x))) |
68465 | 211 (dolist (x letter-defaults) |
212 (unless (memq x letter-buttons) | |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
213 (error "Letter defaults contains unknown button %s" x))) |
68465 | 214 `(eval-when (compile load eval) |
215 ;; GNU Emacs tool bar specific code | |
216 (mh-do-in-gnu-emacs | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
217 (defun mh-buffer-exists-p (mode) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
218 "Test whether a buffer with major mode MODE is present." |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
219 (loop for buf in (buffer-list) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
220 when (with-current-buffer buf |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
221 (eq major-mode mode)) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
222 return t)) |
68465 | 223 ;; Tool bar initialization functions |
224 (defun mh-tool-bar-folder-buttons-init () | |
225 (when (mh-buffer-exists-p 'mh-folder-mode) | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
226 (let* ((load-path (mh-image-load-path-for-library "mh-e" |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
227 "mh-logo.xpm")) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
228 (image-load-path (cons (car load-path) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
229 (when (boundp 'image-load-path) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
230 image-load-path)))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
231 (setq mh-folder-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
232 (let ((tool-bar-map (make-sparse-keymap))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
233 ,@(nreverse folder-button-setter) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
234 tool-bar-map)) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
235 (setq mh-folder-seq-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
236 (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
237 ,@(nreverse sequence-button-setter) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
238 tool-bar-map)) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
239 (setq mh-show-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
240 (let ((tool-bar-map (make-sparse-keymap))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
241 ,@(nreverse show-button-setter) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
242 tool-bar-map)) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
243 (setq mh-show-seq-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
244 (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
245 ,@(nreverse show-seq-button-setter) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
246 tool-bar-map))))) |
68465 | 247 (defun mh-tool-bar-letter-buttons-init () |
248 (when (mh-buffer-exists-p 'mh-letter-mode) | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
249 (let* ((load-path (mh-image-load-path-for-library "mh-e" |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
250 "mh-logo.xpm")) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
251 (image-load-path (cons (car load-path) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
252 (when (boundp 'image-load-path) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
253 image-load-path)))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
254 (setq mh-letter-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
255 (let ((tool-bar-map (make-sparse-keymap))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
256 ,@(nreverse letter-button-setter) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
257 tool-bar-map))))) |
68465 | 258 ;; Custom setter functions |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
259 (defun mh-tool-bar-update (mode default-map sequence-map) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
260 "Update `tool-bar-map' in all buffers of MODE. |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
261 Use SEQUENCE-MAP if display is limited; DEFAULT-MAP otherwise." |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
262 (loop for buf in (buffer-list) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
263 do (with-current-buffer buf |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
264 (if (eq mode major-mode) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
265 (let ((map (if mh-folder-view-stack |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
266 sequence-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
267 default-map))) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
268 ;; Yes, make-local-variable is necessary since we |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
269 ;; get here during initialization when loading |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
270 ;; mh-e.el, after the +inbox buffer has been |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
271 ;; created, but before mh-folder-mode has run and |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
272 ;; created the local map. |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
273 (set (make-local-variable 'tool-bar-map) map)))))) |
68465 | 274 (defun mh-tool-bar-folder-buttons-set (symbol value) |
275 "Construct tool bar for `mh-folder-mode' and `mh-show-mode'." | |
276 (set-default symbol value) | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
277 (mh-tool-bar-folder-buttons-init) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
278 (mh-tool-bar-update 'mh-folder-mode mh-folder-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
279 mh-folder-seq-tool-bar-map) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
280 (mh-tool-bar-update 'mh-show-mode mh-show-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
281 mh-show-seq-tool-bar-map)) |
68465 | 282 (defun mh-tool-bar-letter-buttons-set (symbol value) |
283 "Construct tool bar for `mh-letter-mode'." | |
284 (set-default symbol value) | |
70145
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
285 (mh-tool-bar-letter-buttons-init) |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
286 (mh-tool-bar-update 'mh-letter-mode mh-letter-tool-bar-map |
00cb3fe5fed5
* mh-tool-bar.el (image-load-path): Define to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
70114
diff
changeset
|
287 mh-letter-tool-bar-map))) |
68465 | 288 ;; XEmacs specific code |
289 (mh-do-in-xemacs | |
290 (defvar mh-tool-bar-folder-vector-map | |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
291 (list ,@(loop for button in folder-buttons |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
292 for vector in folder-vectors |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
293 collect `(cons ',button ,vector)))) |
68465 | 294 (defvar mh-tool-bar-show-vector-map |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
295 (list ,@(loop for button in show-buttons |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
296 for vector in show-vectors |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
297 collect `(cons ',button ,vector)))) |
68465 | 298 (defvar mh-tool-bar-letter-vector-map |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
299 (list ,@(loop for button in letter-buttons |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
300 for vector in letter-vectors |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
301 collect `(cons ',button ,vector)))) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
302 (defvar mh-tool-bar-folder-buttons) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
303 (defvar mh-tool-bar-show-buttons) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
304 (defvar mh-tool-bar-letter-buttons) |
68465 | 305 ;; Custom setter functions |
306 (defun mh-tool-bar-letter-buttons-set (symbol value) | |
307 (set-default symbol value) | |
308 (when mh-xemacs-has-tool-bar-flag | |
309 (setq mh-tool-bar-letter-buttons | |
310 (loop for b in value | |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
311 collect (cdr |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
312 (assoc b mh-tool-bar-letter-vector-map)))))) |
68465 | 313 (defun mh-tool-bar-folder-buttons-set (symbol value) |
314 (set-default symbol value) | |
315 (when mh-xemacs-has-tool-bar-flag | |
316 (setq mh-tool-bar-folder-buttons | |
317 (loop for b in value | |
318 collect (cdr (assoc b mh-tool-bar-folder-vector-map)))) | |
319 (setq mh-tool-bar-show-buttons | |
320 (loop for b in value | |
321 collect (cdr (assoc b mh-tool-bar-show-vector-map)))))) | |
322 (defun mh-tool-bar-init (mode) | |
323 "Install tool bar in MODE." | |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
324 (when mh-xemacs-use-tool-bar-flag |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
325 (let ((tool-bar (cond ((eq mode :folder) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
326 mh-tool-bar-folder-buttons) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
327 ((eq mode :letter) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
328 mh-tool-bar-letter-buttons) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
329 ((eq mode :show) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
330 mh-tool-bar-show-buttons))) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
331 (height 37) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
332 (width 40) |
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
333 (buffer (current-buffer))) |
68465 | 334 (cond |
335 ((eq mh-xemacs-tool-bar-position 'top) | |
336 (set-specifier top-toolbar tool-bar buffer) | |
337 (set-specifier top-toolbar-visible-p t) | |
338 (set-specifier top-toolbar-height height)) | |
339 ((eq mh-xemacs-tool-bar-position 'bottom) | |
340 (set-specifier bottom-toolbar tool-bar buffer) | |
341 (set-specifier bottom-toolbar-visible-p t) | |
342 (set-specifier bottom-toolbar-height height)) | |
343 ((eq mh-xemacs-tool-bar-position 'left) | |
344 (set-specifier left-toolbar tool-bar buffer) | |
345 (set-specifier left-toolbar-visible-p t) | |
346 (set-specifier left-toolbar-width width)) | |
347 ((eq mh-xemacs-tool-bar-position 'right) | |
348 (set-specifier right-toolbar tool-bar buffer) | |
349 (set-specifier right-toolbar-visible-p t) | |
350 (set-specifier right-toolbar-width width)) | |
351 (t (set-specifier default-toolbar tool-bar buffer))))))) | |
352 ;; Declare customizable tool bars | |
353 (custom-declare-variable | |
354 'mh-tool-bar-folder-buttons | |
355 '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults)) | |
356 "List of buttons to include in MH-Folder tool bar." | |
70114
29c303bc6423
(mh-tool-bar-define): Fix enable-expr so that one can permenently
Bill Wohler <wohler@newt.com>
parents:
69728
diff
changeset
|
357 :group 'mh-tool-bar |
29c303bc6423
(mh-tool-bar-define): Fix enable-expr so that one can permenently
Bill Wohler <wohler@newt.com>
parents:
69728
diff
changeset
|
358 :set 'mh-tool-bar-folder-buttons-set |
68465 | 359 :type '(set ,@(loop for x in folder-buttons |
360 for y in folder-docs | |
69728
fb125d0913e5
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to remove
Bill Wohler <wohler@newt.com>
parents:
69714
diff
changeset
|
361 collect `(const :tag ,y ,x))) |
fb125d0913e5
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to remove
Bill Wohler <wohler@newt.com>
parents:
69714
diff
changeset
|
362 ;;:package-version '(MH-E "7.1") |
fb125d0913e5
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to remove
Bill Wohler <wohler@newt.com>
parents:
69714
diff
changeset
|
363 ) |
68465 | 364 (custom-declare-variable |
365 'mh-tool-bar-letter-buttons | |
366 '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults)) | |
367 "List of buttons to include in MH-Letter tool bar." | |
70114
29c303bc6423
(mh-tool-bar-define): Fix enable-expr so that one can permenently
Bill Wohler <wohler@newt.com>
parents:
69728
diff
changeset
|
368 :group 'mh-tool-bar |
29c303bc6423
(mh-tool-bar-define): Fix enable-expr so that one can permenently
Bill Wohler <wohler@newt.com>
parents:
69728
diff
changeset
|
369 :set 'mh-tool-bar-letter-buttons-set |
68465 | 370 :type '(set ,@(loop for x in letter-buttons |
371 for y in letter-docs | |
69728
fb125d0913e5
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to remove
Bill Wohler <wohler@newt.com>
parents:
69714
diff
changeset
|
372 collect `(const :tag ,y ,x))) |
fb125d0913e5
* mh-e.el (mh-defcustom, mh-defface, mh-defgroup): Macros to remove
Bill Wohler <wohler@newt.com>
parents:
69714
diff
changeset
|
373 ;;:package-version '(MH-E "7.1") |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
374 )))) |
68465 | 375 |
71599
c7f90876123f
(mh-tool-bar-define): Fix XEmacs' vector-list so it refers to the
Bill Wohler <wohler@newt.com>
parents:
70145
diff
changeset
|
376 ;; The icon names are duplicated in the Makefile and mh-xemacs.el. |
68465 | 377 (mh-tool-bar-define |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
378 ((:folder mh-inc-folder mh-mime-save-parts |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
379 mh-previous-undeleted-msg mh-page-msg |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
380 mh-next-undeleted-msg mh-delete-msg mh-refile-msg |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
381 mh-undo mh-execute-commands mh-toggle-tick mh-reply |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
382 mh-alias-grab-from-field mh-send mh-rescan-folder |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
383 mh-tool-bar-search mh-visit-folder |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
384 mh-tool-bar-customize mh-tool-bar-folder-help |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
385 mh-widen) |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
386 (:letter mh-send-letter save-buffer mh-fully-kill-draft |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
387 mh-compose-insertion ispell-message undo |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
388 clipboard-kill-region clipboard-kill-ring-save |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
389 clipboard-yank mh-tool-bar-customize |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
390 mh-tool-bar-letter-help)) |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
391 ;; Folder/Show buffer buttons |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
392 (mh-inc-folder (folder) "mail/inbox" "Incorporate new mail in Inbox |
68465 | 393 This button runs `mh-inc-folder' which drags any |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
394 new mail into your Inbox folder") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
395 (mh-mime-save-parts (folder) "attach" "Save MIME parts from this message |
68465 | 396 This button runs `mh-mime-save-parts' which saves a message's |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
397 different parts into separate files") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
398 (mh-previous-undeleted-msg (folder) "left-arrow" |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
399 "Go to the previous undeleted message |
68465 | 400 This button runs `mh-previous-undeleted-msg'") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
401 (mh-page-msg (folder) "next-page" "Page the current message forwards |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
402 This button runs `mh-page-msg'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
403 (mh-next-undeleted-msg (folder) "right-arrow" "Go to the next undeleted message |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
404 The button runs `mh-next-undeleted-msg'") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
405 (mh-delete-msg (folder) "delete" "Mark this message for deletion |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
406 This button runs `mh-delete-msg'") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
407 (mh-refile-msg (folder) "mail/move" "Refile this message |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
408 This button runs `mh-refile-msg'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
409 (mh-undo (folder) "undo" "Undo last operation |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
410 This button runs `undo'" |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
411 (mh-outstanding-commands-p)) |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
412 (mh-execute-commands (folder) "data-save" "Perform moves and deletes |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
413 This button runs `mh-execute-commands'" |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
414 (mh-outstanding-commands-p)) |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
415 (mh-toggle-tick (folder) "mail/flag-for-followup" "Toggle tick mark |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
416 This button runs `mh-toggle-tick'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
417 (mh-toggle-showing (folder) "show" "Toggle showing message |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
418 This button runs `mh-toggle-showing'") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
419 (mh-reply (folder) "mail/reply" "Reply to this message |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
420 This button runs `mh-reply'") |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
421 (mh-tool-bar-reply-from (folder) "mail/reply-from" "Reply to \"from\"") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
422 (mh-tool-bar-reply-to (folder) "mail/reply-to" "Reply to \"to\"") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
423 (mh-tool-bar-reply-all (folder) "mail/reply-all" "Reply to \"all\"") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
424 (mh-alias-grab-from-field (folder) "contact" "Create alias for sender |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
425 This button runs `mh-alias-grab-from-field'" |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
426 (and (mh-extract-from-header-value) |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
427 (not (mh-alias-for-from-p)))) |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
428 (mh-send (folder) "mail/compose" "Compose new message |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
429 This button runs `mh-send'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
430 (mh-rescan-folder (folder) "refresh" "Rescan this folder |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
431 This button runs `mh-rescan-folder'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
432 (mh-pack-folder (folder) "mail/repack" "Repack this folder |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
433 This button runs `mh-pack-folder'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
434 (mh-tool-bar-search (folder) "search" "Search |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
435 This button runs `mh-tool-bar-search-function'") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
436 (mh-visit-folder (folder) "open" "Visit other folder |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
437 This button runs `mh-visit-folder'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
438 ;; Letter buffer buttons |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
439 (mh-send-letter (letter) "mail/send" "Send this letter") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
440 (save-buffer (letter) "save" "Save current buffer to its file" |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
441 (buffer-modified-p)) |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
442 (mh-fully-kill-draft (letter) "delete" "Kill this draft") |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
443 (mh-compose-insertion (letter) "attach" "Insert attachment") |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
444 (ispell-message (letter) "spell" "Check spelling") |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
445 (undo (letter) "undo" "Undo last operation") |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
446 (clipboard-kill-region (letter) "cut" |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
447 "Cut (kill) text in region") |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
448 (clipboard-kill-ring-save (letter) "copy" |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
449 "Copy text in region") |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
450 (clipboard-yank (letter) "paste" |
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
451 "Paste (yank) text cut or copied earlier") |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
452 ;; Common buttons |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
453 (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
454 (mh-tool-bar-folder-help (folder) "help" "Help! (general help) |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
455 This button runs `info'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
456 (mh-tool-bar-letter-help (letter) "help" "Help! (general help) |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
457 This button runs `info'") |
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
458 ;; Folder narrowed to sequence buttons |
69714
7ff38193167f
Use clipboard-kill-region, clipboard-kill-ring-save, and
Bill Wohler <wohler@newt.com>
parents:
69245
diff
changeset
|
459 (mh-widen (sequence) "zoom-out" "Widen from the sequence |
69245
f3bbf5f32462
* mh-folder.el (mh-tool-bar-init): Autoload.
Bill Wohler <wohler@newt.com>
parents:
68597
diff
changeset
|
460 This button runs `mh-widen'")) |
68465 | 461 |
462 (provide 'mh-tool-bar) | |
463 | |
464 ;; Local Variables: | |
465 ;; indent-tabs-mode: nil | |
466 ;; sentence-end-double-space: nil | |
467 ;; End: | |
468 | |
68470 | 469 ;; arch-tag: 28c2436d-bb8d-486a-a8d7-5a4d9cae3513 |
68465 | 470 ;;; mh-tool-bar.el ends here |