annotate lisp/mh-e/mh-tool-bar.el @ 95172:894bae45bf1b

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