aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2005-12-23 07:40:40 +0000
committerBill Wohler2005-12-23 07:40:40 +0000
commit2dcf34f9ca6c16817a902fb7340af06708702781 (patch)
tree01f09bebb644d9978078e24521e698132ed014c7
parentd169946261347a11f80680f4deda7d0a62816f39 (diff)
downloademacs-2dcf34f9ca6c16817a902fb7340af06708702781.tar.gz
emacs-2dcf34f9ca6c16817a902fb7340af06708702781.zip
Follow Emacs coding conventions. Use default setting of
emacs-lisp-docstring-fill-column which is 65.
-rw-r--r--lisp/mh-e/ChangeLog3
-rw-r--r--lisp/mh-e/mh-acros.el31
-rw-r--r--lisp/mh-e/mh-alias.el83
-rw-r--r--lisp/mh-e/mh-comp.el460
-rw-r--r--lisp/mh-e/mh-customize.el1294
-rw-r--r--lisp/mh-e/mh-e.el779
-rw-r--r--lisp/mh-e/mh-funcs.el95
-rw-r--r--lisp/mh-e/mh-gnus.el12
-rw-r--r--lisp/mh-e/mh-identity.el47
-rw-r--r--lisp/mh-e/mh-index.el368
-rw-r--r--lisp/mh-e/mh-init.el37
-rw-r--r--lisp/mh-e/mh-junk.el137
-rw-r--r--lisp/mh-e/mh-mime.el263
-rw-r--r--lisp/mh-e/mh-pick.el145
-rw-r--r--lisp/mh-e/mh-print.el89
-rw-r--r--lisp/mh-e/mh-seq.el303
-rw-r--r--lisp/mh-e/mh-speed.el33
-rw-r--r--lisp/mh-e/mh-utils.el425
18 files changed, 2518 insertions, 2086 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 613fcc49cd4..f6927979963 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,5 +1,8 @@
12005-12-22 Bill Wohler <wohler@newt.com> 12005-12-22 Bill Wohler <wohler@newt.com>
2 2
3 Follow Emacs coding conventions. Use default setting of
4 emacs-lisp-docstring-fill-column which is 65.
5
3 * mh-alias.el (mh-alias-reload): Sync docstrings with manual. 6 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
4 7
5 * mh-comp.el (mh-letter-mode): Use 60 column width. 8 * mh-comp.el (mh-letter-mode): Use 60 column width.
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index 5523f1cf46b..16c42d90634 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -49,8 +49,9 @@
49(defmacro mh-require-cl () 49(defmacro mh-require-cl ()
50 "Macro to load `cl' if needed. 50 "Macro to load `cl' if needed.
51Some versions of `cl' produce code for the expansion of 51Some versions of `cl' produce code for the expansion of
52\(setf (gethash ...) ...) that uses functions in `cl' at run time. This macro 52\(setf (gethash ...) ...) that uses functions in `cl' at run
53recognizes that and loads `cl' where appropriate." 53time. This macro recognizes that and loads `cl' where
54appropriate."
54 (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash) 55 (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash)
55 `(require 'cl) 56 `(require 'cl)
56 `(eval-when-compile (require 'cl)))) 57 `(eval-when-compile (require 'cl))))
@@ -75,16 +76,16 @@ recognizes that and loads `cl' where appropriate."
75 76
76(defmacro mh-make-local-hook (hook) 77(defmacro mh-make-local-hook (hook)
77 "Make HOOK local if needed. 78 "Make HOOK local if needed.
78XEmacs and versions of GNU Emacs before 21.1 require `make-local-hook' to be 79XEmacs and versions of GNU Emacs before 21.1 require
79called." 80`make-local-hook' to be called."
80 (when (and (fboundp 'make-local-hook) 81 (when (and (fboundp 'make-local-hook)
81 (not (get 'make-local-hook 'byte-obsolete-info))) 82 (not (get 'make-local-hook 'byte-obsolete-info)))
82 `(make-local-hook ,hook))) 83 `(make-local-hook ,hook)))
83 84
84(defmacro mh-mark-active-p (check-transient-mark-mode-flag) 85(defmacro mh-mark-active-p (check-transient-mark-mode-flag)
85 "A macro that expands into appropriate code in XEmacs and nil in GNU Emacs. 86 "A macro that expands into appropriate code in XEmacs and nil in GNU Emacs.
86In GNU Emacs if CHECK-TRANSIENT-MARK-MODE-FLAG is non-nil then check if 87In GNU Emacs if CHECK-TRANSIENT-MARK-MODE-FLAG is non-nil then
87variable `transient-mark-mode' is active." 88check if variable `transient-mark-mode' is active."
88 (cond ((featurep 'xemacs) ;XEmacs 89 (cond ((featurep 'xemacs) ;XEmacs
89 `(and (boundp 'zmacs-regions) zmacs-regions (region-active-p))) 90 `(and (boundp 'zmacs-regions) zmacs-regions (region-active-p)))
90 ((not check-transient-mark-mode-flag) ;GNU Emacs 91 ((not check-transient-mark-mode-flag) ;GNU Emacs
@@ -95,12 +96,14 @@ variable `transient-mark-mode' is active."
95 96
96(defmacro mh-defstruct (name-spec &rest fields) 97(defmacro mh-defstruct (name-spec &rest fields)
97 "Replacement for `defstruct' from the `cl' package. 98 "Replacement for `defstruct' from the `cl' package.
98The `defstruct' in the `cl' library produces compiler warnings, and generates 99The `defstruct' in the `cl' library produces compiler warnings,
99code that uses functions present in `cl' at run-time. This is a partial 100and generates code that uses functions present in `cl' at
100replacement, that avoids these issues. 101run-time. This is a partial replacement, that avoids these
101 102issues.
102NAME-SPEC declares the name of the structure, while FIELDS describes the 103
103various structure fields. Lookup `defstruct' for more details." 104NAME-SPEC declares the name of the structure, while FIELDS
105describes the various structure fields. Lookup `defstruct' for
106more details."
104 (let* ((struct-name (if (atom name-spec) name-spec (car name-spec))) 107 (let* ((struct-name (if (atom name-spec) name-spec (car name-spec)))
105 (conc-name (or (and (consp name-spec) 108 (conc-name (or (and (consp name-spec)
106 (cadr (assoc :conc-name (cdr name-spec)))) 109 (cadr (assoc :conc-name (cdr name-spec))))
@@ -136,8 +139,8 @@ various structure fields. Lookup `defstruct' for more details."
136 139
137(defmacro mh-assoc-ignore-case (key alist) 140(defmacro mh-assoc-ignore-case (key alist)
138 "Check if KEY is present in ALIST while ignoring case to do the comparison. 141 "Check if KEY is present in ALIST while ignoring case to do the comparison.
139Compatibility macro for Emacs versions that lack `assoc-string', introduced in 142Compatibility macro for Emacs versions that lack `assoc-string',
140Emacs 22." 143introduced in Emacs 22."
141 (if (fboundp 'assoc-string) 144 (if (fboundp 'assoc-string)
142 `(assoc-string ,key ,alist t) 145 `(assoc-string ,key ,alist t)
143 `(assoc-ignore-case ,key ,alist))) 146 `(assoc-ignore-case ,key ,alist)))
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 1fbcdea0b18..f0eb08939dc 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -68,10 +68,11 @@
68 "/usr/lib/mh/MailAliases" "/usr/share/mailutils/mh/MailAliases" 68 "/usr/lib/mh/MailAliases" "/usr/share/mailutils/mh/MailAliases"
69 "/etc/passwd") 69 "/etc/passwd")
70 "*A list of system files which are a source of aliases. 70 "*A list of system files which are a source of aliases.
71If these files are modified, they are automatically reread. This list need 71If these files are modified, they are automatically reread. This list
72include only system aliases and the passwd file, since personal alias files 72need include only system aliases and the passwd file, since personal
73listed in your `Aliasfile:' MH profile component are automatically included. 73alias files listed in your `Aliasfile:' MH profile component are
74You can update the alias list manually using \\[mh-alias-reload].") 74automatically included. You can update the alias list manually using
75\\[mh-alias-reload].")
75 76
76 77
77 78
@@ -79,8 +80,8 @@ You can update the alias list manually using \\[mh-alias-reload].")
79 80
80(defun mh-alias-tstamp (arg) 81(defun mh-alias-tstamp (arg)
81 "Check whether alias files have been modified. 82 "Check whether alias files have been modified.
82Return t if any file listed in the Aliasfile MH profile component has been 83Return t if any file listed in the Aliasfile MH profile component has
83modified since the timestamp. 84been modified since the timestamp.
84If ARG is non-nil, set timestamp with the current time." 85If ARG is non-nil, set timestamp with the current time."
85 (if arg 86 (if arg
86 (let ((time (current-time))) 87 (let ((time (current-time)))
@@ -98,8 +99,10 @@ If ARG is non-nil, set timestamp with the current time."
98 99
99(defun mh-alias-filenames (arg) 100(defun mh-alias-filenames (arg)
100 "Return list of filenames that contain aliases. 101 "Return list of filenames that contain aliases.
101The filenames come from the Aliasfile profile component and are expanded. 102The filenames come from the Aliasfile profile component and are
102If ARG is non-nil, filenames listed in `mh-alias-system-aliases' are appended." 103expanded.
104If ARG is non-nil, filenames listed in `mh-alias-system-aliases' are
105appended."
103 (or mh-progs (mh-find-path)) 106 (or mh-progs (mh-find-path))
104 (save-excursion 107 (save-excursion
105 (let* ((filename (mh-profile-component "Aliasfile")) 108 (let* ((filename (mh-profile-component "Aliasfile"))
@@ -120,8 +123,8 @@ If ARG is non-nil, filenames listed in `mh-alias-system-aliases' are appended."
120 123
121(defun mh-alias-gecos-name (gecos-name username comma-separator) 124(defun mh-alias-gecos-name (gecos-name username comma-separator)
122 "Return a usable address string from a GECOS-NAME and USERNAME. 125 "Return a usable address string from a GECOS-NAME and USERNAME.
123Use only part of the GECOS-NAME up to the first comma if COMMA-SEPARATOR is 126Use only part of the GECOS-NAME up to the first comma if
124non-nil." 127COMMA-SEPARATOR is non-nil."
125 (let ((res gecos-name)) 128 (let ((res gecos-name))
126 ;; Keep only string until first comma if COMMA-SEPARATOR is t. 129 ;; Keep only string until first comma if COMMA-SEPARATOR is t.
127 (if (and comma-separator 130 (if (and comma-separator
@@ -183,14 +186,15 @@ Exclude all aliases already in `mh-alias-alist' from `ali'"
183(defun mh-alias-reload () 186(defun mh-alias-reload ()
184 "Reload MH aliases. 187 "Reload MH aliases.
185 188
186Since aliases are updated frequently, MH-E reloads aliases automatically 189Since aliases are updated frequently, MH-E reloads aliases
187whenever an alias lookup occurs if an alias source has changed. Sources 190automatically whenever an alias lookup occurs if an alias source has
188include files listed in your `Aliasfile:' profile component and your password 191changed. Sources include files listed in your `Aliasfile:' profile
189file if option `mh-alias-local-users' is turned on. However, you can reload 192component and your password file if option `mh-alias-local-users' is
190your aliases manually by calling this command directly. 193turned on. However, you can reload your aliases manually by calling
194this command directly.
191 195
192This function runs `mh-alias-reloaded-hook' after the aliases have been 196This function runs `mh-alias-reloaded-hook' after the aliases have
193loaded." 197been loaded."
194 (interactive) 198 (interactive)
195 (save-excursion 199 (save-excursion
196 (message "Loading MH aliases...") 200 (message "Loading MH aliases...")
@@ -238,8 +242,8 @@ loaded."
238(defun mh-alias-ali (alias &optional user) 242(defun mh-alias-ali (alias &optional user)
239 "Return ali expansion for ALIAS. 243 "Return ali expansion for ALIAS.
240ALIAS must be a string for a single alias. 244ALIAS must be a string for a single alias.
241If USER is t, then assume ALIAS is an address and call ali -user. 245If USER is t, then assume ALIAS is an address and call ali -user. ali
242ali returns the string unchanged if not defined. The same is done here." 246returns the string unchanged if not defined. The same is done here."
243 (condition-case err 247 (condition-case err
244 (save-excursion 248 (save-excursion
245 (let ((user-arg (if user "-user" "-nouser"))) 249 (let ((user-arg (if user "-user" "-nouser")))
@@ -322,8 +326,8 @@ Blind aliases or users from /etc/passwd are not expanded."
322 326
323(defun mh-alias-suggest-alias (string &optional no-comma-swap) 327(defun mh-alias-suggest-alias (string &optional no-comma-swap)
324 "Suggest an alias for STRING. 328 "Suggest an alias for STRING.
325Don't reverse the order of strings separated by a comma if NO-COMMA-SWAP is 329Don't reverse the order of strings separated by a comma if
326non-nil." 330NO-COMMA-SWAP is non-nil."
327 (cond 331 (cond
328 ((string-match "^<\\(.*\\)>$" string) 332 ((string-match "^<\\(.*\\)>$" string)
329 ;; <somename@foo.bar> -> recurse, stripping brackets. 333 ;; <somename@foo.bar> -> recurse, stripping brackets.
@@ -378,8 +382,8 @@ non-nil."
378(defun mh-alias-canonicalize-suggestion (string) 382(defun mh-alias-canonicalize-suggestion (string)
379 "Process STRING to replace spaces by periods. 383 "Process STRING to replace spaces by periods.
380First all spaces and commas are replaced by periods. Then every run of 384First all spaces and commas are replaced by periods. Then every run of
381consecutive periods are replaced with a single period. Finally the string 385consecutive periods are replaced with a single period. Finally the
382is converted to lower case." 386string is converted to lower case."
383 (with-temp-buffer 387 (with-temp-buffer
384 (insert string) 388 (insert string)
385 ;; Replace spaces with periods 389 ;; Replace spaces with periods
@@ -417,10 +421,10 @@ is converted to lower case."
417 421
418(defun mh-alias-insert-file (&optional alias) 422(defun mh-alias-insert-file (&optional alias)
419 "Return filename which should be used to add ALIAS. 423 "Return filename which should be used to add ALIAS.
420The value of the option `mh-alias-insert-file' is used if non-nil\; otherwise 424The value of the option `mh-alias-insert-file' is used if non-nil\;
421the value of the `Aliasfile:' profile component is used. 425otherwise the value of the `Aliasfile:' profile component is used.
422If the alias already exists, try to return the name of the file that contains 426If the alias already exists, try to return the name of the file that
423it." 427contains it."
424 (cond 428 (cond
425 ((and mh-alias-insert-file (listp mh-alias-insert-file)) 429 ((and mh-alias-insert-file (listp mh-alias-insert-file))
426 (if (not (elt mh-alias-insert-file 1)) ; Only one entry, use it 430 (if (not (elt mh-alias-insert-file 1)) ; Only one entry, use it
@@ -488,12 +492,14 @@ Set `mh-alias-insert-file' or the Aliasfile profile component"))
488 492
489(defun mh-alias-add-alias-to-file (alias address &optional file) 493(defun mh-alias-add-alias-to-file (alias address &optional file)
490 "Add ALIAS for ADDRESS in alias FILE without alias check or prompts. 494 "Add ALIAS for ADDRESS in alias FILE without alias check or prompts.
491Prompt for alias file if not provided and there is more than one candidate. 495Prompt for alias file if not provided and there is more than one
492 496candidate.
493If the alias exists already, you will have the choice of inserting the new 497
494alias before or after the old alias. In the former case, this alias will be 498If the alias exists already, you will have the choice of
495used when sending mail to this alias. In the latter case, the alias serves as 499inserting the new alias before or after the old alias. In the
496an additional folder name hint when filing messages." 500former case, this alias will be used when sending mail to this
501alias. In the latter case, the alias serves as an additional
502folder name hint when filing messages."
497 (if (not file) 503 (if (not file)
498 (setq file (mh-alias-insert-file alias))) 504 (setq file (mh-alias-insert-file alias)))
499 (save-excursion 505 (save-excursion
@@ -543,11 +549,12 @@ an additional folder name hint when filing messages."
543;;;###mh-autoload 549;;;###mh-autoload
544(defun mh-alias-add-alias (alias address) 550(defun mh-alias-add-alias (alias address)
545 "*Add ALIAS for ADDRESS in personal alias file. 551 "*Add ALIAS for ADDRESS in personal alias file.
546This function prompts you for an alias and address. If the alias exists 552This function prompts you for an alias and address. If the alias
547already, you will have the choice of inserting the new alias before or after 553exists already, you will have the choice of inserting the new
548the old alias. In the former case, this alias will be used when sending mail 554alias before or after the old alias. In the former case, this
549to this alias. In the latter case, the alias serves as an additional folder 555alias will be used when sending mail to this alias. In the latter
550name hint when filing messages." 556case, the alias serves as an additional folder name hint when
557filing messages."
551 (interactive "P\nP") 558 (interactive "P\nP")
552 (mh-alias-reload-maybe) 559 (mh-alias-reload-maybe)
553 (setq alias (completing-read "Alias: " mh-alias-alist nil nil alias)) 560 (setq alias (completing-read "Alias: " mh-alias-alist nil nil alias))
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index a28fa3e9e9e..7b32d5ec08b 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -92,8 +92,8 @@ Some sites need to change this because of a name conflict.")
92 92
93(defvar mh-redist-background nil 93(defvar mh-redist-background nil
94 "If non-nil redist will be done in background like send. 94 "If non-nil redist will be done in background like send.
95This allows transaction log to be visible if -watch, -verbose or -snoop are 95This allows transaction log to be visible if -watch, -verbose or
96used.") 96-snoop are used.")
97 97
98 98
99 99
@@ -110,32 +110,39 @@ used.")
110 110
111(defvar mh-yank-hooks nil 111(defvar mh-yank-hooks nil
112 "Obsolete hook for modifying a citation just inserted in the mail buffer. 112 "Obsolete hook for modifying a citation just inserted in the mail buffer.
113
113Each hook function can find the citation between point and mark. 114Each hook function can find the citation between point and mark.
114And each hook function should leave point and mark around the citation 115And each hook function should leave point and mark around the
115text as modified. 116citation text as modified.
116 117
117This is a normal hook, misnamed for historical reasons. 118This is a normal hook, misnamed for historical reasons. It is
118It is semi-obsolete and is only used if `mail-citation-hook' is nil.") 119semi-obsolete and is only used if `mail-citation-hook' is nil.")
119 120
120(defvar mh-comp-formfile "components" 121(defvar mh-comp-formfile "components"
121 "Name of file to be used as a skeleton for composing messages. 122 "Name of file to be used as a skeleton for composing messages.
122Default is \"components\". If not an absolute file name, the file 123
123is searched for first in the user's MH directory, then in the 124Default is \"components\".
124system MH lib directory.") 125
126If not an absolute file name, the file is searched for first in the
127user's MH directory, then in the system MH lib directory.")
125 128
126(defvar mh-repl-formfile "replcomps" 129(defvar mh-repl-formfile "replcomps"
127 "Name of file to be used as a skeleton for replying to messages. 130 "Name of file to be used as a skeleton for replying to messages.
128Default is \"replcomps\". If not an absolute file name, the file 131
129is searched for first in the user's MH directory, then in the 132Default is \"replcomps\".
130system MH lib directory.") 133
134If not an absolute file name, the file is searched for first in the
135user's MH directory, then in the system MH lib directory.")
131 136
132(defvar mh-repl-group-formfile "replgroupcomps" 137(defvar mh-repl-group-formfile "replgroupcomps"
133 "Name of file to be used as a skeleton for replying to messages. 138 "Name of file to be used as a skeleton for replying to messages.
134This file is used to form replies to the sender and all recipients of a 139
135message. Only used if `(mh-variant-p 'nmh)' is non-nil.
136Default is \"replgroupcomps\". 140Default is \"replgroupcomps\".
137If not an absolute file name, the file is searched for first in the user's MH 141
138directory, then in the system MH lib directory.") 142This file is used to form replies to the sender and all recipients of
143a message. Only used if `(mh-variant-p 'nmh)' is non-nil.
144If not an absolute file name, the file is searched for first in the
145user's MH directory, then in the system MH lib directory.")
139 146
140(defvar mh-rejected-letter-start 147(defvar mh-rejected-letter-start
141 (format "^%s$" 148 (format "^%s$"
@@ -216,12 +223,12 @@ See `mh-send' for more details on composing mail."
216(defun mh-smail-batch (&optional to subject other-headers &rest ignored) 223(defun mh-smail-batch (&optional to subject other-headers &rest ignored)
217 "Compose a message with the MH mail system. 224 "Compose a message with the MH mail system.
218 225
219This function does not prompt the user for any header fields, and thus 226This function does not prompt the user for any header fields, and
220is suitable for use by programs that want to create a mail buffer. Users 227thus is suitable for use by programs that want to create a mail
221should use \\[mh-smail] to compose mail. 228buffer. Users should use \\[mh-smail] to compose mail.
222 229
223Optional arguments for setting certain fields include TO, SUBJECT, and 230Optional arguments for setting certain fields include TO,
224OTHER-HEADERS. Additional arguments are IGNORED." 231SUBJECT, and OTHER-HEADERS. Additional arguments are IGNORED."
225 (mh-find-path) 232 (mh-find-path)
226 (let ((mh-error-if-no-draft t)) 233 (let ((mh-error-if-no-draft t))
227 (mh-send (or to "") "" (or subject "")))) 234 (mh-send (or to "") "" (or subject ""))))
@@ -237,11 +244,12 @@ This is `mail-user-agent' entry point to MH-E.
237The optional arguments TO and SUBJECT specify recipients and the 244The optional arguments TO and SUBJECT specify recipients and the
238initial Subject field, respectively. 245initial Subject field, respectively.
239 246
240OTHER-HEADERS is an alist specifying additional 247OTHER-HEADERS is an alist specifying additional header fields.
241header fields. Elements look like (HEADER . VALUE) where both 248Elements look like (HEADER . VALUE) where both HEADER and VALUE
242HEADER and VALUE are strings. 249are strings.
243 250
244CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored." 251CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are
252ignored."
245 (mh-find-path) 253 (mh-find-path)
246 (let ((mh-error-if-no-draft t)) 254 (let ((mh-error-if-no-draft t))
247 (mh-send to "" subject) 255 (mh-send to "" subject)
@@ -254,20 +262,21 @@ CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored."
254(defun mh-edit-again (message) 262(defun mh-edit-again (message)
255 "Edit a MESSAGE to send it again. 263 "Edit a MESSAGE to send it again.
256 264
257If you don't complete a draft for one reason or another, and if the draft 265If you don't complete a draft for one reason or another, and if
258buffer is no longer available, you can pick your draft up again with this 266the draft buffer is no longer available, you can pick your draft
259command. If you don't use a draft folder, your last \"draft\" file will be 267up again with this command. If you don't use a draft folder, your
260used. If you use draft folders, you'll need to visit the draft folder with 268last \"draft\" file will be used. If you use draft folders,
261\"\\[mh-visit-folder] drafts <RET>\", use \\[mh-next-undeleted-msg] to move to 269you'll need to visit the draft folder with \"\\[mh-visit-folder]
262the appropriate message, and then use \\[mh-edit-again] to prepare the message 270drafts <RET>\", use \\[mh-next-undeleted-msg] to move to the
263for editing. 271appropriate message, and then use \\[mh-edit-again] to prepare
272the message for editing.
264 273
265This command can also be used to take messages that were sent to you and to 274This command can also be used to take messages that were sent to
266send them to more people. 275you and to send them to more people.
267 276
268Don't use this command to re-edit a message from a Mailer-Daemon who 277Don't use this command to re-edit a message from a Mailer-Daemon
269complained that your mail wasn't posted for some reason or another (see 278who complained that your mail wasn't posted for some reason or
270`mh-extract-rejected-mail'). 279another (see `mh-extract-rejected-mail').
271 280
272The default message is the current message. 281The default message is the current message.
273 282
@@ -303,9 +312,10 @@ See also `mh-send'."
303(defun mh-extract-rejected-mail (message) 312(defun mh-extract-rejected-mail (message)
304 "Edit a MESSAGE that was returned by the mail system. 313 "Edit a MESSAGE that was returned by the mail system.
305 314
306This command prepares the message for editing by removing the Mailer-Daemon 315This command prepares the message for editing by removing the
307envelope and unneeded header fields. Fix whatever addressing problem you had, 316Mailer-Daemon envelope and unneeded header fields. Fix whatever
308and send the message again with \\[mh-send-letter]. 317addressing problem you had, and send the message again with
318\\[mh-send-letter].
309 319
310The default message is the current message. 320The default message is the current message.
311 321
@@ -335,13 +345,14 @@ See also `mh-send'."
335(defun mh-forward (to cc &optional range) 345(defun mh-forward (to cc &optional range)
336 "Forward message. 346 "Forward message.
337 347
338You are prompted for the TO and CC recipients. You are given a draft 348You are prompted for the TO and CC recipients. You are given a
339to edit that looks like it would if you had run the MH command 349draft to edit that looks like it would if you had run the MH
340\"forw\". You can then add some text. 350command \"forw\". You can then add some text.
341 351
342You can forward several messages by using a RANGE. All of the messages 352You can forward several messages by using a RANGE. All of the
343in the range are inserted into your draft. Check the documentation of 353messages in the range are inserted into your draft. Check the
344`mh-interactive-range' to see how RANGE is read in interactive use. 354documentation of `mh-interactive-range' to see how RANGE is read
355in interactive use.
345 356
346The hook `mh-forward-hook' is called on the draft. 357The hook `mh-forward-hook' is called on the draft.
347 358
@@ -434,14 +445,15 @@ Original message has headers FROM and SUBJECT."
434(defun mh-redistribute (to cc &optional message) 445(defun mh-redistribute (to cc &optional message)
435 "Redistribute a message. 446 "Redistribute a message.
436 447
437This command is similar in function to forwarding mail, but it does not allow 448This command is similar in function to forwarding mail, but it
438you to edit the message, nor does it add your name to the \"From\" header 449does not allow you to edit the message, nor does it add your name
439field. It appears to the recipient as if the message had come from the 450to the \"From\" header field. It appears to the recipient as if
440original sender. When you run this command, you are prompted for the TO and CC 451the message had come from the original sender. When you run this
441recipients. The default MESSAGE is the current message. 452command, you are prompted for the TO and CC recipients. The
453default MESSAGE is the current message.
442 454
443Also investigate the \\[mh-edit-again] command for another way to redistribute 455Also investigate the \\[mh-edit-again] command for another way to
444messages. 456redistribute messages.
445 457
446See also `mh-redist-full-contents-flag'." 458See also `mh-redist-full-contents-flag'."
447 (interactive (list (mh-read-address "Redist-To: ") 459 (interactive (list (mh-read-address "Redist-To: ")
@@ -486,10 +498,11 @@ See also `mh-redist-full-contents-flag'."
486 498
487(defun mh-show-buffer-message-number (&optional buffer) 499(defun mh-show-buffer-message-number (&optional buffer)
488 "Message number of displayed message in corresponding show buffer. 500 "Message number of displayed message in corresponding show buffer.
501
489Return nil if show buffer not displayed. 502Return nil if show buffer not displayed.
490If in `mh-letter-mode', don't display the message number being replied to, 503If in `mh-letter-mode', don't display the message number being replied
491but rather the message number of the show buffer associated with our 504to, but rather the message number of the show buffer associated with
492originating folder buffer. 505our originating folder buffer.
493Optional argument BUFFER can be used to specify the buffer." 506Optional argument BUFFER can be used to specify the buffer."
494 (save-excursion 507 (save-excursion
495 (if buffer 508 (if buffer
@@ -513,14 +526,14 @@ Optional argument BUFFER can be used to specify the buffer."
513(defun mh-reply (message &optional reply-to includep) 526(defun mh-reply (message &optional reply-to includep)
514 "Reply to a MESSAGE. 527 "Reply to a MESSAGE.
515 528
516When you reply to a message, you are first prompted with \"Reply to whom?\" 529When you reply to a message, you are first prompted with \"Reply
517\(unless the optional argument REPLY-TO is provided). You have several choices 530to whom?\" (unless the optional argument REPLY-TO is provided).
518here. 531You have several choices here.
519 532
520 Response Reply Goes To 533 Response Reply Goes To
521 534
522 from The person who sent the message. This is the default, 535 from The person who sent the message. This is the
523 so <RET> is sufficient. 536 default, so <RET> is sufficient.
524 537
525 to Replies to the sender, plus all recipients in the 538 to Replies to the sender, plus all recipients in the
526 \"To:\" header field. 539 \"To:\" header field.
@@ -528,31 +541,32 @@ here.
528 all 541 all
529 cc Forms a reply to the sender, plus all recipients. 542 cc Forms a reply to the sender, plus all recipients.
530 543
531Depending on your answer, \"repl\" is given a different argument to form your 544Depending on your answer, \"repl\" is given a different argument
532reply. Specifically, a choice of \"from\" or none at all runs \"repl -nocc 545to form your reply. Specifically, a choice of \"from\" or none at
533all\", and a choice of \"to\" runs \"repl -cc to\". Finally, either \"cc\" or 546all runs \"repl -nocc all\", and a choice of \"to\" runs \"repl
534\"all\" runs \"repl -cc all -nocc me\". 547-cc to\". Finally, either \"cc\" or \"all\" runs \"repl -cc all
548-nocc me\".
535 549
536Two windows are then created. One window contains the message to which you are 550Two windows are then created. One window contains the message to
537replying in an MH-Show buffer. Your draft, in MH-Letter mode 551which you are replying in an MH-Show buffer. Your draft, in
538\(see `mh-letter-mode'), is in the other window. 552MH-Letter mode \(see `mh-letter-mode'), is in the other window.
539 553
540If you supply a prefix argument INCLUDEP, the message you are replying to is 554If you supply a prefix argument INCLUDEP, the message you are
541inserted in your reply after having first been run through \"mhl\" with the 555replying to is inserted in your reply after having first been run
542format file \"mhl.reply\". 556through \"mhl\" with the format file \"mhl.reply\".
543 557
544Alternatively, you can customize the option `mh-yank-behavior' and choose one 558Alternatively, you can customize the option `mh-yank-behavior'
545of its \"Automatically\" variants to do the same thing. If you do so, the 559and choose one of its \"Automatically\" variants to do the same
546prefix argument has no effect. 560thing. If you do so, the prefix argument has no effect.
547 561
548Another way to include the message automatically in your draft is to use 562Another way to include the message automatically in your draft is
549\"repl: -filter repl.filter\" in your MH profile. 563to use \"repl: -filter repl.filter\" in your MH profile.
550 564
551If you wish to customize the header or other parts of the reply draft, please 565If you wish to customize the header or other parts of the reply
552see \"repl\" and \"mh-format\". 566draft, please see \"repl\" and \"mh-format\".
553 567
554See also `mh-reply-show-message-flag', `mh-reply-default-reply-to', and 568See also `mh-reply-show-message-flag',
555`mh-send'." 569`mh-reply-default-reply-to', and `mh-send'."
556 (interactive (list 570 (interactive (list
557 (mh-get-msg-num t) 571 (mh-get-msg-num t)
558 (let ((minibuffer-help-form 572 (let ((minibuffer-help-form
@@ -619,17 +633,19 @@ See also `mh-reply-show-message-flag', `mh-reply-default-reply-to', and
619(defun mh-send (to cc subject) 633(defun mh-send (to cc subject)
620 "Compose a message. 634 "Compose a message.
621 635
622Your letter appears in an Emacs buffer whose mode is MH-Letter (see 636Your letter appears in an Emacs buffer whose mode is
623`mh-letter-mode'). 637MH-Letter (see `mh-letter-mode').
624 638
625The arguments TO, CC, and SUBJECT can be used to prefill the draft fields or 639The arguments TO, CC, and SUBJECT can be used to prefill the
626suppress the prompts if `mh-compose-prompt-flag' is on. They are also passed 640draft fields or suppress the prompts if `mh-compose-prompt-flag'
627to the function set in the option `mh-compose-letter-function'. 641is on. They are also passed to the function set in the option
642`mh-compose-letter-function'.
628 643
629See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'. 644See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'.
630 645
631Outside of an MH-Folder buffer (`mh-folder-mode'), you must call either 646Outside of an MH-Folder buffer (`mh-folder-mode'), you must call
632\\[mh-smail] or \\[mh-smail-other-window] to compose a new message." 647either \\[mh-smail] or \\[mh-smail-other-window] to compose a new
648message."
633 (interactive (list 649 (interactive (list
634 (mh-interactive-read-address "To: ") 650 (mh-interactive-read-address "To: ")
635 (mh-interactive-read-address "Cc: ") 651 (mh-interactive-read-address "Cc: ")
@@ -642,8 +658,8 @@ Outside of an MH-Folder buffer (`mh-folder-mode'), you must call either
642(defun mh-send-other-window (to cc subject) 658(defun mh-send-other-window (to cc subject)
643 "Compose a message in another window. 659 "Compose a message in another window.
644 660
645See `mh-send' for more information and a description of how the TO, CC, and 661See `mh-send' for more information and a description of how the
646SUBJECT arguments are used." 662TO, CC, and SUBJECT arguments are used."
647 (interactive (list 663 (interactive (list
648 (mh-interactive-read-address "To: ") 664 (mh-interactive-read-address "To: ")
649 (mh-interactive-read-address "Cc: ") 665 (mh-interactive-read-address "Cc: ")
@@ -693,14 +709,16 @@ CONFIG is the window configuration before sending mail."
693 709
694(defun mh-read-draft (use initial-contents delete-contents-file) 710(defun mh-read-draft (use initial-contents delete-contents-file)
695 "Read draft file into a draft buffer and make that buffer the current one. 711 "Read draft file into a draft buffer and make that buffer the current one.
696USE is a message used for prompting about the intended use of the message. 712
713USE is a message used for prompting about the intended use of the
714message.
697INITIAL-CONTENTS is filename that is read into an empty buffer, or nil 715INITIAL-CONTENTS is filename that is read into an empty buffer, or nil
698if buffer should not be modified. Delete the initial-contents file if 716if buffer should not be modified. Delete the initial-contents file if
699DELETE-CONTENTS-FILE flag is set. 717DELETE-CONTENTS-FILE flag is set.
700Returns the draft folder's name. 718Returns the draft folder's name.
701If the draft folder facility is enabled in ~/.mh_profile, a new buffer is 719If the draft folder facility is enabled in ~/.mh_profile, a new buffer
702used each time and saved in the draft folder. The draft file can then be 720is used each time and saved in the draft folder. The draft file can
703reused." 721then be reused."
704 (cond (mh-draft-folder 722 (cond (mh-draft-folder
705 (let ((orig-default-dir default-directory) 723 (let ((orig-default-dir default-directory)
706 (draft-file-name (mh-new-draft-name))) 724 (draft-file-name (mh-new-draft-name)))
@@ -748,7 +766,8 @@ reused."
748 766
749(defun mh-annotate-msg (msg buffer note &rest args) 767(defun mh-annotate-msg (msg buffer note &rest args)
750 "Mark MSG in BUFFER with character NOTE and annotate message with ARGS. 768 "Mark MSG in BUFFER with character NOTE and annotate message with ARGS.
751MSG can be a message number, a list of message numbers, or a sequence." 769MSG can be a message number, a list of message numbers, or a
770sequence."
752 (apply 'mh-exec-cmd "anno" buffer 771 (apply 'mh-exec-cmd "anno" buffer
753 (if (listp msg) (append msg args) (cons msg args))) 772 (if (listp msg) (append msg args) (cons msg args)))
754 (save-excursion 773 (save-excursion
@@ -780,7 +799,8 @@ Do not insert any pairs whose value is the empty string."
780 "Move to the end of the FIELD in the header. 799 "Move to the end of the FIELD in the header.
781Move to end of entire header if FIELD not found. 800Move to end of entire header if FIELD not found.
782Returns non-nil iff FIELD was found. 801Returns non-nil iff FIELD was found.
783The optional second arg is for pre-version 4 compatibility and is IGNORED." 802The optional second arg is for pre-version 4 compatibility and is
803IGNORED."
784 (cond ((mh-goto-header-field field) 804 (cond ((mh-goto-header-field field)
785 (mh-header-field-end) 805 (mh-header-field-end)
786 t) 806 t)
@@ -907,20 +927,21 @@ Returns t if found, nil if not."
907 "\t\t Signature: \\[mh-insert-signature]")) 927 "\t\t Signature: \\[mh-insert-signature]"))
908 "Key binding cheat sheet. 928 "Key binding cheat sheet.
909 929
910This is an associative array which is used to show the most common commands. 930This is an associative array which is used to show the most
911The key is a prefix char. The value is one or more strings which are 931common commands. The key is a prefix char. The value is one or
912concatenated together and displayed in the minibuffer if ? is pressed after 932more strings which are concatenated together and displayed in the
913the prefix character. The special key nil is used to display the 933minibuffer if ? is pressed after the prefix character. The
914non-prefixed commands. 934special key nil is used to display the non-prefixed commands.
915 935
916The substitutions described in `substitute-command-keys' are performed as 936The substitutions described in `substitute-command-keys' are
917well.") 937performed as well.")
918 938
919;;;###mh-autoload 939;;;###mh-autoload
920(defun mh-fill-paragraph-function (arg) 940(defun mh-fill-paragraph-function (arg)
921 "Fill paragraph at or after point. 941 "Fill paragraph at or after point.
922Prefix ARG means justify as well. This function enables `fill-paragraph' to 942Prefix ARG means justify as well. This function enables
923work better in MH-Letter mode (see `mh-letter-mode')." 943`fill-paragraph' to work better in MH-Letter mode (see
944`mh-letter-mode')."
924 (interactive "P") 945 (interactive "P")
925 (let ((fill-paragraph-function) (fill-prefix)) 946 (let ((fill-paragraph-function) (fill-prefix))
926 (if (mh-in-header-p) 947 (if (mh-in-header-p)
@@ -938,14 +959,14 @@ work better in MH-Letter mode (see `mh-letter-mode')."
938(define-derived-mode mh-letter-mode text-mode "MH-Letter" 959(define-derived-mode mh-letter-mode text-mode "MH-Letter"
939 "Mode for composing letters in MH-E\\<mh-letter-mode-map>. 960 "Mode for composing letters in MH-E\\<mh-letter-mode-map>.
940 961
941When you have finished composing, type \\[mh-send-letter] to send the 962When you have finished composing, type \\[mh-send-letter] to send
942message using the MH mail handling system. 963the message using the MH mail handling system.
943 964
944There are two types of tags used by MH-E when composing MIME messages: 965There are two types of tags used by MH-E when composing MIME
945MML and MH. The option `mh-compose-insertion' controls what type of 966messages: MML and MH. The option `mh-compose-insertion' controls
946tags are inserted by MH-E commands. These tags can be converted to 967what type of tags are inserted by MH-E commands. These tags can
947MIME body parts by running \\[mh-mh-to-mime] for MH-style directives 968be converted to MIME body parts by running \\[mh-mh-to-mime] for
948or \\[mh-mml-to-mime] for MML tags. 969MH-style directives or \\[mh-mml-to-mime] for MML tags.
949 970
950Options that control this mode can be changed with 971Options that control this mode can be changed with
951\\[customize-group]; specify the \"mh-compose\" group. 972\\[customize-group]; specify the \"mh-compose\" group.
@@ -1054,8 +1075,8 @@ When a message is composed, the hooks `text-mode-hook' and
1054 1075
1055(defun mh-letter-header-end () 1076(defun mh-letter-header-end ()
1056 "Find the end of the message header. 1077 "Find the end of the message header.
1057This function is to be used only for font locking. It works by searching for 1078This function is to be used only for font locking. It works by
1058`mh-mail-header-separator' in the buffer." 1079searching for `mh-mail-header-separator' in the buffer."
1059 (save-excursion 1080 (save-excursion
1060 (goto-char (point-min)) 1081 (goto-char (point-min))
1061 (cond ((equal mh-mail-header-separator "") (point-min)) 1082 (cond ((equal mh-mail-header-separator "") (point-min))
@@ -1065,7 +1086,8 @@ This function is to be used only for font locking. It works by searching for
1065 1086
1066(defun mh-auto-fill-for-letter () 1087(defun mh-auto-fill-for-letter ()
1067 "Perform auto-fill for message. 1088 "Perform auto-fill for message.
1068Header is treated specially by inserting a tab before continuation lines." 1089Header is treated specially by inserting a tab before continuation
1090lines."
1069 (if (mh-in-header-p) 1091 (if (mh-in-header-p)
1070 (let ((fill-prefix "\t")) 1092 (let ((fill-prefix "\t"))
1071 (do-auto-fill)) 1093 (do-auto-fill))
@@ -1083,8 +1105,9 @@ Header is treated specially by inserting a tab before continuation lines."
1083(defun mh-to-field () 1105(defun mh-to-field ()
1084 "Move to specified header field. 1106 "Move to specified header field.
1085The field is indicated by the previous keystroke (the last keystroke 1107The field is indicated by the previous keystroke (the last keystroke
1086of the command) according to the list in the variable `mh-to-field-choices'. 1108of the command) according to the list in the variable
1087Create the field if it does not exist. Set the mark to point before moving." 1109`mh-to-field-choices'. Create the field if it does not exist. Set the
1110mark to point before moving."
1088 (interactive) 1111 (interactive)
1089 (expand-abbrev) 1112 (expand-abbrev)
1090 (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`)) 1113 (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`))
@@ -1113,8 +1136,8 @@ Create the field if it does not exist. Set the mark to point before moving."
1113;;;###mh-autoload 1136;;;###mh-autoload
1114(defun mh-to-fcc (&optional folder) 1137(defun mh-to-fcc (&optional folder)
1115 "Move to \"Fcc:\" header field. 1138 "Move to \"Fcc:\" header field.
1116This command will prompt you for the FOLDER name in which to file a copy of 1139This command will prompt you for the FOLDER name in which to file a
1117the draft." 1140copy of the draft."
1118 (interactive) 1141 (interactive)
1119 (or folder 1142 (or folder
1120 (setq folder (mh-prompt-for-folder 1143 (setq folder (mh-prompt-for-folder
@@ -1215,9 +1238,10 @@ In a program, you can pass in a signature FILE."
1215;;;###mh-autoload 1238;;;###mh-autoload
1216(defun mh-check-whom () 1239(defun mh-check-whom ()
1217 "Verify recipients, showing expansion of any aliases. 1240 "Verify recipients, showing expansion of any aliases.
1218This command expands aliases so you can check the actual address(es) in the 1241
1219alias. A new buffer named \"*MH-E Recipients*\" is created with the output of 1242This command expands aliases so you can check the actual address(es)
1220\"whom\"." 1243in the alias. A new buffer named \"*MH-E Recipients*\" is created with
1244the output of \"whom\"."
1221 (interactive) 1245 (interactive)
1222 (let ((file-name buffer-file-name)) 1246 (let ((file-name buffer-file-name))
1223 (save-buffer) 1247 (save-buffer)
@@ -1256,8 +1280,8 @@ If the field already exists, this function does nothing."
1256 1280
1257(defvar mh-x-mailer-string nil 1281(defvar mh-x-mailer-string nil
1258 "*String containing the contents of the X-Mailer header field. 1282 "*String containing the contents of the X-Mailer header field.
1259If nil, this variable is initialized to show the version of MH-E, Emacs, and 1283If nil, this variable is initialized to show the version of MH-E,
1260MH the first time a message is composed.") 1284Emacs, and MH the first time a message is composed.")
1261 1285
1262(defun mh-insert-x-mailer () 1286(defun mh-insert-x-mailer ()
1263 "Append an X-Mailer field to the header. 1287 "Append an X-Mailer field to the header.
@@ -1298,11 +1322,14 @@ The versions of MH-E, Emacs, and MH are shown."
1298;;;###mh-autoload 1322;;;###mh-autoload
1299(defun mh-insert-auto-fields (&optional non-interactive) 1323(defun mh-insert-auto-fields (&optional non-interactive)
1300 "Insert custom fields if recipient is found in `mh-auto-fields-list'. 1324 "Insert custom fields if recipient is found in `mh-auto-fields-list'.
1301Sets buffer-local `mh-insert-auto-fields-done-local' when done and inserted
1302something. If NON-INTERACTIVE is non-nil, do not be verbose and only
1303attempt matches if `mh-insert-auto-fields-done-local' is nil.
1304 1325
1305An `identity' entry is skipped if one was already entered manually. 1326Sets buffer-local `mh-insert-auto-fields-done-local' when done
1327and inserted something. If NON-INTERACTIVE is non-nil, do not be
1328verbose and only attempt matches if
1329`mh-insert-auto-fields-done-local' is nil.
1330
1331An `identity' entry is skipped if one was already entered
1332manually.
1306 1333
1307Return t if fields added; otherwise return nil." 1334Return t if fields added; otherwise return nil."
1308 (interactive) 1335 (interactive)
@@ -1343,7 +1370,8 @@ Return t if fields added; otherwise return nil."
1343 1370
1344(defun mh-modify-header-field (field value &optional overwrite-flag) 1371(defun mh-modify-header-field (field value &optional overwrite-flag)
1345 "To header FIELD add VALUE. 1372 "To header FIELD add VALUE.
1346If OVERWRITE-FLAG is non-nil then the old value, if present, is discarded." 1373If OVERWRITE-FLAG is non-nil then the old value, if present, is
1374discarded."
1347 (cond ((and overwrite-flag 1375 (cond ((and overwrite-flag
1348 (mh-goto-header-field (concat field ":"))) 1376 (mh-goto-header-field (concat field ":")))
1349 (insert " " value) 1377 (insert " " value)
@@ -1366,15 +1394,16 @@ If OVERWRITE-FLAG is non-nil then the old value, if present, is discarded."
1366 config) 1394 config)
1367 "Edit and compose a draft message in buffer DRAFT and send or save it. 1395 "Edit and compose a draft message in buffer DRAFT and send or save it.
1368SEND-ARGS is the argument passed to the send command. 1396SEND-ARGS is the argument passed to the send command.
1369SENT-FROM-FOLDER is buffer containing scan listing of current folder, or 1397SENT-FROM-FOLDER is buffer containing scan listing of current folder,
1370nil if none exists. 1398or nil if none exists.
1371SENT-FROM-MSG is the message number or sequence name or nil. 1399SENT-FROM-MSG is the message number or sequence name or nil.
1372The TO, SUBJECT, and CC fields are passed to the 1400The TO, SUBJECT, and CC fields are passed to the
1373`mh-compose-letter-function'. 1401`mh-compose-letter-function'.
1374If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of the 1402If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of
1375message. In that case, the ANNOTATE-FIELD is used to build a string 1403the message. In that case, the ANNOTATE-FIELD is used to build a
1376for `mh-annotate-msg'. 1404string for `mh-annotate-msg'.
1377CONFIG is the window configuration to restore after sending the letter." 1405CONFIG is the window configuration to restore after sending the
1406letter."
1378 (pop-to-buffer draft) 1407 (pop-to-buffer draft)
1379 (mh-letter-mode) 1408 (mh-letter-mode)
1380 1409
@@ -1421,8 +1450,8 @@ This should be the last function called when composing the draft."
1421 1450
1422(defun mh-ascii-buffer-p () 1451(defun mh-ascii-buffer-p ()
1423 "Check if current buffer is entirely composed of ASCII. 1452 "Check if current buffer is entirely composed of ASCII.
1424The function doesn't work for XEmacs since `find-charset-region' doesn't exist 1453The function doesn't work for XEmacs since `find-charset-region'
1425there." 1454doesn't exist there."
1426 (loop for charset in (mh-funcall-if-exists 1455 (loop for charset in (mh-funcall-if-exists
1427 find-charset-region (point-min) (point-max)) 1456 find-charset-region (point-min) (point-max))
1428 unless (eq charset 'ascii) return nil 1457 unless (eq charset 'ascii) return nil
@@ -1509,15 +1538,17 @@ use `mh-send-prog' to tell MH-E the name."
1509;;;###mh-autoload 1538;;;###mh-autoload
1510(defun mh-insert-letter (folder message verbatim) 1539(defun mh-insert-letter (folder message verbatim)
1511 "Insert a message. 1540 "Insert a message.
1512This command prompts you for the FOLDER and MESSAGE number and inserts the 1541
1513message, indented by `mh-ins-buf-prefix' (\"> \") unless `mh-yank-behavior' is 1542This command prompts you for the FOLDER and MESSAGE number and inserts
1514set to one of the supercite flavors in which case supercite is used to format 1543the message, indented by `mh-ins-buf-prefix' (\"> \") unless
1515the message. Certain undesirable header fields (see 1544`mh-yank-behavior' is set to one of the supercite flavors in which
1516`mh-invisible-header-fields-compiled') are removed before insertion. 1545case supercite is used to format the message. Certain undesirable
1517 1546header fields (see `mh-invisible-header-fields-compiled') are removed
1518If given a prefix argument VERBATIM, the header is left intact, the message is 1547before insertion.
1519not indented, and \"> \" is not inserted before each line. This command leaves 1548
1520the mark before the letter and point after it." 1549If given a prefix argument VERBATIM, the header is left intact, the
1550message is not indented, and \"> \" is not inserted before each line.
1551This command leaves the mark before the letter and point after it."
1521 (interactive 1552 (interactive
1522 (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) 1553 (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
1523 (read-string (concat "Message number" 1554 (read-string (concat "Message number"
@@ -1559,31 +1590,34 @@ the mark before the letter and point after it."
1559(defun mh-yank-cur-msg () 1590(defun mh-yank-cur-msg ()
1560 "Insert the current message into the draft buffer. 1591 "Insert the current message into the draft buffer.
1561 1592
1562It is often useful to insert a snippet of text from a letter that someone 1593It is often useful to insert a snippet of text from a letter that
1563mailed to provide some context for your reply. This command does this by 1594someone mailed to provide some context for your reply. This
1564adding an attribution, yanking a portion of text from the message to which 1595command does this by adding an attribution, yanking a portion of
1565you're replying, and inserting `mh-ins-buf-prefix' (`> ') before each line. 1596text from the message to which you're replying, and inserting
1597`mh-ins-buf-prefix' (`> ') before each line.
1566 1598
1567The attribution consists of the sender's name and email address 1599The attribution consists of the sender's name and email address
1568followed by the content of the `mh-extract-from-attribution-verb' 1600followed by the content of the `mh-extract-from-attribution-verb'
1569option. 1601option.
1570 1602
1571You can also turn on the `mh-delete-yanked-msg-window-flag' option to delete 1603You can also turn on the `mh-delete-yanked-msg-window-flag'
1572the window containing the original message after yanking it to make more room 1604option to delete the window containing the original message after
1573on your screen for your reply. 1605yanking it to make more room on your screen for your reply.
1574 1606
1575You can control how the message to which you are replying is yanked 1607You can control how the message to which you are replying is
1576into your reply using `mh-yank-behavior'. 1608yanked into your reply using `mh-yank-behavior'.
1577 1609
1578If this isn't enough, you can gain full control over the appearance of the 1610If this isn't enough, you can gain full control over the
1579included text by setting `mail-citation-hook' to a function that modifies it. 1611appearance of the included text by setting `mail-citation-hook'
1580For example, if you set this hook to `trivial-cite' (which is NOT part of 1612to a function that modifies it. For example, if you set this hook
1581Emacs), set `mh-yank-behavior' to \"Body and Header\" (see URL 1613to `trivial-cite' \(which is NOT part of Emacs), set
1614`mh-yank-behavior' to \"Body and Header\" (see URL
1582`http://shasta.cs.uiuc.edu/~lrclause/tc.html'). 1615`http://shasta.cs.uiuc.edu/~lrclause/tc.html').
1583 1616
1584Note that if `mail-citation-hook' is set, `mh-ins-buf-prefix' is not inserted. 1617Note that if `mail-citation-hook' is set, `mh-ins-buf-prefix' is
1585If the option `mh-yank-behavior' is set to one of the supercite flavors, the 1618not inserted. If the option `mh-yank-behavior' is set to one of
1586hook `mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not inserted." 1619the supercite flavors, the hook `mail-citation-hook' is ignored
1620and `mh-ins-buf-prefix' is not inserted."
1587 (interactive) 1621 (interactive)
1588 (if (and mh-sent-from-folder 1622 (if (and mh-sent-from-folder
1589 (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer) 1623 (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer)
@@ -1676,9 +1710,9 @@ hook `mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not inserted."
1676 1710
1677(defun mh-insert-prefix-string (mh-ins-string) 1711(defun mh-insert-prefix-string (mh-ins-string)
1678 "Insert prefix string before each line in buffer. 1712 "Insert prefix string before each line in buffer.
1679The inserted letter is cited using `sc-cite-original' if `mh-yank-behavior' is 1713The inserted letter is cited using `sc-cite-original' if
1680one of 'supercite or 'autosupercite. Otherwise, simply insert MH-INS-STRING 1714`mh-yank-behavior' is one of 'supercite or 'autosupercite.
1681before each line." 1715Otherwise, simply insert MH-INS-STRING before each line."
1682 (goto-char (point-min)) 1716 (goto-char (point-min))
1683 (cond ((or (eq mh-yank-behavior 'supercite) 1717 (cond ((or (eq mh-yank-behavior 'supercite)
1684 (eq mh-yank-behavior 'autosupercite)) 1718 (eq mh-yank-behavior 'autosupercite))
@@ -1697,9 +1731,10 @@ before each line."
1697;;;###mh-autoload 1731;;;###mh-autoload
1698(defun mh-fully-kill-draft () 1732(defun mh-fully-kill-draft ()
1699 "Quit editing and delete draft message. 1733 "Quit editing and delete draft message.
1700If for some reason you are not happy with the draft, you can use the this 1734If for some reason you are not happy with the draft, you can use
1701command to kill the draft buffer and delete the draft message. Use the 1735the this command to kill the draft buffer and delete the draft
1702\\[kill-buffer] command if you don't want to delete the draft message." 1736message. Use the \\[kill-buffer] command if you don't want to
1737delete the draft message."
1703 (interactive) 1738 (interactive)
1704 (if (y-or-n-p "Kill draft message? ") 1739 (if (y-or-n-p "Kill draft message? ")
1705 (let ((config mh-previous-window-config)) 1740 (let ((config mh-previous-window-config))
@@ -1727,10 +1762,12 @@ command to kill the draft buffer and delete the draft message. Use the
1727;;;###mh-autoload 1762;;;###mh-autoload
1728(defun mh-open-line () 1763(defun mh-open-line ()
1729 "Insert a newline and leave point after it. 1764 "Insert a newline and leave point after it.
1730This command is similar to the \\[open-line] command in that it inserts a 1765
1731newline after point. It differs in that it also inserts the right number of 1766This command is similar to the \\[open-line] command in that it
1732quoting characters and spaces so that the next line begins in the same column 1767inserts a newline after point. It differs in that it also inserts
1733as it was. This is useful when breaking up paragraphs in replies." 1768the right number of quoting characters and spaces so that the
1769next line begins in the same column as it was. This is useful
1770when breaking up paragraphs in replies."
1734 (interactive) 1771 (interactive)
1735 (let ((column (current-column)) 1772 (let ((column (current-column))
1736 (prefix (mh-current-fill-prefix))) 1773 (prefix (mh-current-fill-prefix)))
@@ -1747,9 +1784,9 @@ as it was. This is useful when breaking up paragraphs in replies."
1747(defmacro mh-display-completion-list-compat (word choices) 1784(defmacro mh-display-completion-list-compat (word choices)
1748 "Completes WORD from CHOICES using `display-completion-list'. 1785 "Completes WORD from CHOICES using `display-completion-list'.
1749Calls `display-completion-list' correctly in older environments. 1786Calls `display-completion-list' correctly in older environments.
1750Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING argument 1787Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING
1751which is used to highlight the next possible character you can enter 1788argument which is used to highlight the next possible character you
1752in the current list of completions." 1789can enter in the current list of completions."
1753 (if (>= emacs-major-version 22) 1790 (if (>= emacs-major-version 22)
1754 `(display-completion-list (all-completions ,word ,choices) ,word) 1791 `(display-completion-list (all-completions ,word ,choices) ,word)
1755 `(display-completion-list (all-completions ,word ,choices)))) 1792 `(display-completion-list (all-completions ,word ,choices))))
@@ -1818,11 +1855,12 @@ Any match found replaces the text from BEGIN to END."
1818 1855
1819(defun mh-letter-complete (arg) 1856(defun mh-letter-complete (arg)
1820 "Perform completion on header field or word preceding point. 1857 "Perform completion on header field or word preceding point.
1821If the field contains addresses (for example, \"To:\" or \"Cc:\") or folders 1858If the field contains addresses (for example, \"To:\" or \"Cc:\")
1822\(for example, \"Fcc:\") then this command will provide alias completion. In 1859or folders \(for example, \"Fcc:\") then this command will
1823the body of the message, this command runs `mh-letter-complete-function' 1860provide alias completion. In the body of the message, this
1824instead, which is set to \"'ispell-complete-word\" by default. This command 1861command runs `mh-letter-complete-function' instead, which is set
1825takes a prefix argument ARG that is passed to the 1862to \"'ispell-complete-word\" by default. This command takes a
1863prefix argument ARG that is passed to the
1826`mh-letter-complete-function'." 1864`mh-letter-complete-function'."
1827 (interactive "P") 1865 (interactive "P")
1828 (let ((func nil)) 1866 (let ((func nil))
@@ -1835,8 +1873,9 @@ takes a prefix argument ARG that is passed to the
1835 1873
1836(defun mh-letter-complete-or-space (arg) 1874(defun mh-letter-complete-or-space (arg)
1837 "Perform completion or insert space. 1875 "Perform completion or insert space.
1838Turn on the `mh-compose-space-does-completion-flag' option to use this command 1876Turn on the `mh-compose-space-does-completion-flag' option to use
1839to perform completion in the header. Otherwise, a space is inserted. 1877this command to perform completion in the header. Otherwise, a
1878space is inserted.
1840 1879
1841ARG is the number of spaces inserted." 1880ARG is the number of spaces inserted."
1842 (interactive "p") 1881 (interactive "p")
@@ -1855,9 +1894,9 @@ ARG is the number of spaces inserted."
1855 1894
1856(defun mh-letter-confirm-address () 1895(defun mh-letter-confirm-address ()
1857 "Flash alias expansion. 1896 "Flash alias expansion.
1858Addresses are separated by a comma\; and when you press the comma, this 1897Addresses are separated by a comma\; and when you press the
1859command flashes the alias expansion in the minibuffer if 1898comma, this command flashes the alias expansion in the minibuffer
1860`mh-alias-flash-on-comma' is turned on." 1899if `mh-alias-flash-on-comma' is turned on."
1861 (interactive) 1900 (interactive)
1862 (cond ((not (mh-in-header-p)) (self-insert-command 1)) 1901 (cond ((not (mh-in-header-p)) (self-insert-command 1))
1863 ((eq (cdr (assoc (mh-letter-header-field-at-point) 1902 ((eq (cdr (assoc (mh-letter-header-field-at-point)
@@ -1871,8 +1910,8 @@ command flashes the alias expansion in the minibuffer if
1871 1910
1872(defun mh-letter-header-field-at-point () 1911(defun mh-letter-header-field-at-point ()
1873 "Return the header field name at point. 1912 "Return the header field name at point.
1874A symbol is returned whose name is the string obtained by downcasing the field 1913A symbol is returned whose name is the string obtained by
1875name." 1914downcasing the field name."
1876 (save-excursion 1915 (save-excursion
1877 (end-of-line) 1916 (end-of-line)
1878 (and (re-search-backward mh-letter-header-field-regexp nil t) 1917 (and (re-search-backward mh-letter-header-field-regexp nil t)
@@ -1881,12 +1920,13 @@ name."
1881;;;###mh-autoload 1920;;;###mh-autoload
1882(defun mh-letter-next-header-field-or-indent (arg) 1921(defun mh-letter-next-header-field-or-indent (arg)
1883 "Move to next field or indent depending on point. 1922 "Move to next field or indent depending on point.
1884Within the header of the message, this command moves between fields, but skips 1923Within the header of the message, this command moves between
1885those fields listed in `mh-compose-skipped-header-fields'. After the last 1924fields, but skips those fields listed in
1886field, this command then moves point to the message body before cycling back 1925`mh-compose-skipped-header-fields'. After the last field, this
1887to the first field. If point is already past the first line of the message 1926command then moves point to the message body before cycling back
1888body, then this command indents by calling `indent-relative' with the given 1927to the first field. If point is already past the first line of
1889prefix argument ARG." 1928the message body, then this command indents by calling
1929`indent-relative' with the given prefix argument ARG."
1890 (interactive "P") 1930 (interactive "P")
1891 (let ((header-end (save-excursion 1931 (let ((header-end (save-excursion
1892 (goto-char (mh-mail-header-end)) 1932 (goto-char (mh-mail-header-end))
@@ -1898,7 +1938,8 @@ prefix argument ARG."
1898 1938
1899(defun mh-letter-next-header-field () 1939(defun mh-letter-next-header-field ()
1900 "Cycle to the next header field. 1940 "Cycle to the next header field.
1901If we are at the last header field go to the start of the message body." 1941If we are at the last header field go to the start of the message
1942body."
1902 (let ((header-end (mh-mail-header-end))) 1943 (let ((header-end (mh-mail-header-end)))
1903 (cond ((>= (point) header-end) (goto-char (point-min))) 1944 (cond ((>= (point) header-end) (goto-char (point-min)))
1904 ((< (point) (progn 1945 ((< (point) (progn
@@ -1918,10 +1959,10 @@ If we are at the last header field go to the start of the message body."
1918;;;###mh-autoload 1959;;;###mh-autoload
1919(defun mh-letter-previous-header-field () 1960(defun mh-letter-previous-header-field ()
1920 "Cycle to the previous header field. 1961 "Cycle to the previous header field.
1921This command moves backwards between the fields and cycles to the body of the 1962This command moves backwards between the fields and cycles to the
1922message after the first field. Unlike the 1963body of the message after the first field. Unlike the
1923\\[mh-letter-next-header-field-or-indent] command, it will always take point 1964\\[mh-letter-next-header-field-or-indent] command, it will always
1924to the last field from anywhere in the body." 1965take point to the last field from anywhere in the body."
1925 (interactive) 1966 (interactive)
1926 (let ((header-end (mh-mail-header-end))) 1967 (let ((header-end (mh-mail-header-end)))
1927 (if (>= (point) header-end) 1968 (if (>= (point) header-end)
@@ -1944,8 +1985,8 @@ to the last field from anywhere in the body."
1944 1985
1945(defun mh-letter-skip-leading-whitespace-in-header-field () 1986(defun mh-letter-skip-leading-whitespace-in-header-field ()
1946 "Skip leading whitespace in a header field. 1987 "Skip leading whitespace in a header field.
1947If the header field doesn't have at least one space after the colon then a 1988If the header field doesn't have at least one space after the
1948space character is added." 1989colon then a space character is added."
1949 (let ((need-space t)) 1990 (let ((need-space t))
1950 (while (memq (char-after) '(?\t ?\ )) 1991 (while (memq (char-after) '(?\t ?\ ))
1951 (forward-char) 1992 (forward-char)
@@ -1963,8 +2004,9 @@ space character is added."
1963 2004
1964(defun mh-letter-toggle-header-field-display-button (event) 2005(defun mh-letter-toggle-header-field-display-button (event)
1965 "Toggle header field display at location of EVENT. 2006 "Toggle header field display at location of EVENT.
1966This function does the same thing as `mh-letter-toggle-header-field-display' 2007This function does the same thing as
1967except that it is callable from a mouse button." 2008`mh-letter-toggle-header-field-display' except that it is
2009callable from a mouse button."
1968 (interactive "e") 2010 (interactive "e")
1969 (mh-do-at-event-location event 2011 (mh-do-at-event-location event
1970 (mh-letter-toggle-header-field-display nil))) 2012 (mh-letter-toggle-header-field-display nil)))
@@ -1972,10 +2014,10 @@ except that it is callable from a mouse button."
1972(defun mh-letter-toggle-header-field-display (arg) 2014(defun mh-letter-toggle-header-field-display (arg)
1973 "Toggle display of header field at point. 2015 "Toggle display of header field at point.
1974 2016
1975Use this command to display truncated header fields. This command is a toggle 2017Use this command to display truncated header fields. This command
1976so entering it again will hide the field. This command takes a prefix argument 2018is a toggle so entering it again will hide the field. This
1977ARG: if negative then the field is hidden, if positive then the field is 2019command takes a prefix argument ARG: if negative then the field
1978displayed." 2020is hidden, if positive then the field is displayed."
1979 (interactive (list nil)) 2021 (interactive (list nil))
1980 (when (and (mh-in-header-p) 2022 (when (and (mh-in-header-p)
1981 (progn 2023 (progn
@@ -2035,13 +2077,15 @@ If the current line is too long truncate a part of it as well."
2035 2077
2036(defun mh-interactive-read-address (prompt) 2078(defun mh-interactive-read-address (prompt)
2037 "Read an address. 2079 "Read an address.
2038If `mh-compose-prompt-flag' is non-nil, then read an address with PROMPT. 2080If `mh-compose-prompt-flag' is non-nil, then read an address with
2081PROMPT.
2039Otherwise return the empty string." 2082Otherwise return the empty string."
2040 (if mh-compose-prompt-flag (mh-read-address prompt) "")) 2083 (if mh-compose-prompt-flag (mh-read-address prompt) ""))
2041 2084
2042(defun mh-interactive-read-string (prompt) 2085(defun mh-interactive-read-string (prompt)
2043 "Read a string. 2086 "Read a string.
2044If `mh-compose-prompt-flag' is non-nil, then read a string with PROMPT. 2087If `mh-compose-prompt-flag' is non-nil, then read a string with
2088PROMPT.
2045Otherwise return the empty string." 2089Otherwise return the empty string."
2046 (if mh-compose-prompt-flag (read-string prompt) "")) 2090 (if mh-compose-prompt-flag (read-string prompt) ""))
2047 2091
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 779a25cf03c..c45004805c3 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -90,8 +90,8 @@
90 90
91(defun mh-customize (&optional delete-other-windows-flag) 91(defun mh-customize (&optional delete-other-windows-flag)
92 "Customize MH-E variables. 92 "Customize MH-E variables.
93If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in 93If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other
94the frame are removed." 94windows in the frame are removed."
95 (interactive "P") 95 (interactive "P")
96 (customize-group 'mh-e) 96 (customize-group 'mh-e)
97 (when delete-other-windows-flag 97 (when delete-other-windows-flag
@@ -103,8 +103,8 @@ the frame are removed."
103 103
104(defgroup mh-e nil 104(defgroup mh-e nil
105 "Emacs interface to the MH mail system. 105 "Emacs interface to the MH mail system.
106MH is the Rand Mail Handler. Other implementations include nmh and GNU 106MH is the Rand Mail Handler. Other implementations include nmh
107mailutils." 107and GNU mailutils."
108 :link '(custom-manual "(mh-e)Top") 108 :link '(custom-manual "(mh-e)Top")
109 :group 'mail) 109 :group 'mail)
110 110
@@ -271,12 +271,14 @@ See `mh-variant'."
271(defcustom mh-variant 'autodetect 271(defcustom mh-variant 'autodetect
272 "*Specifies the variant used by MH-E. 272 "*Specifies the variant used by MH-E.
273 273
274The default setting of this option is `Auto-detect' which means that MH-E will 274The default setting of this option is `Auto-detect' which means
275automatically choose the first of nmh, MH, or GNU mailutils that it finds in 275that MH-E will automatically choose the first of nmh, MH, or GNU
276the directories listed in `mh-path' (which you can customize), `mh-sys-path', 276mailutils that it finds in the directories listed in
277and `exec-path'. If, for example, you have both nmh and mailutils installed 277`mh-path' (which you can customize), `mh-sys-path', and
278and `mh-variant-in-use' was initialized to nmh but you want to use mailutils, 278`exec-path'. If, for example, you have both nmh and mailutils
279then you can set this option to `mailutils'. 279installed and `mh-variant-in-use' was initialized to nmh but you
280want to use mailutils, then you can set this option to
281`mailutils'.
280 282
281When this variable is changed, MH-E resets `mh-progs', `mh-lib', 283When this variable is changed, MH-E resets `mh-progs', `mh-lib',
282`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' 284`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
@@ -295,26 +297,30 @@ accordingly."
295 297
296(defcustom mh-alias-completion-ignore-case-flag t 298(defcustom mh-alias-completion-ignore-case-flag t
297 "*Non-nil means don't consider case significant in MH alias completion. 299 "*Non-nil means don't consider case significant in MH alias completion.
298As MH ignores case in the aliases, so too does MH-E. However, you may turn 300
299this option off to make case significant which can be used to segregate 301As MH ignores case in the aliases, so too does MH-E. However, you
300completion of your aliases. You might use lowercase for mailing lists and 302may turn this option off to make case significant which can be
301uppercase for people." 303used to segregate completion of your aliases. You might use
304lowercase for mailing lists and uppercase for people."
302 :type 'boolean 305 :type 'boolean
303 :group 'mh-alias) 306 :group 'mh-alias)
304 307
305(defcustom mh-alias-expand-aliases-flag nil 308(defcustom mh-alias-expand-aliases-flag nil
306 "*Non-nil means to expand aliases entered in the minibuffer. 309 "*Non-nil means to expand aliases entered in the minibuffer.
307In other words, aliases entered in the minibuffer will be expanded to the full 310
308address in the message draft. By default, this expansion is not performed." 311In other words, aliases entered in the minibuffer will be
312expanded to the full address in the message draft. By default,
313this expansion is not performed."
309 :type 'boolean 314 :type 'boolean
310 :group 'mh-alias) 315 :group 'mh-alias)
311 316
312(defcustom mh-alias-flash-on-comma t 317(defcustom mh-alias-flash-on-comma t
313 "*Specify whether to flash address or warn on translation. 318 "*Specify whether to flash address or warn on translation.
314This option controls the behavior when a [comma] is pressed while entering 319
315aliases or addresses. The default setting flashes the address associated with 320This option controls the behavior when a [comma] is pressed while
316an address in the minibuffer briefly, but does not display a warning if the 321entering aliases or addresses. The default setting flashes the
317alias is not found." 322address associated with an address in the minibuffer briefly, but
323does not display a warning if the alias is not found."
318 :type '(choice (const :tag "Flash but Don't Warn If No Alias" t) 324 :type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
319 (const :tag "Flash and Warn If No Alias" 1) 325 (const :tag "Flash and Warn If No Alias" 1)
320 (const :tag "Don't Flash Nor Warn If No Alias" nil)) 326 (const :tag "Don't Flash Nor Warn If No Alias" nil))
@@ -322,11 +328,12 @@ alias is not found."
322 328
323(defcustom mh-alias-insert-file nil 329(defcustom mh-alias-insert-file nil
324 "*Filename used to store a new MH-E alias. 330 "*Filename used to store a new MH-E alias.
325The default setting of this option is `Use Aliasfile Profile Component'. This 331
326option can also hold the name of a file or a list a file names. If this option 332The default setting of this option is `Use Aliasfile Profile
327is set to a list of file names, or the `Aliasfile:' profile component contains 333Component'. This option can also hold the name of a file or a
328more than one file name, MH-E will prompt for one of them when MH-E adds an 334list a file names. If this option is set to a list of file names,
329alias." 335or the `Aliasfile:' profile component contains more than one file
336name, MH-E will prompt for one of them when MH-E adds an alias."
330 :type '(choice (const :tag "Use Aliasfile Profile Component" nil) 337 :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
331 (file :tag "Alias File") 338 (file :tag "Alias File")
332 (repeat :tag "List of Alias Files" file)) 339 (repeat :tag "List of Alias Files" file))
@@ -334,9 +341,10 @@ alias."
334 341
335(defcustom mh-alias-insertion-location 'sorted 342(defcustom mh-alias-insertion-location 'sorted
336 "Specifies where new aliases are entered in alias files. 343 "Specifies where new aliases are entered in alias files.
337This option is set to `Alphabetical' by default. If you organize your alias 344
338file in other ways, then adding aliases to the `Top' or `Bottom' of your alias 345This option is set to `Alphabetical' by default. If you organize
339file might be more appropriate." 346your alias file in other ways, then adding aliases to the `Top'
347or `Bottom' of your alias file might be more appropriate."
340 :type '(choice (const :tag "Alphabetical" sorted) 348 :type '(choice (const :tag "Alphabetical" sorted)
341 (const :tag "Top" top) 349 (const :tag "Top" top)
342 (const :tag "Bottom" bottom)) 350 (const :tag "Bottom" bottom))
@@ -345,17 +353,20 @@ file might be more appropriate."
345(defcustom mh-alias-local-users t 353(defcustom mh-alias-local-users t
346 "*If on, local users are added to alias completion. 354 "*If on, local users are added to alias completion.
347 355
348Aliases are created from `/etc/passwd' entries with a user ID larger than 356Aliases are created from `/etc/passwd' entries with a user ID
349a magical number, typically 200. This can be a handy tool on a machine where 357larger than a magical number, typically 200. This can be a handy
350you and co-workers exchange messages. These aliases have the form 358tool on a machine where you and co-workers exchange messages.
351`local.first.last' if a real name is present in the password file. 359These aliases have the form `local.first.last' if a real name is
352Otherwise, the alias will have the form `local.login'. 360present in the password file. Otherwise, the alias will have the
361form `local.login'.
353 362
354If you're on a system with thousands of users you don't know, and the loading 363If you're on a system with thousands of users you don't know, and
355of local aliases slows MH-E down noticeably, then turn this option off. 364the loading of local aliases slows MH-E down noticeably, then
365turn this option off.
356 366
357This option also takes a string which is executed to generate the password 367This option also takes a string which is executed to generate the
358file. For example, use \"ypcat passwd\" to obtain the NIS password file." 368password file. For example, use \"ypcat passwd\" to obtain the
369NIS password file."
359 :type '(choice (boolean) (string)) 370 :type '(choice (boolean) (string))
360 :group 'mh-alias) 371 :group 'mh-alias)
361 372
@@ -367,24 +378,27 @@ For example, consider the following password file entry:
367 378
368 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh 379 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
369 380
370The following settings of this option will produce the associated aliases: 381The following settings of this option will produce the associated
382aliases:
371 383
372 \"local.\" local.peter.galbraith 384 \"local.\" local.peter.galbraith
373 \"\" peter.galbraith 385 \"\" peter.galbraith
374 Use Login psg 386 Use Login psg
375 387
376This option has no effect if variable `mh-alias-local-users' is turned off." 388This option has no effect if variable `mh-alias-local-users' is
389turned off."
377 :type '(choice (const :tag "Use Login" nil) 390 :type '(choice (const :tag "Use Login" nil)
378 (string)) 391 (string))
379 :group 'mh-alias) 392 :group 'mh-alias)
380 393
381(defcustom mh-alias-passwd-gecos-comma-separator-flag t 394(defcustom mh-alias-passwd-gecos-comma-separator-flag t
382 "*Non-nil means the gecos field in the password file uses a comma separator. 395 "*Non-nil means the gecos field in the password file uses a comma separator.
383In the example in `mh-alias-local-users-prefix', commas are used to separate 396
384different values within the so-called gecos field. This is a fairly common 397In the example in `mh-alias-local-users-prefix', commas are used
385usage. However, in the rare case that the gecos field in your password file is 398to separate different values within the so-called gecos field.
386not separated by commas and whose contents may contain commas, you can turn 399This is a fairly common usage. However, in the rare case that the
387this option off." 400gecos field in your password file is not separated by commas and
401whose contents may contain commas, you can turn this option off."
388 :type 'boolean 402 :type 'boolean
389 :group 'mh-alias) 403 :group 'mh-alias)
390 404
@@ -395,9 +409,10 @@ this option off."
395(defcustom mh-new-messages-folders t 409(defcustom mh-new-messages-folders t
396 "Folders searched for the \"unseen\" sequence. 410 "Folders searched for the \"unseen\" sequence.
397 411
398Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to 412Set this option to \"Inbox\" to search the \"+inbox\" folder or
399search all of the top level folders. Otherwise, list the folders that should 413\"All\" to search all of the top level folders. Otherwise, list
400be searched with the \"Choose Folders\" menu item. 414the folders that should be searched with the \"Choose Folders\"
415menu item.
401 416
402See also `mh-recursive-folders-flag'." 417See also `mh-recursive-folders-flag'."
403 :type '(choice (const :tag "Inbox" t) 418 :type '(choice (const :tag "Inbox" t)
@@ -408,9 +423,10 @@ See also `mh-recursive-folders-flag'."
408(defcustom mh-ticked-messages-folders t 423(defcustom mh-ticked-messages-folders t
409 "Folders searched for `mh-tick-seq'. 424 "Folders searched for `mh-tick-seq'.
410 425
411Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to 426Set this option to \"Inbox\" to search the \"+inbox\" folder or
412search all of the top level folders. Otherwise, list the folders that should 427\"All\" to search all of the top level folders. Otherwise, list
413be searched with the \"Choose Folders\" menu item. 428the folders that should be searched with the \"Choose Folders\"
429menu item.
414 430
415See also `mh-recursive-folders-flag'." 431See also `mh-recursive-folders-flag'."
416 :type '(choice (const :tag "Inbox" t) 432 :type '(choice (const :tag "Inbox" t)
@@ -420,17 +436,20 @@ See also `mh-recursive-folders-flag'."
420 436
421(defcustom mh-large-folder 200 437(defcustom mh-large-folder 200
422 "The number of messages that indicates a large folder. 438 "The number of messages that indicates a large folder.
423If a folder is deemed to be large, that is the number of messages in it exceed 439
424this value, then confirmation is needed when it is visited. Even when 440If a folder is deemed to be large, that is the number of messages
425`mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if 441in it exceed this value, then confirmation is needed when it is
426it is large. If set to nil all folders are treated as if they are small." 442visited. Even when `mh-show-threads-flag' is non-nil, the folder
443is not automatically threaded, if it is large. If set to nil all
444folders are treated as if they are small."
427 :type '(choice (const :tag "No Limit") integer) 445 :type '(choice (const :tag "No Limit") integer)
428 :group 'mh-folder) 446 :group 'mh-folder)
429 447
430(defcustom mh-recenter-summary-flag nil 448(defcustom mh-recenter-summary-flag nil
431 "*Non-nil means to recenter the summary window. 449 "*Non-nil means to recenter the summary window.
432If this option is turned on, recenter the summary window when the show window 450
433is toggled off." 451If this option is turned on, recenter the summary window when the
452show window is toggled off."
434 :type 'boolean 453 :type 'boolean
435 :group 'mh-folder) 454 :group 'mh-folder)
436 455
@@ -443,9 +462,10 @@ is toggled off."
443 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>. 462 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
444 463
445This option is consulted when a prefix argument is used with 464This option is consulted when a prefix argument is used with
446\\[mh-sort-folder]. Normally default arguments to \"sortm\" are specified in 465\\[mh-sort-folder]. Normally default arguments to \"sortm\" are
447the MH profile. This option may be used to provide an alternate view. For 466specified in the MH profile. This option may be used to provide
448example, \"'(\"-nolimit\" \"-textfield\" \"subject\")\" is a useful setting." 467an alternate view. For example, \"'(\"-nolimit\" \"-textfield\"
468\"subject\")\" is a useful setting."
449 :type 'string 469 :type 'string
450 :group 'mh-folder) 470 :group 'mh-folder)
451 471
@@ -455,23 +475,27 @@ example, \"'(\"-nolimit\" \"-textfield\" \"subject\")\" is a useful setting."
455 475
456(defcustom mh-default-folder-for-message-function nil 476(defcustom mh-default-folder-for-message-function nil
457 "Function to select a default folder for refiling or `Fcc'. 477 "Function to select a default folder for refiling or `Fcc'.
458The current buffer is set to the message being refiled with point at the start 478
459of the message. This function should return the default folder as a string 479The current buffer is set to the message being refiled with point
460with a leading `+' sign. It can also return nil so that the last folder name 480at the start of the message. This function should return the
461is used as the default, or an empty string to suppress the default entirely." 481default folder as a string with a leading `+' sign. It can also
482return nil so that the last folder name is used as the default,
483or an empty string to suppress the default entirely."
462 :type 'function 484 :type 'function
463 :group 'mh-folder-selection) 485 :group 'mh-folder-selection)
464 486
465(defcustom mh-default-folder-list nil 487(defcustom mh-default-folder-list nil
466 "*List of addresses and folders. 488 "*List of addresses and folders.
467The folder name associated with the first address found in this list is used 489
468as the default for `mh-refile-msg' and similar functions. Each element in this 490The folder name associated with the first address found in this
469list contains a `Check Recipient' item. If this item is turned on, then the 491list is used as the default for `mh-refile-msg' and similar
470address is checked against the recipient instead of the sender. This is useful 492functions. Each element in this list contains a `Check Recipient'
471for mailing lists. 493item. If this item is turned on, then the address is checked
472 494against the recipient instead of the sender. This is useful for
473See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more 495mailing lists.
474information." 496
497See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
498for more information."
475 :type '(repeat (list (regexp :tag "Address") 499 :type '(repeat (list (regexp :tag "Address")
476 (string :tag "Folder") 500 (string :tag "Folder")
477 (boolean :tag "Check Recipient"))) 501 (boolean :tag "Check Recipient")))
@@ -479,13 +503,14 @@ information."
479 503
480(defcustom mh-default-folder-must-exist-flag t 504(defcustom mh-default-folder-must-exist-flag t
481 "*Non-nil means guessed folder name must exist to be used. 505 "*Non-nil means guessed folder name must exist to be used.
482If the derived folder does not exist, and this option is on, then the last
483folder name used is suggested. This is useful if you get mail from various
484people for whom you have an alias, but file them all in the same project
485folder.
486 506
487See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more 507If the derived folder does not exist, and this option is on, then
488information." 508the last folder name used is suggested. This is useful if you get
509mail from various people for whom you have an alias, but file
510them all in the same project folder.
511
512See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
513for more information."
489 :type 'boolean 514 :type 'boolean
490 :group 'mh-folder-selection) 515 :group 'mh-folder-selection)
491 516
@@ -493,8 +518,8 @@ information."
493 "*Prefix used for folder names generated from aliases. 518 "*Prefix used for folder names generated from aliases.
494The prefix is used to prevent clutter in your mail directory. 519The prefix is used to prevent clutter in your mail directory.
495 520
496See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more 521See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
497information." 522for more information."
498 :type 'string 523 :type 'string
499 :group 'mh-folder-selection) 524 :group 'mh-folder-selection)
500 525
@@ -505,34 +530,38 @@ information."
505(defcustom mh-identity-list nil 530(defcustom mh-identity-list nil
506 "*List of identities. 531 "*List of identities.
507 532
508To customize this option, click on the `INS' button and enter a label such as 533To customize this option, click on the `INS' button and enter a label
509`Home' or `Work'. Then click on the `INS' button with the label `Add at least 534such as `Home' or `Work'. Then click on the `INS' button with the
510one item below'. Then choose one of the items in the `Value Menu'. 535label `Add at least one item below'. Then choose one of the items in
511 536the `Value Menu'.
512You can specify an alternate `From:' header field using the `From Field' menu 537
513item. You must include a valid email address. A standard format is `First Last 538You can specify an alternate `From:' header field using the `From
514<login@@host.domain>'. If you use an initial with a period, then you must 539Field' menu item. You must include a valid email address. A standard
515quote your name as in `\"First I. Last\" <login@@host.domain>'. People usually 540format is `First Last <login@@host.domain>'. If you use an initial
516list the name of the company where they work using the `Organization Field' 541with a period, then you must quote your name as in `\"First I. Last\"
517menu item. Set any arbitrary header field and value in the `Other Field' menu 542<login@@host.domain>'. People usually list the name of the company
518item. Unless the header field is a standard one, precede the name of your 543where they work using the `Organization Field' menu item. Set any
544arbitrary header field and value in the `Other Field' menu item.
545Unless the header field is a standard one, precede the name of your
519field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of 546field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of
520`Attribution Verb' overrides the setting of 547`Attribution Verb' overrides the setting of
521`mh-extract-from-attribution-verb'. Set your signature with the `Signature' 548`mh-extract-from-attribution-verb'. Set your signature with the
522menu item. You can specify the contents of `mh-signature-file-name', a file, 549`Signature' menu item. You can specify the contents of
523or a function. Specify a different key to sign or encrypt messages with the 550`mh-signature-file-name', a file, or a function. Specify a different
524`GPG Key ID' menu item. 551key to sign or encrypt messages with the `GPG Key ID' menu item.
525 552
526You can select the identities you have added via the menu called `Identity' in 553You can select the identities you have added via the menu called
527the MH-Letter buffer. You can also use \\[mh-insert-identity]. To clear the 554`Identity' in the MH-Letter buffer. You can also use
528fields and signature added by the identity, select the `None' identity. 555\\[mh-insert-identity]. To clear the fields and signature added by the
529 556identity, select the `None' identity.
530The `Identity' menu contains two other items to save you from having to set 557
531the identity on every message. The menu item `Set Default for Session' can be 558The `Identity' menu contains two other items to save you from having
532used to set the default identity to the current identity until you exit Emacs. 559to set the identity on every message. The menu item `Set Default for
533The menu item `Save as Default' sets the option `mh-identity-default' to the 560Session' can be used to set the default identity to the current
534current identity setting. You can also customize the `mh-identity-default' 561identity until you exit Emacs. The menu item `Save as Default' sets
535option in the usual fashion." 562the option `mh-identity-default' to the current identity setting. You
563can also customize the `mh-identity-default' option in the usual
564fashion."
536 :type '(repeat (list :tag "" 565 :type '(repeat (list :tag ""
537 (string :tag "Label") 566 (string :tag "Label")
538 (repeat :tag "Add at least one item below" 567 (repeat :tag "Add at least one item below"
@@ -567,37 +596,40 @@ option in the usual fashion."
567(defcustom mh-auto-fields-list nil 596(defcustom mh-auto-fields-list nil
568 "List of recipients for which header lines are automatically inserted. 597 "List of recipients for which header lines are automatically inserted.
569 598
570This option can be used to set the identity depending on the recipient. To 599This option can be used to set the identity depending on the
571customize this option, click on the `INS' button and enter a regular 600recipient. To customize this option, click on the `INS' button and
572expression for the recipient's address. Click on the `INS' button with the 601enter a regular expression for the recipient's address. Click on the
573`Add at least one item below' label. Then choose one of the items in the 602`INS' button with the `Add at least one item below' label. Then choose
574`Value Menu'. 603one of the items in the `Value Menu'.
575 604
576The `Identity' menu item is used to select an identity from those configured 605The `Identity' menu item is used to select an identity from those
577in `mh-identity-list'. All of the information for that identity will be added 606configured in `mh-identity-list'. All of the information for that
578if the recipient matches. The `Fcc Field' menu item is used to select a folder 607identity will be added if the recipient matches. The `Fcc Field' menu
579that is used in the `Fcc:' header. When you send the message, MH will put a 608item is used to select a folder that is used in the `Fcc:' header.
580copy of your message in this folder. The `Mail-Followup-To Field' menu item is 609When you send the message, MH will put a copy of your message in this
581used to insert an `Mail-Followup-To:' header field with the recipients you 610folder. The `Mail-Followup-To Field' menu item is used to insert an
582provide. If the recipient's mail user agent supports this header field (as nmh 611`Mail-Followup-To:' header field with the recipients you provide. If
583does), then their replies will go to the addresses listed. This is useful if 612the recipient's mail user agent supports this header field (as nmh
584their replies go both to the list and to you and you don't have a mechanism to 613does), then their replies will go to the addresses listed. This is
585suppress duplicates. If you reply to someone not on the list, you must either 614useful if their replies go both to the list and to you and you don't
586remove the `Mail-Followup-To:' field, or ensure the recipient is also listed 615have a mechanism to suppress duplicates. If you reply to someone not
587there so that he receives replies to your reply. Other header fields may be 616on the list, you must either remove the `Mail-Followup-To:' field, or
588added using the `Other Field' menu item. 617ensure the recipient is also listed there so that he receives replies
589 618to your reply. Other header fields may be added using the `Other
590These fields can only be added after the recipient is known. Once the header 619Field' menu item.
591contains one or more recipients, run the \\[mh-insert-auto-fields] command or 620
592choose the `Identity -> Insert Auto Fields' menu item to insert these fields 621These fields can only be added after the recipient is known. Once the
593manually. However, you can just send the message and the fields will be added 622header contains one or more recipients, run the
594automatically. You are given a chance to see these fields and to confirm them 623\\[mh-insert-auto-fields] command or choose the `Identity -> Insert
595before the message is actually sent. You can do away with this confirmation by 624Auto Fields' menu item to insert these fields manually. However, you
596turning off the option `mh-auto-fields-prompt-flag'. 625can just send the message and the fields will be added automatically.
597 626You are given a chance to see these fields and to confirm them before
598You should avoid using the same header field in `mh-auto-fields-list' and 627the message is actually sent. You can do away with this confirmation
599`mh-identity-list' definitions that may apply to the same message as the 628by turning off the option `mh-auto-fields-prompt-flag'.
600result is undefined." 629
630You should avoid using the same header field in `mh-auto-fields-list'
631and `mh-identity-list' definitions that may apply to the same message
632as the result is undefined."
601 :type `(repeat 633 :type `(repeat
602 (list :tag "" 634 (list :tag ""
603 (string :tag "Recipient") 635 (string :tag "Recipient")
@@ -645,25 +677,28 @@ See `mh-identity-list'."
645 (":pgg-default-user-id" . mh-identity-handler-gpg-identity)) 677 (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
646 "Handler functions for fields in `mh-identity-list'. 678 "Handler functions for fields in `mh-identity-list'.
647 679
648This option is used to change the way that fields, signatures, and 680This option is used to change the way that fields, signatures,
649attributions in `mh-identity-list' are added. To customize 681and attributions in `mh-identity-list' are added. To customize
650`mh-identity-handlers', replace the name of an existing handler function 682`mh-identity-handlers', replace the name of an existing handler
651associated with the field you want to change with the name of a function you 683function associated with the field you want to change with the
652have written. You can also click on an `INS' button and insert a field of your 684name of a function you have written. You can also click on an
653choice and the name of the function you have written to handle it. 685`INS' button and insert a field of your choice and the name of
686the function you have written to handle it.
654 687
655The `Field' field can be any field that you've used in your 688The `Field' field can be any field that you've used in your
656`mh-identity-list'. The special fields `:attribution-verb', `:signature', or 689`mh-identity-list'. The special fields `:attribution-verb',
657`:pgg-default-user-id' are used for the `mh-identity-list' choices 690`:signature', or `:pgg-default-user-id' are used for the
658`Attribution Verb', `Signature', and `GPG Key ID' respectively. 691`mh-identity-list' choices `Attribution Verb', `Signature', and
659 692`GPG Key ID' respectively.
660The handler associated with the `:default' field is used when no other field 693
661matches. 694The handler associated with the `:default' field is used when no
662 695other field matches.
663The handler functions are passed two or three arguments: the FIELD itself (for 696
664example, `From'), or one of the special fields (for example, `:signature'), 697The handler functions are passed two or three arguments: the
665and the ACTION `'remove' or `'add'. If the action is `'add', an additional 698FIELD itself (for example, `From'), or one of the special
666argument containing the VALUE for the field is given." 699fields (for example, `:signature'), and the ACTION `'remove' or
700`'add'. If the action is `'add', an additional argument
701containing the VALUE for the field is given."
667 :type '(repeat (cons (string :tag "Field") function)) 702 :type '(repeat (cons (string :tag "Field") function))
668 :group 'mh-identity) 703 :group 'mh-identity)
669 704
@@ -674,23 +709,25 @@ argument containing the VALUE for the field is given."
674(defcustom mh-inc-prog "inc" 709(defcustom mh-inc-prog "inc"
675 "*Program to incorporate new mail into a folder. 710 "*Program to incorporate new mail into a folder.
676 711
677This program generates a one-line summary for each of the new messages. Unless 712This program generates a one-line summary for each of the new
678it is an absolute pathname, the file is assumed to be in the `mh-progs' 713messages. Unless it is an absolute pathname, the file is assumed
679directory. You may also link a file to `inc' that uses a different format. 714to be in the `mh-progs' directory. You may also link a file to
680You'll then need to modify several scan line format variables appropriately." 715`inc' that uses a different format. You'll then need to modify
716several scan line format variables appropriately."
681 :type 'string 717 :type 'string
682 :group 'mh-inc) 718 :group 'mh-inc)
683 719
684(defcustom mh-inc-spool-list nil 720(defcustom mh-inc-spool-list nil
685 "*Alternate spool files. 721 "*Alternate spool files.
686 722
687You can use the `mh-inc-spool-list' variable to direct MH-E to retrieve mail 723You can use the `mh-inc-spool-list' variable to direct MH-E to
688from arbitrary spool files other than your system mailbox, file it in folders 724retrieve mail from arbitrary spool files other than your system
689other than your `+inbox', and assign key bindings to incorporate this mail. 725mailbox, file it in folders other than your `+inbox', and assign
726key bindings to incorporate this mail.
690 727
691Suppose you are subscribed to the `mh-e-devel' mailing list and you use 728Suppose you are subscribed to the `mh-e-devel' mailing list and
692`procmail' to filter this mail into `~/mail/mh-e' with the following recipe in 729you use `procmail' to filter this mail into `~/mail/mh-e' with
693`.procmailrc': 730the following recipe in `.procmailrc':
694 731
695 MAILDIR=$HOME/mail 732 MAILDIR=$HOME/mail
696 :0: 733 :0:
@@ -698,12 +735,12 @@ Suppose you are subscribed to the `mh-e-devel' mailing list and you use
698 mh-e 735 mh-e
699 736
700In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m' 737In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m'
701\(`mh-inc-spool-mh-e'\) command, customize this option, and click on the `INS' 738\(`mh-inc-spool-mh-e'\) command, customize this option, and click
702button. Enter a `Spool File' of `~/mail/mh-e', a `Folder' of `mh-e', and a 739on the `INS' button. Enter a `Spool File' of `~/mail/mh-e', a
703`Key Binding' of `m'. 740`Folder' of `mh-e', and a `Key Binding' of `m'.
704 741
705You can use `xbuffy' to automate the incorporation of this mail using the 742You can use `xbuffy' to automate the incorporation of this mail
706`gnudoit' command in the `gnuserv' package as follows: 743using the `gnudoit' command in the `gnuserv' package as follows:
707 744
708 box ~/mail/mh-e 745 box ~/mail/mh-e
709 title mh-e 746 title mh-e
@@ -723,13 +760,15 @@ You can use `xbuffy' to automate the incorporation of this mail using the
723 760
724(defcustom mh-index-program nil 761(defcustom mh-index-program nil
725 "Indexing program that MH-E shall use. 762 "Indexing program that MH-E shall use.
726The default setting of this option is `Auto-detect' which means that MH-E will
727automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in
728that order. If, for example, you have both swish++ and mairix installed and
729you want to use mairix, then you can set this option to `mairix'.
730 763
731More information about setting up an indexing program to use with MH-E can be 764The default setting of this option is `Auto-detect' which means
732found in the documentation of `mh-index-search'." 765that MH-E will automatically choose one of swish++, swish-e,
766mairix, namazu, pick and grep in that order. If, for example, you
767have both swish++ and mairix installed and you want to use
768mairix, then you can set this option to `mairix'.
769
770More information about setting up an indexing program to use with
771MH-E can be found in the documentation of `mh-index-search'."
733 :type '(choice (const :tag "Auto-detect" nil) 772 :type '(choice (const :tag "Auto-detect" nil)
734 (const :tag "swish++" swish++) 773 (const :tag "swish++" swish++)
735 (const :tag "swish-e" swish) 774 (const :tag "swish-e" swish)
@@ -752,13 +791,17 @@ found in the documentation of `mh-index-search'."
752 (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist) 791 (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
753 (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist)) 792 (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
754 "Available choices of spam programs to use. 793 "Available choices of spam programs to use.
755This is an alist. For each element there are functions that blacklist a message 794
756as spam and whitelist a message incorrectly classified as spam.") 795This is an alist. For each element there are functions that
796blacklist a message as spam and whitelist a message incorrectly
797classified as spam.")
757 798
758(defun mh-junk-choose (symbol value) 799(defun mh-junk-choose (symbol value)
759 "Choose spam program to use. 800 "Choose spam program to use.
760The function is always called with SYMBOL bound to `mh-junk-program' and VALUE 801
761bound to the new value of `mh-junk-program'. The function sets the variable 802The function is always called with SYMBOL bound to
803`mh-junk-program' and VALUE bound to the new value of
804`mh-junk-program'. The function sets the variable
762`mh-junk-choice' in addition to `mh-junk-program'." 805`mh-junk-choice' in addition to `mh-junk-program'."
763 (set symbol value) 806 (set symbol value)
764 (setq mh-junk-choice 807 (setq mh-junk-choice
@@ -770,9 +813,11 @@ bound to the new value of `mh-junk-program'. The function sets the variable
770;; User customizable variables 813;; User customizable variables
771(defcustom mh-junk-background nil 814(defcustom mh-junk-background nil
772 "If on, spam programs are run in background. 815 "If on, spam programs are run in background.
773By default, the programs are run in the foreground, but this can be slow when 816
774junking large numbers of messages. If you have enough memory or don't junk 817By default, the programs are run in the foreground, but this can
775that many messages at the same time, you might try turning on this option." 818be slow when junking large numbers of messages. If you have
819enough memory or don't junk that many messages at the same time,
820you might try turning on this option."
776 :type '(choice (const :tag "Off" nil) 821 :type '(choice (const :tag "Off" nil)
777 (const :tag "On" 0)) 822 (const :tag "On" 0))
778 :group 'mh-junk) 823 :group 'mh-junk)
@@ -786,11 +831,11 @@ that many messages at the same time, you might try turning on this option."
786(defcustom mh-junk-program nil 831(defcustom mh-junk-program nil
787 "Spam program that MH-E should use. 832 "Spam program that MH-E should use.
788 833
789The default setting of this option is \"Auto-detect\" which means that MH-E 834The default setting of this option is \"Auto-detect\" which means
790will automatically choose one of SpamAssassin, bogofilter, or SpamProbe in 835that MH-E will automatically choose one of SpamAssassin,
791that order. If, for example, you have both SpamAssassin and bogofilter 836bogofilter, or SpamProbe in that order. If, for example, you have
792installed and you want to use bogofilter, then you can set this option to 837both SpamAssassin and bogofilter installed and you want to use
793\"Bogofilter\"." 838bogofilter, then you can set this option to \"Bogofilter\"."
794 :type '(choice (const :tag "Auto-detect" nil) 839 :type '(choice (const :tag "Auto-detect" nil)
795 (const :tag "SpamAssassin" spamassassin) 840 (const :tag "SpamAssassin" spamassassin)
796 (const :tag "Bogofilter" bogofilter) 841 (const :tag "Bogofilter" bogofilter)
@@ -804,11 +849,13 @@ installed and you want to use bogofilter, then you can set this option to
804 849
805(defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh) 850(defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
806 "Type of tags used when composing MIME messages. 851 "Type of tags used when composing MIME messages.
807In addition to MH-style directives, MH-E also supports MML (MIME Meta 852
808Language) tags. (see Info node `(emacs-mime)Composing'). This option can be 853In addition to MH-style directives, MH-E also supports MML (MIME
809used to choose between them. By default, this option is set to \"MML\" if it 854Meta Language) tags. (see Info node `(emacs-mime)Composing').
810is supported since it provides a lot more functionality. This option can also 855This option can be used to choose between them. By default, this
811be set to \"MH\" if MH-style directives are preferred." 856option is set to \"MML\" if it is supported since it provides a
857lot more functionality. This option can also be set to \"MH\" if
858MH-style directives are preferred."
812 :type '(choice (const :tag "MML" mml) 859 :type '(choice (const :tag "MML" mml)
813 (const :tag "MH" mh)) 860 (const :tag "MH" mh))
814 :group 'mh-letter) 861 :group 'mh-letter)
@@ -827,18 +874,20 @@ be set to \"MH\" if MH-style directives are preferred."
827 874
828(defcustom mh-delete-yanked-msg-window-flag nil 875(defcustom mh-delete-yanked-msg-window-flag nil
829 "*Non-nil means delete any window displaying the message. 876 "*Non-nil means delete any window displaying the message.
830This deletes the window containing the original message after yanking it with 877
831\\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make more room on your screen for 878This deletes the window containing the original message after
832your reply." 879yanking it with \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make
880more room on your screen for your reply."
833 :type 'boolean 881 :type 'boolean
834 :group 'mh-letter) 882 :group 'mh-letter)
835 883
836(defcustom mh-extract-from-attribution-verb "wrote:" 884(defcustom mh-extract-from-attribution-verb "wrote:"
837 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. 885 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
838The attribution consists of the sender's name and email address followed by 886
839the content of this option. This option can be set to \"wrote:\", \"a 887The attribution consists of the sender's name and email address
840écrit:\", and \"schrieb:\". You can also use the \"Custom String\" menu item 888followed by the content of this option. This option can be set to
841to enter your own verb." 889\"wrote:\", \"a écrit:\", and \"schrieb:\". You can also use the
890\"Custom String\" menu item to enter your own verb."
842 :type '(choice (const "wrote:") 891 :type '(choice (const "wrote:")
843 (const "a écrit:") 892 (const "a écrit:")
844 (const "schrieb:") 893 (const "schrieb:")
@@ -847,43 +896,51 @@ to enter your own verb."
847 896
848(defcustom mh-ins-buf-prefix "> " 897(defcustom mh-ins-buf-prefix "> "
849 "*String to put before each line of a yanked or inserted message. 898 "*String to put before each line of a yanked or inserted message.
850The prefix \"> \" is the default setting of this option. I suggest that you
851not modify this option since it is used by many mailers and news readers:
852messages are far easier to read if several included messages have all been
853indented by the same string.
854 899
855This prefix is not inserted if you use one of the supercite flavors of 900The prefix \"> \" is the default setting of this option. I
856`mh-yank-behavior' or you have added a `mail-citation-hook'." 901suggest that you not modify this option since it is used by many
902mailers and news readers: messages are far easier to read if
903several included messages have all been indented by the same
904string.
905
906This prefix is not inserted if you use one of the supercite
907flavors of `mh-yank-behavior' or you have added a
908`mail-citation-hook'."
857 :type 'string 909 :type 'string
858 :group 'mh-letter) 910 :group 'mh-letter)
859 911
860(defcustom mh-letter-complete-function 'ispell-complete-word 912(defcustom mh-letter-complete-function 'ispell-complete-word
861 "*Function to call when completing outside of address or folder fields. 913 "*Function to call when completing outside of address or folder fields.
862In the body of the message, \\<mh-letter-mode-map>\\[mh-letter-complete] runs 914
863this function, which is set to \"ispell-complete-word\" by default." 915In the body of the message,
916\\<mh-letter-mode-map>\\[mh-letter-complete] runs this function,
917which is set to \"ispell-complete-word\" by default."
864 :type '(choice function (const nil)) 918 :type '(choice function (const nil))
865 :group 'mh-letter) 919 :group 'mh-letter)
866 920
867(defcustom mh-letter-fill-column 72 921(defcustom mh-letter-fill-column 72
868 "*Fill column to use in MH Letter mode. 922 "*Fill column to use in MH Letter mode.
869By default, this option is 72 to allow others to quote your message without 923
870line wrapping." 924By default, this option is 72 to allow others to quote your
925message without line wrapping."
871 :type 'integer 926 :type 'integer
872 :group 'mh-letter) 927 :group 'mh-letter)
873 928
874(defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none") 929(defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
875 "Default method to use in security tags. 930 "Default method to use in security tags.
876This option is used to select between a variety of mail security mechanisms.
877The default is \"PGP (MIME)\" if it is supported\; otherwise, the default is
878\"None\". Other mechanisms include vanilla \"PGP\" and \"S/MIME\".
879 931
880The `pgg' customization group may have some settings which may interest you 932This option is used to select between a variety of mail security
881\(see Info node `(pgg)'). 933mechanisms. The default is \"PGP (MIME)\" if it is supported\;
934otherwise, the default is \"None\". Other mechanisms include
935vanilla \"PGP\" and \"S/MIME\".
882 936
883In particular, I set the option `pgg-encrypt-for-me' to t so that all messages 937The `pgg' customization group may have some settings which may
884I encrypt are encrypted with my public key as well. If you keep a copy of all 938interest you \(see Info node `(pgg)').
885of your outgoing mail with a \"Fcc:\" header field, this setting is vital so 939
886that you can read the mail you write!" 940In particular, I set the option `pgg-encrypt-for-me' to t so that all
941messages I encrypt are encrypted with my public key as well. If you
942keep a copy of all of your outgoing mail with a \"Fcc:\" header field,
943this setting is vital so that you can read the mail you write!"
887 :type '(choice (const :tag "PGP (MIME)" "pgpmime") 944 :type '(choice (const :tag "PGP (MIME)" "pgpmime")
888 (const :tag "PGP" "pgp") 945 (const :tag "PGP" "pgp")
889 (const :tag "S/MIME" "smime") 946 (const :tag "S/MIME" "smime")
@@ -914,72 +971,76 @@ The signature is inserted into your message with the command
914 971
915(defcustom mh-signature-separator-flag t 972(defcustom mh-signature-separator-flag t
916 "*Non-nil means a signature separator should be inserted. 973 "*Non-nil means a signature separator should be inserted.
917It is not recommended that you change this option since various mail user 974
918agents, including MH-E, use the separator to present the signature 975It is not recommended that you change this option since various
919differently, and to suppress the signature when replying or yanking a letter 976mail user agents, including MH-E, use the separator to present
920into a draft." 977the signature differently, and to suppress the signature when
978replying or yanking a letter into a draft."
921 :type 'boolean 979 :type 'boolean
922 :group 'mh-letter) 980 :group 'mh-letter)
923 981
924(defcustom mh-x-face-file "~/.face" 982(defcustom mh-x-face-file "~/.face"
925 "*File containing face header field to insert in outgoing mail. 983 "*File containing face header field to insert in outgoing mail.
926 984
927If the file starts with either of the strings \"X-Face:\", \"Face:\" or 985If the file starts with either of the strings \"X-Face:\", \"Face:\"
928\"X-Image-URL:\" then the contents are added to the message header verbatim. 986or \"X-Image-URL:\" then the contents are added to the message header
929Otherwise it is assumed that the file contains the value of the \"X-Face:\" 987verbatim. Otherwise it is assumed that the file contains the value of
930header field. 988the \"X-Face:\" header field.
931 989
932The \"X-Face:\" header field, which is a low-resolution, black 990The \"X-Face:\" header field, which is a low-resolution, black and
933and white image, can be generated using the \"compface\" command 991white image, can be generated using the \"compface\" command (see URL
934\(see URL `ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z'). 992`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z'). The
935The \"Online X-Face Converter\" is a useful resource for quick 993\"Online X-Face Converter\" is a useful resource for quick conversion
936conversion of images into \"X-Face:\" header fields (see URL 994of images into \"X-Face:\" header fields (see URL
937`http://www.dairiki.org/xface/'). 995`http://www.dairiki.org/xface/').
938 996
939Use the \"make-face\" script to convert a JPEG image to the 997Use the \"make-face\" script to convert a JPEG image to the higher
940higher resolution, color, \"Face:\" header field (see URL 998resolution, color, \"Face:\" header field (see URL
941`http://quimby.gnus.org/circus/face/make-face'). 999`http://quimby.gnus.org/circus/face/make-face').
942 1000
943The URL of any image can be used for the \"X-Image-URL:\" field and no 1001The URL of any image can be used for the \"X-Image-URL:\" field and no
944processing of the image is required. 1002processing of the image is required.
945 1003
946To prevent the setting of any of these header fields, either set 1004To prevent the setting of any of these header fields, either set
947`mh-x-face-file' to nil, or simply ensure that the file defined by this option 1005`mh-x-face-file' to nil, or simply ensure that the file defined by
948doesn't exist." 1006this option doesn't exist."
949 :type 'file 1007 :type 'file
950 :group 'mh-letter) 1008 :group 'mh-letter)
951 1009
952(defcustom mh-yank-behavior 'attribution 1010(defcustom mh-yank-behavior 'attribution
953 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. 1011 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
954 1012
955To include the entire message, including the entire header, use \"Body and 1013To include the entire message, including the entire header, use \"Body
956Header\". Use \"Body\" to yank just the body without the header. To yank only 1014and Header\". Use \"Body\" to yank just the body without the header.
957the portion of the message following the point, set this option to \"Below 1015To yank only the portion of the message following the point, set this
958Point\". 1016option to \"Below Point\".
959 1017
960Choose \"Invoke supercite\" to pass the entire message and header through 1018Choose \"Invoke supercite\" to pass the entire message and header
961supercite. 1019through supercite.
962 1020
963If the \"Body With Attribution\" setting is used, then the message minus the 1021If the \"Body With Attribution\" setting is used, then the message
964header is yanked and a simple attribution line is added at the top using the 1022minus the header is yanked and a simple attribution line is added at
965value of the `mh-extract-from-attribution-verb' option. This is the default. 1023the top using the value of the `mh-extract-from-attribution-verb'
966 1024option. This is the default.
967If the \"Invoke supercite\" or \"Body With Attribution\" settings are used, 1025
968the \"-noformat\" argument is passed to the \"repl\" program to override a 1026If the \"Invoke supercite\" or \"Body With Attribution\" settings are
969\"-filter\" or \"-format\" argument. These settings also have 1027used, the \"-noformat\" argument is passed to the \"repl\" program to
970\"Automatically\" variants that perform the action automatically when you 1028override a \"-filter\" or \"-format\" argument. These settings also
971reply so that you don't need to use \\[mh-yank-cur-msg] at all. Note that this 1029have \"Automatically\" variants that perform the action automatically
972automatic action is only performed if the show buffer matches the message 1030when you reply so that you don't need to use \\[mh-yank-cur-msg] at
973being replied to. People who use the automatic variants tend to turn on the 1031all. Note that this automatic action is only performed if the show
974`mh-delete-yanked-msg-window-flag' option as well so that the show window is 1032buffer matches the message being replied to. People who use the
975never displayed. 1033automatic variants tend to turn on the
976 1034`mh-delete-yanked-msg-window-flag' option as well so that the show
977If the show buffer has a region, the `mh-yank-behavior' option is ignored 1035window is never displayed.
978unless its value is one of Attribution variants in which case the attribution 1036
979is added to the yanked region. 1037If the show buffer has a region, the `mh-yank-behavior' option is
1038ignored unless its value is one of Attribution variants in which case
1039the attribution is added to the yanked region.
980 1040
981If this option is set to one of the supercite flavors, the hook 1041If this option is set to one of the supercite flavors, the hook
982`mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not inserted." 1042`mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not
1043inserted."
983 :type '(choice (const :tag "Body and Header" t) 1044 :type '(choice (const :tag "Body and Header" t)
984 (const :tag "Body" body) 1045 (const :tag "Body" body)
985 (const :tag "Below Point" nil) 1046 (const :tag "Below Point" nil)
@@ -996,10 +1057,11 @@ If this option is set to one of the supercite flavors, the hook
996 1057
997(defcustom mh-interpret-number-as-range-flag t 1058(defcustom mh-interpret-number-as-range-flag t
998 "*Non-nil means interpret a number as a range. 1059 "*Non-nil means interpret a number as a range.
999Since one of the most frequent ranges used is \"last:N\", MH-E will interpret 1060
1000input such as \"200\" as \"last:200\" if this option is on (which is the 1061Since one of the most frequent ranges used is \"last:N\", MH-E
1001default). If you need to scan just the message 200, then use the range 1062will interpret input such as \"200\" as \"last:200\" if this
1002\"200:200\"." 1063option is on (which is the default). If you need to scan just the
1064message 200, then use the range \"200:200\"."
1003 :type 'boolean 1065 :type 'boolean
1004 :group 'mh-ranges) 1066 :group 'mh-ranges)
1005 1067
@@ -1012,8 +1074,9 @@ default). If you need to scan just the message 200, then use the range
1012 1074
1013(defun mh-adaptive-cmd-note-flag-check (symbol value) 1075(defun mh-adaptive-cmd-note-flag-check (symbol value)
1014 "Check if desired setting is legal. 1076 "Check if desired setting is legal.
1015Throw an error if user tries to turn on `mh-adaptive-cmd-note-flag' when 1077Throw an error if user tries to turn on
1016`mh-scan-format-file' isn't t. Otherwise, set SYMBOL to VALUE." 1078`mh-adaptive-cmd-note-flag' when `mh-scan-format-file' isn't t.
1079Otherwise, set SYMBOL to VALUE."
1017 (if (and value 1080 (if (and value
1018 (not (eq mh-scan-format-file t))) 1081 (not (eq mh-scan-format-file t)))
1019 (error "%s %s" "Can't turn on unless mh-scan-format-file" 1082 (error "%s %s" "Can't turn on unless mh-scan-format-file"
@@ -1022,8 +1085,9 @@ Throw an error if user tries to turn on `mh-adaptive-cmd-note-flag' when
1022 1085
1023(defun mh-scan-format-file-check (symbol value) 1086(defun mh-scan-format-file-check (symbol value)
1024 "Check if desired setting is legal. 1087 "Check if desired setting is legal.
1025Throw an error if user tries to set `mh-scan-format-file' to anything but t 1088Throw an error if user tries to set `mh-scan-format-file' to
1026when `mh-adaptive-cmd-note-flag' is on. Otherwise, set SYMBOL to VALUE." 1089anything but t when `mh-adaptive-cmd-note-flag' is on. Otherwise,
1090set SYMBOL to VALUE."
1027 (if (and (not (eq value t)) 1091 (if (and (not (eq value t))
1028 (eq mh-adaptive-cmd-note-flag t)) 1092 (eq mh-adaptive-cmd-note-flag t))
1029 (error "%s %s" "You must turn off mh-adaptive-cmd-note-flag" 1093 (error "%s %s" "You must turn off mh-adaptive-cmd-note-flag"
@@ -1032,16 +1096,17 @@ when `mh-adaptive-cmd-note-flag' is on. Otherwise, set SYMBOL to VALUE."
1032 1096
1033(defcustom mh-adaptive-cmd-note-flag t 1097(defcustom mh-adaptive-cmd-note-flag t
1034 "*Non-nil means that the message number width is determined dynamically. 1098 "*Non-nil means that the message number width is determined dynamically.
1035If you've created your own format to handle long message numbers, you'll be 1099
1036pleased to know you no longer need it since MH-E adapts its internal format 1100If you've created your own format to handle long message numbers,
1037based upon the largest message number if this option is on (the default). 1101you'll be pleased to know you no longer need it since MH-E adapts its
1038This option may only be turned on when `mh-scan-format-file' is set to \"Use 1102internal format based upon the largest message number if this option
1039MH-E scan Format\". 1103is on (the default). This option may only be turned on when
1040 1104`mh-scan-format-file' is set to \"Use MH-E scan Format\".
1041If you prefer fixed-width message numbers, turn off this option and call 1105
1042`mh-set-cmd-note' with the width specified by your format file 1106If you prefer fixed-width message numbers, turn off this option and
1043\(see `mh-scan-format-file'). For example, the default width is 4, so you would 1107call `mh-set-cmd-note' with the width specified by your format file
1044use \"(mh-set-cmd-note 4)\"." 1108\(see `mh-scan-format-file'). For example, the default width is 4, so
1109you would use \"(mh-set-cmd-note 4)\"."
1045 :type 'boolean 1110 :type 'boolean
1046 :group 'mh-scan-line-formats 1111 :group 'mh-scan-line-formats
1047 :set 'mh-adaptive-cmd-note-flag-check) 1112 :set 'mh-adaptive-cmd-note-flag-check)
@@ -1049,22 +1114,24 @@ use \"(mh-set-cmd-note 4)\"."
1049(defcustom mh-scan-format-file t 1114(defcustom mh-scan-format-file t
1050 "Specifies the format file to pass to the scan program. 1115 "Specifies the format file to pass to the scan program.
1051 1116
1052The default setting for this option is \"Use MH-E scan Format\". This means 1117The default setting for this option is \"Use MH-E scan Format\". This
1053that the format string will be taken from the either `mh-scan-format-mh' or 1118means that the format string will be taken from the either
1054`mh-scan-format-nmh' depending on whether MH or nmh (or GNU mailutils) is in 1119`mh-scan-format-mh' or `mh-scan-format-nmh' depending on whether MH or
1055use. This setting also enables you to turn on the `mh-adaptive-cmd-note-flag' 1120nmh (or GNU mailutils) is in use. This setting also enables you to
1056option. 1121turn on the `mh-adaptive-cmd-note-flag' option.
1057 1122
1058You can also set this option to \"Use Default scan Format\" to get the 1123You can also set this option to \"Use Default scan Format\" to get the
1059same output as you would get if you ran \"scan\" from the shell. If you have a 1124same output as you would get if you ran \"scan\" from the shell. If
1060format file that you want MH-E to use but not MH, you can set this option to 1125you have a format file that you want MH-E to use but not MH, you can
1061\"Specify a scan Format File\" and enter the name of your format file. 1126set this option to \"Specify a scan Format File\" and enter the name
1062 1127of your format file.
1063If you change the format of the scan lines you'll need to tell MH-E how to 1128
1064parse the new format. As you will see, quite a lot of variables are involved 1129If you change the format of the scan lines you'll need to tell MH-E
1065to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to obtain a list of these 1130how to parse the new format. As you will see, quite a lot of variables
1066variables. You will also have to call `mh-set-cmd-note' if your notations are 1131are involved to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to
1067not in column 4 (columns in Emacs start with 0)." 1132obtain a list of these variables. You will also have to call
1133`mh-set-cmd-note' if your notations are not in column 4 (columns in
1134Emacs start with 0)."
1068 :type '(choice (const :tag "Use MH-E scan Format" t) 1135 :type '(choice (const :tag "Use MH-E scan Format" t)
1069 (const :tag "Use Default scan Format" nil) 1136 (const :tag "Use Default scan Format" nil)
1070 (file :tag "Specify a scan Format File")) 1137 (file :tag "Specify a scan Format File"))
@@ -1073,10 +1140,12 @@ not in column 4 (columns in Emacs start with 0)."
1073 1140
1074(defcustom mh-scan-prog "scan" 1141(defcustom mh-scan-prog "scan"
1075 "*Program used to scan messages. 1142 "*Program used to scan messages.
1076The name of the program that generates a listing of one line per message is 1143
1077held in this option. Unless this variable contains an absolute pathname, it is 1144The name of the program that generates a listing of one line per
1078assumed to be in the `mh-progs' directory. You may link another program to 1145message is held in this option. Unless this variable contains an
1079`scan' (see \"mh-profile(5)\") to produce a different type of listing." 1146absolute pathname, it is assumed to be in the `mh-progs'
1147directory. You may link another program to `scan' (see
1148\"mh-profile(5)\") to produce a different type of listing."
1080 :type 'string 1149 :type 'string
1081 :group 'mh-scan-line-formats) 1150 :group 'mh-scan-line-formats)
1082(make-variable-buffer-local 'mh-scan-prog) 1151(make-variable-buffer-local 'mh-scan-prog)
@@ -1088,24 +1157,26 @@ assumed to be in the `mh-progs' directory. You may link another program to
1088(defcustom mh-compose-forward-as-mime-flag t 1157(defcustom mh-compose-forward-as-mime-flag t
1089 "*Non-nil means that messages are forwarded as attachments. 1158 "*Non-nil means that messages are forwarded as attachments.
1090 1159
1091By default, this option is on which means that the forwarded messages are 1160By default, this option is on which means that the forwarded
1092included as attachments. If you would prefer to forward your messages verbatim 1161messages are included as attachments. If you would prefer to
1093\(as text, inline), then turn off this option. Forwarding messages verbatim 1162forward your messages verbatim (as text, inline), then turn off
1094works well for short, textual messages, but your recipient won't be able to 1163this option. Forwarding messages verbatim works well for short,
1095view any non-textual attachments that were in the forwarded message. Be aware 1164textual messages, but your recipient won't be able to view any
1096that if you have \"forw: -mime\" in your MH profile, then forwarded messages 1165non-textual attachments that were in the forwarded message. Be
1097will always be included as attachments regardless of the settings of this 1166aware that if you have \"forw: -mime\" in your MH profile, then
1098option." 1167forwarded messages will always be included as attachments
1168regardless of the settings of this option."
1099 :type 'boolean 1169 :type 'boolean
1100 :group 'mh-sending-mail) 1170 :group 'mh-sending-mail)
1101 1171
1102(defcustom mh-compose-letter-function nil 1172(defcustom mh-compose-letter-function nil
1103 "Invoked when starting a new draft. 1173 "Invoked when starting a new draft.
1104 1174
1105However, it is the last function called before you edit your message. The 1175However, it is the last function called before you edit your
1106consequence of this is that you can write a function to write and send the 1176message. The consequence of this is that you can write a function
1107message for you. This function is passed three arguments: the contents of the 1177to write and send the message for you. This function is passed
1108TO, SUBJECT, and CC header fields." 1178three arguments: the contents of the TO, SUBJECT, and CC header
1179fields."
1109 :type '(choice (const nil) function) 1180 :type '(choice (const nil) function)
1110 :group 'mh-sending-mail) 1181 :group 'mh-sending-mail)
1111 1182
@@ -1117,40 +1188,40 @@ TO, SUBJECT, and CC header fields."
1117(defcustom mh-forward-subject-format "%s: %s" 1188(defcustom mh-forward-subject-format "%s: %s"
1118 "*Format string for forwarded message subject. 1189 "*Format string for forwarded message subject.
1119 1190
1120This option is a string which includes two escapes (\"%s\"). The first \"%s\" 1191This option is a string which includes two escapes (\"%s\"). The
1121is replaced with the sender of the original message, and the second one is 1192first \"%s\" is replaced with the sender of the original message,
1122replaced with the original \"Subject:\"." 1193and the second one is replaced with the original \"Subject:\"."
1123 :type 'string 1194 :type 'string
1124 :group 'mh-sending-mail) 1195 :group 'mh-sending-mail)
1125 1196
1126(defcustom mh-insert-x-mailer-flag t 1197(defcustom mh-insert-x-mailer-flag t
1127 "*Non-nil means append an \"X-Mailer:\" header field to the header. 1198 "*Non-nil means append an \"X-Mailer:\" header field to the header.
1128 1199
1129This header field includes the version of MH-E and Emacs that you are using. 1200This header field includes the version of MH-E and Emacs that you
1130If you don't want to participate in our marketing, you can turn this option 1201are using. If you don't want to participate in our marketing, you
1131off." 1202can turn this option off."
1132 :type 'boolean 1203 :type 'boolean
1133 :group 'mh-sending-mail) 1204 :group 'mh-sending-mail)
1134 1205
1135(defcustom mh-redist-full-contents-flag nil 1206(defcustom mh-redist-full-contents-flag nil
1136 "*Non-nil means the \"dist\" command needs entire letter for redistribution. 1207 "*Non-nil means the \"dist\" command needs entire letter for redistribution.
1137 1208
1138This option must be turned on if \"dist\" requires the whole letter for 1209This option must be turned on if \"dist\" requires the whole
1139redistribution, which is the case if \"send\" is compiled with the BERK option 1210letter for redistribution, which is the case if \"send\" is
1140\(which many people abhor). If you find that MH will not allow you to 1211compiled with the BERK option (which many people abhor). If you
1141redistribute a message that has been redistributed before, turn off this 1212find that MH will not allow you to redistribute a message that
1142option." 1213has been redistributed before, turn off this option."
1143 :type 'boolean 1214 :type 'boolean
1144 :group 'mh-sending-mail) 1215 :group 'mh-sending-mail)
1145 1216
1146(defcustom mh-reply-default-reply-to nil 1217(defcustom mh-reply-default-reply-to nil
1147 "*Sets the person or persons to whom a reply will be sent. 1218 "*Sets the person or persons to whom a reply will be sent.
1148 1219
1149This option is set to \"Prompt\" by default so that you are prompted for the 1220This option is set to \"Prompt\" by default so that you are
1150recipient of a reply. If you find that most of the time that you specify 1221prompted for the recipient of a reply. If you find that most of
1151\"cc\" when you reply to a message, set this option to \"cc\". Other choices 1222the time that you specify \"cc\" when you reply to a message, set
1152include \"from\", \"to\", or \"all\". You can always edit the recipients in 1223this option to \"cc\". Other choices include \"from\", \"to\", or
1153the draft." 1224\"all\". You can always edit the recipients in the draft."
1154 :type '(choice (const :tag "Prompt" nil) 1225 :type '(choice (const :tag "Prompt" nil)
1155 (const "from") 1226 (const "from")
1156 (const "to") 1227 (const "to")
@@ -1161,8 +1232,8 @@ the draft."
1161(defcustom mh-reply-show-message-flag t 1232(defcustom mh-reply-show-message-flag t
1162 "*Non-nil means the MH-Show buffer is displayed when replying. 1233 "*Non-nil means the MH-Show buffer is displayed when replying.
1163 1234
1164If you include the message automatically, you can hide the MH-Show 1235If you include the message automatically, you can hide the
1165buffer by turning off this option. 1236MH-Show buffer by turning off this option.
1166 1237
1167See also `mh-reply'." 1238See also `mh-reply'."
1168 :type 'boolean 1239 :type 'boolean
@@ -1179,19 +1250,20 @@ See also `mh-reply'."
1179(defcustom mh-refile-preserves-sequences-flag t 1250(defcustom mh-refile-preserves-sequences-flag t
1180 "*Non-nil means that sequences are preserved when messages are refiled. 1251 "*Non-nil means that sequences are preserved when messages are refiled.
1181 1252
1182If a message is in any sequence (except \"Previous-Sequence:\" and \"cur\") 1253If a message is in any sequence (except \"Previous-Sequence:\"
1183when it is refiled, then it will still be in those sequences in the 1254and \"cur\") when it is refiled, then it will still be in those
1184destination folder. If this behavior is not desired, then turn off this 1255sequences in the destination folder. If this behavior is not
1185option." 1256desired, then turn off this option."
1186 :type 'boolean 1257 :type 'boolean
1187 :group 'mh-sequences) 1258 :group 'mh-sequences)
1188 1259
1189(defcustom mh-tick-seq 'tick 1260(defcustom mh-tick-seq 'tick
1190 "The name of the MH sequence for ticked messages. 1261 "The name of the MH sequence for ticked messages.
1191 1262
1192You can customize this option if you already use the \"tick\" sequence for 1263You can customize this option if you already use the \"tick\"
1193your own use. You can also disable all of the ticking functions by choosing 1264sequence for your own use. You can also disable all of the
1194the \"Disable Ticking\" item but there isn't much advantage to that." 1265ticking functions by choosing the \"Disable Ticking\" item but
1266there isn't much advantage to that."
1195 :type '(choice (const :tag "Disable Ticking" nil) 1267 :type '(choice (const :tag "Disable Ticking" nil)
1196 symbol) 1268 symbol)
1197 :group 'mh-sequences) 1269 :group 'mh-sequences)
@@ -1199,13 +1271,14 @@ the \"Disable Ticking\" item but there isn't much advantage to that."
1199(defcustom mh-update-sequences-after-mh-show-flag t 1271(defcustom mh-update-sequences-after-mh-show-flag t
1200 "*Non-nil means flush MH sequences to disk after message is shown. 1272 "*Non-nil means flush MH sequences to disk after message is shown.
1201 1273
1202Three sequences are maintained internally by MH-E and pushed out to MH when a 1274Three sequences are maintained internally by MH-E and pushed out
1203message is shown. They include the sequence specified by your 1275to MH when a message is shown. They include the sequence
1204\"Unseen-Sequence:\" profile entry, \"cur\", and the sequence listed by the 1276specified by your \"Unseen-Sequence:\" profile entry, \"cur\",
1205option `mh-tick-seq' which is \"tick\" by default. If you do not like this 1277and the sequence listed by the option `mh-tick-seq' which is
1206behavior, turn off this option. You can then update the state manually with 1278\"tick\" by default. If you do not like this behavior, turn off
1207the `\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]' 1279this option. You can then update the state manually with the
1208commands." 1280`\\[mh-execute-commands]', `\\[mh-quit]', or
1281`\\[mh-update-sequences]' commands."
1209 :type 'boolean 1282 :type 'boolean
1210 :group 'mh-sequences) 1283 :group 'mh-sequences)
1211 1284
@@ -1216,10 +1289,10 @@ commands."
1216(defcustom mh-bury-show-buffer-flag t 1289(defcustom mh-bury-show-buffer-flag t
1217 "*Non-nil means show buffer is buried. 1290 "*Non-nil means show buffer is buried.
1218 1291
1219One advantage of not burying the show buffer is that one can delete the show 1292One advantage of not burying the show buffer is that one can
1220buffer more easily in an electric buffer list because of its proximity to its 1293delete the show buffer more easily in an electric buffer list
1221associated MH-Folder buffer. Try running \\[electric-buffer-list] to see what 1294because of its proximity to its associated MH-Folder buffer. Try
1222I mean." 1295running \\[electric-buffer-list] to see what I mean."
1223 :type 'boolean 1296 :type 'boolean
1224 :group 'mh-show) 1297 :group 'mh-show)
1225 1298
@@ -1234,45 +1307,47 @@ See also `mh-invisible-header-fields-default' and
1234(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode"))) 1307(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
1235 "*Non-nil means attachments are handled\\<mh-folder-mode-map>. 1308 "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
1236 1309
1237MH-E can handle attachments as well if the Gnus `mm-decode' library is 1310MH-E can handle attachments as well if the Gnus `mm-decode'
1238present. If so, this option will be on. Otherwise, you'll see the MIME body 1311library is present. If so, this option will be on. Otherwise,
1239parts rather than text or attachments. There isn't much point in turning off 1312you'll see the MIME body parts rather than text or attachments.
1240this option; however, you can inspect it if it appears that the body parts are 1313There isn't much point in turning off this option; however, you
1241not being interpreted correctly or toggle it with the command 1314can inspect it if it appears that the body parts are not being
1315interpreted correctly or toggle it with the command
1242\\[mh-toggle-mh-decode-mime-flag] to view the raw message. 1316\\[mh-toggle-mh-decode-mime-flag] to view the raw message.
1243 1317
1244This option also controls the display of quoted-printable messages and other 1318This option also controls the display of quoted-printable
1245graphical widgets. See the options `mh-graphical-smileys-flag' and 1319messages and other graphical widgets. See the options
1246`mh-graphical-emphasis-flag'." 1320`mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'."
1247 :type 'boolean 1321 :type 'boolean
1248 :group 'mh-show) 1322 :group 'mh-show)
1249 1323
1250(defcustom mh-display-buttons-for-alternatives-flag nil 1324(defcustom mh-display-buttons-for-alternatives-flag nil
1251 "*Non-nil means display buttons for all alternative attachments. 1325 "*Non-nil means display buttons for all alternative attachments.
1252 1326
1253Sometimes, a mail program will produce multiple alternatives of the attachment 1327Sometimes, a mail program will produce multiple alternatives of
1254in increasing degree of faithfulness to the original content. By default, only 1328the attachment in increasing degree of faithfulness to the
1255the preferred alternative is displayed. If this option is on, then the 1329original content. By default, only the preferred alternative is
1256preferred part is shown inline and buttons are shown for each of the other 1330displayed. If this option is on, then the preferred part is shown
1257alternatives." 1331inline and buttons are shown for each of the other alternatives."
1258 :type 'boolean 1332 :type 'boolean
1259 :group 'mh-show) 1333 :group 'mh-show)
1260 1334
1261(defcustom mh-display-buttons-for-inline-parts-flag nil 1335(defcustom mh-display-buttons-for-inline-parts-flag nil
1262 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>. 1336 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
1263 1337
1264The sender can request that attachments should be viewed inline so that they 1338The sender can request that attachments should be viewed inline so
1265do not really appear like an attachment at all to the reader. Most of the 1339that they do not really appear like an attachment at all to the
1266time, this is desirable, so by default MH-E suppresses the buttons for inline 1340reader. Most of the time, this is desirable, so by default MH-E
1267attachments. On the other hand, you may receive code or HTML which the sender 1341suppresses the buttons for inline attachments. On the other hand, you
1268has added to his message as inline attachments so that you can read them in 1342may receive code or HTML which the sender has added to his message as
1269MH-E. In this case, it is useful to see the buttons so that you know you don't 1343inline attachments so that you can read them in MH-E. In this case, it
1270have to cut and paste the code into a file; you can simply save the 1344is useful to see the buttons so that you know you don't have to cut
1271attachment. 1345and paste the code into a file; you can simply save the attachment.
1272 1346
1273If you want to make the buttons visible for inline attachments, you can use 1347If you want to make the buttons visible for inline attachments, you
1274the command \\[mh-toggle-mime-buttons] to toggle the visibility of these 1348can use the command \\[mh-toggle-mime-buttons] to toggle the
1275buttons. You can turn on these buttons permanently by turning on this option. 1349visibility of these buttons. You can turn on these buttons permanently
1350by turning on this option.
1276 1351
1277MH-E cannot display all attachments inline however. It can display 1352MH-E cannot display all attachments inline however. It can display
1278text (including HTML) and images." 1353text (including HTML) and images."
@@ -1282,42 +1357,44 @@ text (including HTML) and images."
1282(defcustom mh-do-not-confirm-flag nil 1357(defcustom mh-do-not-confirm-flag nil
1283 "*Non-nil means non-reversible commands do not prompt for confirmation. 1358 "*Non-nil means non-reversible commands do not prompt for confirmation.
1284 1359
1285Commands such as `mh-pack-folder' prompt to confirm whether to process 1360Commands such as `mh-pack-folder' prompt to confirm whether to
1286outstanding moves and deletes or not before continuing. Turning on this option 1361process outstanding moves and deletes or not before continuing.
1287means that these actions will be performed--which is usually desired but 1362Turning on this option means that these actions will be
1288cannot be retracted--without question." 1363performed--which is usually desired but cannot be
1364retracted--without question."
1289 :type 'boolean 1365 :type 'boolean
1290 :group 'mh-show) 1366 :group 'mh-show)
1291 1367
1292(defcustom mh-fetch-x-image-url nil 1368(defcustom mh-fetch-x-image-url nil
1293 "*Control fetching of \"X-Image-URL:\" header field image. 1369 "*Control fetching of \"X-Image-URL:\" header field image.
1294 1370
1295Ths option controls the fetching of the \"X-Image-URL:\" header field image 1371Ths option controls the fetching of the \"X-Image-URL:\" header
1296with the following values: 1372field image with the following values:
1297 1373
1298Ask Before Fetching 1374Ask Before Fetching
1299 You are prompted before the image is fetched. MH-E will remember 1375 You are prompted before the image is fetched. MH-E will
1300 your reply and will either use the already fetched image the next 1376 remember your reply and will either use the already fetched
1301 time the same URL is encountered or silently skip it if you didn't 1377 image the next time the same URL is encountered or silently
1302 fetch it the first time. This is a good setting. 1378 skip it if you didn't fetch it the first time. This is a
1379 good setting.
1303 1380
1304Never Fetch 1381Never Fetch
1305 Images are never fetched and only displayed if they are already 1382 Images are never fetched and only displayed if they are
1306 present in the cache. This is the default. 1383 already present in the cache. This is the default.
1307 1384
1308There isn't a value of \"Always Fetch\" for privacy and DOS (denial of 1385There isn't a value of \"Always Fetch\" for privacy and DOS (denial of
1309service) reasons. For example, fetching a URL can tip off a spammer that 1386service) reasons. For example, fetching a URL can tip off a spammer
1310you've read his email (which is why you shouldn't blindly answer yes if you've 1387that you've read his email (which is why you shouldn't blindly answer
1311set this option to \"Ask Before Fetching\"). Someone may also flood your 1388yes if you've set this option to \"Ask Before Fetching\"). Someone may
1312network and fill your disk drive by sending a torrent of messages, each 1389also flood your network and fill your disk drive by sending a torrent
1313specifying a unique URL to a very large file. 1390of messages, each specifying a unique URL to a very large file.
1314 1391
1315The cache of images is found in the directory \".mhe-x-image-cache\" within 1392The cache of images is found in the directory \".mhe-x-image-cache\"
1316your MH directory. You can add your own face to the \"From:\" field too. See 1393within your MH directory. You can add your own face to the \"From:\"
1317Info node `(mh-e)Picture'. 1394field too. See Info node `(mh-e)Picture'.
1318 1395
1319This setting only has effect if the option `mh-show-use-xface-flag' is turned 1396This setting only has effect if the option `mh-show-use-xface-flag' is
1320on." 1397turned on."
1321 1398
1322 :type '(choice (const :tag "Ask Before Fetching" ask) 1399 :type '(choice (const :tag "Ask Before Fetching" ask)
1323 (const :tag "Never Fetch" nil)) 1400 (const :tag "Never Fetch" nil))
@@ -1326,37 +1403,42 @@ on."
1326(defcustom mh-graphical-smileys-flag t 1403(defcustom mh-graphical-smileys-flag t
1327 "*Non-nil means graphical smileys are displayed. 1404 "*Non-nil means graphical smileys are displayed.
1328 1405
1329It is a long standing custom to inject body language using a cornucopia of 1406It is a long standing custom to inject body language using a
1330punctuation, also known as the \"smileys\". MH-E can render these as graphical 1407cornucopia of punctuation, also known as the \"smileys\". MH-E
1331widgets if this option is turned on, which it is by default. Smileys include 1408can render these as graphical widgets if this option is turned
1332patterns such as :-) and ;-). 1409on, which it is by default. Smileys include patterns such as :-)
1410and ;-).
1333 1411
1334This option is disabled if the option `mh-decode-mime-flag' is turned off." 1412This option is disabled if the option `mh-decode-mime-flag' is
1413turned off."
1335 :type 'boolean 1414 :type 'boolean
1336 :group 'mh-show) 1415 :group 'mh-show)
1337 1416
1338(defcustom mh-graphical-emphasis-flag t 1417(defcustom mh-graphical-emphasis-flag t
1339 "*Non-nil means graphical emphasis is displayed. 1418 "*Non-nil means graphical emphasis is displayed.
1340 1419
1341A few typesetting features are indicated in ASCII text with certain 1420A few typesetting features are indicated in ASCII text with
1342characters. If your terminal supports it, MH-E can render these typesetting 1421certain characters. If your terminal supports it, MH-E can render
1343directives naturally if this option is turned on, which it is by default. For 1422these typesetting directives naturally if this option is turned
1344example, _underline_ will be underlined, *bold* will appear in bold, /italics/ 1423on, which it is by default. For example, _underline_ will be
1345will appear in italics, and so on. See the option `gnus-emphasis-alist' for 1424underlined, *bold* will appear in bold, /italics/ will appear in
1346the whole list. 1425italics, and so on. See the option `gnus-emphasis-alist' for the
1426whole list.
1347 1427
1348This option is disabled if the option `mh-decode-mime-flag' is turned off." 1428This option is disabled if the option `mh-decode-mime-flag' is
1429turned off."
1349 :type 'boolean 1430 :type 'boolean
1350 :group 'mh-show) 1431 :group 'mh-show)
1351 1432
1352(defcustom mh-highlight-citation-style 'gnus 1433(defcustom mh-highlight-citation-style 'gnus
1353 "Style for highlighting citations. 1434 "Style for highlighting citations.
1354 1435
1355If the sender of the message has cited other messages in his message, then 1436If the sender of the message has cited other messages in his
1356MH-E will highlight these citations to emphasize the sender's actual response. 1437message, then MH-E will highlight these citations to emphasize
1357This option can be customized to change the highlighting style. The 1438the sender's actual response. This option can be customized to
1358\"Multicolor\" method uses a different color for each indentation while the 1439change the highlighting style. The \"Multicolor\" method uses a
1359\"Monochrome\" method highlights all citations in red. To disable highlighting 1440different color for each indentation while the \"Monochrome\"
1441method highlights all citations in red. To disable highlighting
1360of citations entirely, choose \"None\"." 1442of citations entirely, choose \"None\"."
1361 :type '(choice (const :tag "Multicolor" gnus) 1443 :type '(choice (const :tag "Multicolor" gnus)
1362 (const :tag "Monochrome" font-lock) 1444 (const :tag "Monochrome" font-lock)
@@ -1538,9 +1620,11 @@ of citations entirely, choose \"None\"."
1538 "X400-" ; X400 1620 "X400-" ; X400
1539 "Xref:") 1621 "Xref:")
1540 "List of default header fields that are not to be shown. 1622 "List of default header fields that are not to be shown.
1541Do not alter this variable directly. Instead, add entries from here that you 1623
1542would like to be displayed in `mh-invisible-header-fields-default' 1624Do not alter this variable directly. Instead, add entries from
1543and add entries to hide in `mh-invisible-header-fields'.") 1625here that you would like to be displayed in
1626`mh-invisible-header-fields-default' and add entries to hide in
1627`mh-invisible-header-fields'.")
1544 1628
1545(defvar mh-invisible-header-fields-compiled nil 1629(defvar mh-invisible-header-fields-compiled nil
1546 "*Regexp matching lines in a message header that are not to be shown. 1630 "*Regexp matching lines in a message header that are not to be shown.
@@ -1551,9 +1635,9 @@ hidden that you wish to display, and add extra entries to hide in
1551 1635
1552(defun mh-invisible-headers () 1636(defun mh-invisible-headers ()
1553 "Make or remake the variable `mh-invisible-header-fields-compiled'. 1637 "Make or remake the variable `mh-invisible-header-fields-compiled'.
1554Done using `mh-invisible-header-fields-internal' as input, from which entries 1638Done using `mh-invisible-header-fields-internal' as input, from
1555from `mh-invisible-header-fields-default' are removed and entries 1639which entries from `mh-invisible-header-fields-default' are
1556from `mh-invisible-header-fields' are added." 1640removed and entries from `mh-invisible-header-fields' are added."
1557 (let ((fields mh-invisible-header-fields-internal)) 1641 (let ((fields mh-invisible-header-fields-internal))
1558 (when mh-invisible-header-fields-default 1642 (when mh-invisible-header-fields-default
1559 ;; Remove entries from `mh-invisible-header-fields-default' 1643 ;; Remove entries from `mh-invisible-header-fields-default'
@@ -1577,11 +1661,11 @@ from `mh-invisible-header-fields' are added."
1577(defcustom mh-invisible-header-fields-default nil 1661(defcustom mh-invisible-header-fields-default nil
1578 "*List of hidden header fields. 1662 "*List of hidden header fields.
1579 1663
1580The header fields listed in this option are hidden, although you can check off 1664The header fields listed in this option are hidden, although you
1581any field that you would like to see. 1665can check off any field that you would like to see.
1582 1666
1583Header fields that you would like to hide that aren't listed can be added to 1667Header fields that you would like to hide that aren't listed can
1584the option `mh-invisible-header-fields'. 1668be added to the option `mh-invisible-header-fields'.
1585 1669
1586See also `mh-clean-message-header-flag'." 1670See also `mh-clean-message-header-flag'."
1587 :type `(set ,@(mapcar (lambda (x) `(const ,x)) 1671 :type `(set ,@(mapcar (lambda (x) `(const ,x))
@@ -1595,11 +1679,12 @@ See also `mh-clean-message-header-flag'."
1595 "*Additional header fields to hide. 1679 "*Additional header fields to hide.
1596 1680
1597Header fields that you would like to hide that aren't listed in 1681Header fields that you would like to hide that aren't listed in
1598`mh-invisible-header-fields-default' can be added to this option with a couple 1682`mh-invisible-header-fields-default' can be added to this option
1599of caveats. Regular expressions are not allowed. Unique fields should have a 1683with a couple of caveats. Regular expressions are not allowed.
1600`:' suffix; otherwise, the element can be used to render invisible an entire 1684Unique fields should have a `:' suffix; otherwise, the element
1601class of fields that start with the same prefix. If you think a header field 1685can be used to render invisible an entire class of fields that
1602should be generally ignored, report a bug (see URL 1686start with the same prefix. If you think a header field should be
1687generally ignored, report a bug (see URL
1603`https://sourceforge.net/tracker/?group_id=13357&atid=113357'). 1688`https://sourceforge.net/tracker/?group_id=13357&atid=113357').
1604 1689
1605See also `mh-clean-message-header-flag'." 1690See also `mh-clean-message-header-flag'."
@@ -1613,12 +1698,13 @@ See also `mh-clean-message-header-flag'."
1613(defcustom mh-lpr-command-format "lpr -J '%s'" 1698(defcustom mh-lpr-command-format "lpr -J '%s'"
1614 "*Command used to print\\<mh-folder-mode-map>. 1699 "*Command used to print\\<mh-folder-mode-map>.
1615 1700
1616This option contains the Unix command line which performs the actual printing 1701This option contains the Unix command line which performs the
1617for the \\[mh-print-msg] command. The string can contain one escape, \"%s\", 1702actual printing for the \\[mh-print-msg] command. The string can
1618which is replaced by the name of the folder and the message number and is 1703contain one escape, \"%s\", which is replaced by the name of the
1619useful for print job names. I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" 1704folder and the message number and is useful for print job names.
1620which produces a nice header and adds a bit of margin so the text fits within 1705I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" which produces a
1621my printer's margins. 1706nice header and adds a bit of margin so the text fits within my
1707printer's margins.
1622 1708
1623This options is not used by the commands \\[mh-ps-print-msg] or 1709This options is not used by the commands \\[mh-ps-print-msg] or
1624\\[mh-ps-print-msg-file]." 1710\\[mh-ps-print-msg-file]."
@@ -1628,48 +1714,51 @@ This options is not used by the commands \\[mh-ps-print-msg] or
1628(defcustom mh-max-inline-image-height nil 1714(defcustom mh-max-inline-image-height nil
1629 "*Maximum inline image height if \"Content-Disposition:\" is not present. 1715 "*Maximum inline image height if \"Content-Disposition:\" is not present.
1630 1716
1631Some older mail programs do not insert this needed plumbing to tell 1717Some older mail programs do not insert this needed plumbing to
1632MH-E whether to display the attachments inline or not. If this is the 1718tell MH-E whether to display the attachments inline or not. If
1633case, MH-E will display these images inline if they are smaller than 1719this is the case, MH-E will display these images inline if they
1634the window. However, you might want to allow larger images to be 1720are smaller than the window. However, you might want to allow
1635displayed inline. To do this, you can change the options 1721larger images to be displayed inline. To do this, you can change
1636`mh-max-inline-image-width' and `mh-max-inline-image-height' from their 1722the options `mh-max-inline-image-width' and
1637default value of zero to a large number. The size of your screen is a 1723`mh-max-inline-image-height' from their default value of zero to
1638good choice for these numbers." 1724a large number. The size of your screen is a good choice for
1725these numbers."
1639 :type '(choice (const nil) integer) 1726 :type '(choice (const nil) integer)
1640 :group 'mh-show) 1727 :group 'mh-show)
1641 1728
1642(defcustom mh-max-inline-image-width nil 1729(defcustom mh-max-inline-image-width nil
1643 "*Maximum inline image width if \"Content-Disposition:\" is not present. 1730 "*Maximum inline image width if \"Content-Disposition:\" is not present.
1644 1731
1645Some older mail programs do not insert this needed plumbing to tell 1732Some older mail programs do not insert this needed plumbing to
1646MH-E whether to display the attachments inline or not. If this is the 1733tell MH-E whether to display the attachments inline or not. If
1647case, MH-E will display these images inline if they are smaller than 1734this is the case, MH-E will display these images inline if they
1648the window. However, you might want to allow larger images to be 1735are smaller than the window. However, you might want to allow
1649displayed inline. To do this, you can change the options 1736larger images to be displayed inline. To do this, you can change
1650`mh-max-inline-image-width' and `mh-max-inline-image-height' from their 1737the options `mh-max-inline-image-width' and
1651default value of zero to a large number. The size of your screen is a 1738`mh-max-inline-image-height' from their default value of zero to
1652good choice for these numbers." 1739a large number. The size of your screen is a good choice for
1740these numbers."
1653 :type '(choice (const nil) integer) 1741 :type '(choice (const nil) integer)
1654 :group 'mh-show) 1742 :group 'mh-show)
1655 1743
1656(defcustom mh-mhl-format-file nil 1744(defcustom mh-mhl-format-file nil
1657 "*Specifies the format file to pass to the \"mhl\" program. 1745 "*Specifies the format file to pass to the \"mhl\" program.
1658 1746
1659Normally MH-E takes care of displaying messages itself (rather than calling an 1747Normally MH-E takes care of displaying messages itself (rather than
1660MH program to do the work). If you'd rather have \"mhl\" display the 1748calling an MH program to do the work). If you'd rather have \"mhl\"
1661message (within MH-E), change this option from its default value of \"Use 1749display the message (within MH-E), change this option from its default
1662Default mhl Format (Printing Only)\". 1750value of \"Use Default mhl Format (Printing Only)\".
1663 1751
1664You can set this option to \"Use Default mhl Format\" to get the same output 1752You can set this option to \"Use Default mhl Format\" to get the same
1665as you would get if you ran \"mhl\" from the shell. 1753output as you would get if you ran \"mhl\" from the shell.
1666 1754
1667If you have a format file that you want MH-E to use, you can set this option 1755If you have a format file that you want MH-E to use, you can set this
1668to \"Specify an mhl Format File\" and enter the name of your format file. Your 1756option to \"Specify an mhl Format File\" and enter the name of your
1669format file should specify a non-zero value for \"overflowoffset\" to allow 1757format file. Your format file should specify a non-zero value for
1670MH-E to parse the header. Note that \"mhl\" is always used for printing and 1758\"overflowoffset\" to allow MH-E to parse the header. Note that
1671forwarding; in this case, the value of this option is consulted if you have 1759\"mhl\" is always used for printing and forwarding; in this case, the
1672specified a format file." 1760value of this option is consulted if you have specified a format
1761file."
1673 :type '(choice (const :tag "Use Default mhl Format (Printing Only)" nil) 1762 :type '(choice (const :tag "Use Default mhl Format (Printing Only)" nil)
1674 (const :tag "Use Default mhl Format" t) 1763 (const :tag "Use Default mhl Format" t)
1675 (file :tag "Specify an mhl Format File")) 1764 (file :tag "Specify an mhl Format File"))
@@ -1678,12 +1767,13 @@ specified a format file."
1678(defcustom mh-mime-save-parts-default-directory t 1767(defcustom mh-mime-save-parts-default-directory t
1679 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts]. 1768 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
1680 1769
1681The default value for this option is \"Prompt Always\" so that you are always 1770The default value for this option is \"Prompt Always\" so that
1682prompted for the directory in which to save the attachments. However, if you 1771you are always prompted for the directory in which to save the
1683usually use the same directory within a session, then you can set this option 1772attachments. However, if you usually use the same directory
1684to \"Prompt the First Time\" to avoid the prompt each time. you can make this 1773within a session, then you can set this option to \"Prompt the
1685directory permanent by choosing \"Directory\" and entering the directory's 1774First Time\" to avoid the prompt each time. you can make this
1686name." 1775directory permanent by choosing \"Directory\" and entering the
1776directory's name."
1687 :type '(choice (const :tag "Prompt the First Time" nil) 1777 :type '(choice (const :tag "Prompt the First Time" nil)
1688 (const :tag "Prompt Always" t) 1778 (const :tag "Prompt Always" t)
1689 directory) 1779 directory)
@@ -1692,11 +1782,12 @@ name."
1692(defcustom mh-print-background-flag nil 1782(defcustom mh-print-background-flag nil
1693 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>. 1783 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
1694 1784
1695Normally messages are printed in the foreground. If this is slow on your 1785Normally messages are printed in the foreground. If this is slow on
1696system, you may elect to turn off this option to print in the background. 1786your system, you may elect to turn off this option to print in the
1787background.
1697 1788
1698WARNING: If you do this, do not delete the message until it is printed or else 1789WARNING: If you do this, do not delete the message until it is printed
1699the output may be truncated. 1790or else the output may be truncated.
1700 1791
1701This option is not used by the commands \\[mh-ps-print-msg] or 1792This option is not used by the commands \\[mh-ps-print-msg] or
1702\\[mh-ps-print-msg-file]." 1793\\[mh-ps-print-msg-file]."
@@ -1706,9 +1797,9 @@ This option is not used by the commands \\[mh-ps-print-msg] or
1706(defcustom mh-show-maximum-size 0 1797(defcustom mh-show-maximum-size 0
1707 "*Maximum size of message (in bytes) to display automatically. 1798 "*Maximum size of message (in bytes) to display automatically.
1708 1799
1709This option provides an opportunity to skip over large messages which may be 1800This option provides an opportunity to skip over large messages
1710slow to load. The default value of 0 means that all message are shown 1801which may be slow to load. The default value of 0 means that all
1711regardless of size." 1802message are shown regardless of size."
1712 :type 'integer 1803 :type 'integer
1713 :group 'mh-show) 1804 :group 'mh-show)
1714 1805
@@ -1716,12 +1807,12 @@ regardless of size."
1716 goto-address-highlight-p) 1807 goto-address-highlight-p)
1717 "*Non-nil means highlight URLs and email addresses\\<goto-address-highlight-keymap>. 1808 "*Non-nil means highlight URLs and email addresses\\<goto-address-highlight-keymap>.
1718 1809
1719To send a message using the highlighted email address or to view the web page 1810To send a message using the highlighted email address or to view
1720for the highlighted URL, use the middle mouse button or 1811the web page for the highlighted URL, use the middle mouse button
1721\\[goto-address-at-point]. 1812or \\[goto-address-at-point].
1722 1813
1723See Info node `(mh-e)Sending Mail' to see how to configure Emacs to send the 1814See Info node `(mh-e)Sending Mail' to see how to configure Emacs
1724message using MH-E. 1815to send the message using MH-E.
1725 1816
1726The default value of this option comes from the value of 1817The default value of this option comes from the value of
1727`goto-address-highlight-p'." 1818`goto-address-highlight-p'."
@@ -1731,33 +1822,36 @@ The default value of this option comes from the value of
1731(defcustom mh-show-use-xface-flag (>= emacs-major-version 21) 1822(defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
1732 "*Non-nil means display face images in MH-show buffers. 1823 "*Non-nil means display face images in MH-show buffers.
1733 1824
1734MH-E can display the content of \"Face:\", \"X-Face:\", and \"X-Image-URL:\" 1825MH-E can display the content of \"Face:\", \"X-Face:\", and
1735header fields. If any of these fields occur in the header of your message, the 1826\"X-Image-URL:\" header fields. If any of these fields occur in the
1736sender's face will appear in the \"From:\" header field. If more than one of 1827header of your message, the sender's face will appear in the \"From:\"
1737these fields appear, then the first field found in the order \"Face:\", 1828header field. If more than one of these fields appear, then the first
1738\"X-Face:\", and \"X-Image-URL:\" will be used. 1829field found in the order \"Face:\", \"X-Face:\", and \"X-Image-URL:\"
1739 1830will be used.
1740The option `mh-show-use-xface-flag' is used to turn this feature on and off. 1831
1741This feature will be turned on by default if your system supports it. 1832The option `mh-show-use-xface-flag' is used to turn this feature on
1742 1833and off. This feature will be turned on by default if your system
1743The first header field used, if present, is the Gnus-specific \"Face:\" field. 1834supports it.
1744The \"Face:\" field appeared in GNU Emacs 21 and XEmacs. For more information, 1835
1745see URL `http://quimby.gnus.org/circus/face/'. Next is the traditional 1836The first header field used, if present, is the Gnus-specific
1837\"Face:\" field. The \"Face:\" field appeared in GNU Emacs 21 and
1838XEmacs. For more information, see URL
1839`http://quimby.gnus.org/circus/face/'. Next is the traditional
1746\"X-Face:\" header field. The display of this field requires the 1840\"X-Face:\" header field. The display of this field requires the
1747\"uncompface\" program (see URL 1841\"uncompface\" program (see URL
1748`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.z'). Recent versions 1842`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.z'). Recent
1749of XEmacs have internal support for \"X-Face:\" images. If your version of 1843versions of XEmacs have internal support for \"X-Face:\" images. If
1750XEmacs does not, then you'll need both \"uncompface\" and the x-face 1844your version of XEmacs does not, then you'll need both \"uncompface\"
1751package (see URL `ftp://ftp.jpl.org/pub/elisp/'). 1845and the x-face package (see URL `ftp://ftp.jpl.org/pub/elisp/').
1752 1846
1753Finally, MH-E will display images referenced by the \"X-Image-URL:\" header 1847Finally, MH-E will display images referenced by the \"X-Image-URL:\"
1754field if neither the \"Face:\" nor the \"X-Face:\" fields are present. The 1848header field if neither the \"Face:\" nor the \"X-Face:\" fields are
1755display of the images requires \"wget\" (see URL 1849present. The display of the images requires \"wget\" (see URL
1756`http://www.gnu.org/software/wget/wget.html'), \"fetch\", or \"curl\" to fetch 1850`http://www.gnu.org/software/wget/wget.html'), \"fetch\", or \"curl\"
1757the image and the \"convert\" program from the ImageMagick suite (see URL 1851to fetch the image and the \"convert\" program from the ImageMagick
1758`http://www.imagemagick.org/'). Of the three header fields this is the most 1852suite (see URL `http://www.imagemagick.org/'). Of the three header
1759efficient in terms of network usage since the image doesn't need to be 1853fields this is the most efficient in terms of network usage since the
1760transmitted with every single mail. 1854image doesn't need to be transmitted with every single mail.
1761 1855
1762The option `mh-fetch-x-image-url' controls the fetching of the 1856The option `mh-fetch-x-image-url' controls the fetching of the
1763\"X-Image-URL:\" header field image." 1857\"X-Image-URL:\" header field image."
@@ -1767,9 +1861,10 @@ The option `mh-fetch-x-image-url' controls the fetching of the
1767(defcustom mh-store-default-directory nil 1861(defcustom mh-store-default-directory nil
1768 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg]. 1862 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
1769 1863
1770If you would like to change the initial default directory, customize this 1864If you would like to change the initial default directory,
1771option, change the value from `Current' to `Directory', and then enter the 1865customize this option, change the value from `Current' to
1772name of the directory for storing the content of these messages." 1866`Directory', and then enter the name of the directory for storing
1867the content of these messages."
1773 :type '(choice (const :tag "Current" nil) 1868 :type '(choice (const :tag "Current" nil)
1774 directory) 1869 directory)
1775 :group 'mh-show) 1870 :group 'mh-show)
@@ -1777,10 +1872,11 @@ name of the directory for storing the content of these messages."
1777(defcustom mh-summary-height nil 1872(defcustom mh-summary-height nil
1778 "*Number of lines in MH-Folder buffer (including the mode line). 1873 "*Number of lines in MH-Folder buffer (including the mode line).
1779 1874
1780The default value of this option is \"Automatic\" which means that the 1875The default value of this option is \"Automatic\" which means
1781MH-Folder buffer will maintain the same proportional size if the frame is 1876that the MH-Folder buffer will maintain the same proportional
1782resized. If you'd prefer a fixed height, then choose the \"Fixed Size\" option 1877size if the frame is resized. If you'd prefer a fixed height,
1783and enter the number of lines you'd like to see." 1878then choose the \"Fixed Size\" option and enter the number of
1879lines you'd like to see."
1784 :type '(choice (const :tag "Automatic" nil) 1880 :type '(choice (const :tag "Automatic" nil)
1785 (integer :tag "Fixed Size")) 1881 (integer :tag "Fixed Size"))
1786 :group 'mh-show) 1882 :group 'mh-show)
@@ -1802,9 +1898,10 @@ Set to 0 to disable automatic update."
1802(defcustom mh-show-threads-flag nil 1898(defcustom mh-show-threads-flag nil
1803 "*Non-nil means new folders start in threaded mode. 1899 "*Non-nil means new folders start in threaded mode.
1804 1900
1805Threading large number of messages can be time consuming so this option is 1901Threading large number of messages can be time consuming so this
1806turned off by default. If you turn this option on, then threading will be done 1902option is turned off by default. If you turn this option on, then
1807only if the number of messages being threaded is less than `mh-large-folder'." 1903threading will be done only if the number of messages being
1904threaded is less than `mh-large-folder'."
1808 :type 'boolean 1905 :type 'boolean
1809 :group 'mh-thread) 1906 :group 'mh-thread)
1810 1907
@@ -1816,8 +1913,8 @@ only if the number of messages being threaded is less than `mh-large-folder'."
1816 "*Function called by the tool bar search button. 1913 "*Function called by the tool bar search button.
1817 1914
1818Available functions include `mh-search-folder', the default, and 1915Available functions include `mh-search-folder', the default, and
1819`mh-index-search'. You can also choose \"Other Function\" from the \"Value 1916`mh-index-search'. You can also choose \"Other Function\" from
1820Menu\" and enter a function of your own choosing." 1917the \"Value Menu\" and enter a function of your own choosing."
1821 :type '(choice (const mh-search-folder) 1918 :type '(choice (const mh-search-folder)
1822 (const mh-index-search) 1919 (const mh-index-search)
1823 (function :tag "Other Function")) 1920 (function :tag "Other Function"))
@@ -1849,7 +1946,7 @@ Optional argument ARG is not used."
1849 1946
1850(defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag) 1947(defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
1851 "Generate FUNCTION that replies to RECIPIENT. 1948 "Generate FUNCTION that replies to RECIPIENT.
1852If FOLDER-BUFFER-FLAG is nil then the function generated 1949If FOLDER-BUFFER-FLAG is nil then the function generated...
1853When INCLUDE-FLAG is non-nil, include message body being replied to." 1950When INCLUDE-FLAG is non-nil, include message body being replied to."
1854 `(defun ,function (&optional arg) 1951 `(defun ,function (&optional arg)
1855 ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply." 1952 ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply."
@@ -1870,9 +1967,10 @@ When INCLUDE-FLAG is non-nil, include message body being replied to."
1870 (defcustom mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag 1967 (defcustom mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
1871 "*If non-nil, use tool bar. 1968 "*If non-nil, use tool bar.
1872 1969
1873This option controls whether to show the MH-E icons at all. By default, this 1970This option controls whether to show the MH-E icons at all. By
1874option is turned on if the window system supports tool bars. If your system 1971default, this option is turned on if the window system supports
1875doesn't support tool bars, then you won't be able to turn on this option." 1972tool bars. If your system doesn't support tool bars, then you
1973won't be able to turn on this option."
1876 :type 'boolean 1974 :type 'boolean
1877 :group 'mh-tool-bar 1975 :group 'mh-tool-bar
1878 :set (lambda (symbol value) 1976 :set (lambda (symbol value)
@@ -1884,11 +1982,12 @@ doesn't support tool bars, then you won't be able to turn on this option."
1884 (defcustom mh-xemacs-tool-bar-position nil 1982 (defcustom mh-xemacs-tool-bar-position nil
1885 "*Tool bar location. 1983 "*Tool bar location.
1886 1984
1887This option controls the placement of the tool bar along the four edges of the 1985This option controls the placement of the tool bar along the four
1888frame. You can choose from one of \"Same As Default Tool Bar\", \"Top\", 1986edges of the frame. You can choose from one of \"Same As Default
1889\"Bottom\", \"Left\", or \"Right\". If this variable is set to anything other 1987Tool Bar\", \"Top\", \"Bottom\", \"Left\", or \"Right\". If this
1890than \"Same As Default Tool Bar\" and the default tool bar is in a different 1988variable is set to anything other than \"Same As Default Tool
1891location, then two tool bars will be displayed: the MH-E tool bar and the 1989Bar\" and the default tool bar is in a different location, then
1990two tool bars will be displayed: the MH-E tool bar and the
1892default tool bar." 1991default tool bar."
1893 :type '(radio (const :tag "Same As Default Tool Bar" :value nil) 1992 :type '(radio (const :tag "Same As Default Tool Bar" :value nil)
1894 (const :tag "Top" :value top) 1993 (const :tag "Top" :value top)
@@ -1907,47 +2006,49 @@ default tool bar."
1907 2006
1908(defmacro mh-tool-bar-define (defaults &rest buttons) 2007(defmacro mh-tool-bar-define (defaults &rest buttons)
1909 "Define a tool bar for MH-E. 2008 "Define a tool bar for MH-E.
1910DEFAULTS is the list of buttons that are present by default. It is a list of 2009DEFAULTS is the list of buttons that are present by default. It
1911lists where the sublists are of the following form: 2010is a list of lists where the sublists are of the following form:
1912 2011
1913 (:KEYWORD FUNC1 FUNC2 FUNC3 ...) 2012 (:KEYWORD FUNC1 FUNC2 FUNC3 ...)
1914 2013
1915Here :KEYWORD is one of :folder or :letter. If it is :folder then the default 2014Here :KEYWORD is one of :folder or :letter. If it is :folder then
1916buttons in the folder and show mode buffers are being specified. If it is 2015the default buttons in the folder and show mode buffers are being
1917:letter then the default buttons in the letter mode are listed. FUNC1, FUNC2, 2016specified. If it is :letter then the default buttons in the
1918FUNC3, ... are the names of the functions that the buttons would execute. 2017letter mode are listed. FUNC1, FUNC2, FUNC3, ... are the names of
2018the functions that the buttons would execute.
1919 2019
1920Each element of BUTTONS is a list consisting of four mandatory items and one 2020Each element of BUTTONS is a list consisting of four mandatory
1921optional item as follows: 2021items and one optional item as follows:
1922 2022
1923 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR) 2023 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR)
1924 2024
1925where, 2025where,
1926 2026
1927 FUNCTION is the name of the function that will be executed when the button 2027 FUNCTION is the name of the function that will be executed when
1928 is clicked. 2028 the button is clicked.
1929 2029
1930 MODES is a list of symbols. List elements must be from `folder', `letter' and 2030 MODES is a list of symbols. List elements must be from `folder',
1931 `sequence'. If `folder' is present then the button is available in the 2031 `letter' and `sequence'. If `folder' is present then the button is
1932 folder and show buffer. If the name of FUNCTION is of the form \"mh-foo\", 2032 available in the folder and show buffer. If the name of FUNCTION is
1933 where foo is some arbitrary string, then we check if the function 2033 of the form \"mh-foo\", where foo is some arbitrary string, then we
1934 `mh-show-foo' exists. If it exists then that function is used in the show 2034 check if the function `mh-show-foo' exists. If it exists then that
1935 buffer. Otherwise the original function `mh-foo' is used in the show buffer 2035 function is used in the show buffer. Otherwise the original function
1936 as well. Presence of `sequence' is handled similar to the above. The only 2036 `mh-foo' is used in the show buffer as well. Presence of `sequence'
1937 difference is that the button is shown only when the folder is narrowed to a 2037 is handled similar to the above. The only difference is that the
1938 sequence. If `letter' is present in MODES, then the button is available 2038 button is shown only when the folder is narrowed to a sequence. If
1939 during draft editing and runs FUNCTION when clicked. 2039 `letter' is present in MODES, then the button is available during
2040 draft editing and runs FUNCTION when clicked.
1940 2041
1941 ICON is the icon that is drawn in the button. 2042 ICON is the icon that is drawn in the button.
1942 2043
1943 DOC is the documentation for the button. It is used in tool-tips and in 2044 DOC is the documentation for the button. It is used in tool-tips and
1944 providing other help to the user. GNU Emacs uses only the first line of the 2045 in providing other help to the user. GNU Emacs uses only the first
1945 string. So the DOC should be formatted such that the first line is useful and 2046 line of the string. So the DOC should be formatted such that the
1946 complete without the rest of the string. 2047 first line is useful and complete without the rest of the string.
1947 2048
1948 Optional item ENABLE-EXPR is an arbitrary lisp expression. If it evaluates 2049 Optional item ENABLE-EXPR is an arbitrary lisp expression. If it
1949 to nil, then the button is deactivated, otherwise it is active. If is in't 2050 evaluates to nil, then the button is deactivated, otherwise it is
1950 present then the button is always active." 2051 active. If is in't present then the button is always active."
1951 ;; The following variable names have been carefully chosen to make code 2052 ;; The following variable names have been carefully chosen to make code
1952 ;; generation easier. Modifying the names should be done carefully. 2053 ;; generation easier. Modifying the names should be done carefully.
1953 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter 2054 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
@@ -2237,10 +2338,10 @@ This button runs `mh-previous-undeleted-msg'")
2237(defcustom mh-after-commands-processed-hook nil 2338(defcustom mh-after-commands-processed-hook nil
2238 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding requests. 2339 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding requests.
2239 2340
2240Variables that are useful in this hook include `mh-folders-changed', 2341Variables that are useful in this hook include
2241which lists which folders were affected by deletes and refiles. This 2342`mh-folders-changed', which lists which folders were affected by
2242list will always include the current folder, which is also available 2343deletes and refiles. This list will always include the current
2243in `mh-current-folder'." 2344folder, which is also available in `mh-current-folder'."
2244 :type 'hook 2345 :type 'hook
2245 :group 'mh-hooks 2346 :group 'mh-hooks
2246 :group 'mh-folder) 2347 :group 'mh-folder)
@@ -2254,9 +2355,9 @@ in `mh-current-folder'."
2254(defcustom mh-before-commands-processed-hook nil 2355(defcustom mh-before-commands-processed-hook nil
2255 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding requests. 2356 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding requests.
2256 2357
2257Variables that are useful in this hook include `mh-delete-list' and 2358Variables that are useful in this hook include `mh-delete-list'
2258`mh-refile-list' which can be used to see which changes will be made 2359and `mh-refile-list' which can be used to see which changes will
2259to the current folder, `mh-current-folder'." 2360be made to the current folder, `mh-current-folder'."
2260 :type 'hook 2361 :type 'hook
2261 :group 'mh-hooks 2362 :group 'mh-hooks
2262 :group 'mh-folder) 2363 :group 'mh-folder)
@@ -2264,9 +2365,9 @@ to the current folder, `mh-current-folder'."
2264(defcustom mh-before-quit-hook nil 2365(defcustom mh-before-quit-hook nil
2265 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E. 2366 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E.
2266 2367
2267This hook is called before the quit occurs, so you might use it to 2368This hook is called before the quit occurs, so you might use it
2268perform any MH-E operations; you could perform some query and abort 2369to perform any MH-E operations; you could perform some query and
2269the quit or call `mh-execute-commands', for example. 2370abort the quit or call `mh-execute-commands', for example.
2270 2371
2271See also `mh-quit-hook'." 2372See also `mh-quit-hook'."
2272 :type 'hook 2373 :type 'hook
@@ -2276,8 +2377,8 @@ See also `mh-quit-hook'."
2276(defcustom mh-before-send-letter-hook nil 2377(defcustom mh-before-send-letter-hook nil
2277 "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command. 2378 "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
2278 2379
2279For example, if you want to check your spelling in your message before 2380For example, if you want to check your spelling in your message
2280sending, add the `ispell-message' function." 2381before sending, add the `ispell-message' function."
2281 :type 'hook 2382 :type 'hook
2282 :options '(ispell-message) 2383 :options '(ispell-message)
2283 :group 'mh-hooks 2384 :group 'mh-hooks
@@ -2286,8 +2387,8 @@ sending, add the `ispell-message' function."
2286(defcustom mh-delete-msg-hook nil 2387(defcustom mh-delete-msg-hook nil
2287 "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion. 2388 "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
2288 2389
2289For example, a past maintainer of MH-E used this once when he kept 2390For example, a past maintainer of MH-E used this once when he
2290statistics on his mail usage." 2391kept statistics on his mail usage."
2291 :type 'hook 2392 :type 'hook
2292 :group 'mh-hooks 2393 :group 'mh-hooks
2293 :group 'mh-show) 2394 :group 'mh-show)
@@ -2296,8 +2397,8 @@ statistics on his mail usage."
2296 "Hook run by `mh-find-path' after reading the user's MH profile. 2397 "Hook run by `mh-find-path' after reading the user's MH profile.
2297 2398
2298This hook can be used the change the value of the variables that 2399This hook can be used the change the value of the variables that
2299`mh-find-path' sets if you need to run with different values between 2400`mh-find-path' sets if you need to run with different values
2300MH and MH-E." 2401between MH and MH-E."
2301 :type 'hook 2402 :type 'hook
2302 :group 'mh-hooks 2403 :group 'mh-hooks
2303 :group 'mh-e) 2404 :group 'mh-e)
@@ -2323,8 +2424,9 @@ MH and MH-E."
2323(defcustom mh-insert-signature-hook nil 2424(defcustom mh-insert-signature-hook nil
2324 "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted. 2425 "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted.
2325 2426
2326Hook functions may access the actual name of the file or the function 2427Hook functions may access the actual name of the file or the
2327used to insert the signature with `mh-signature-file-name'." 2428function used to insert the signature with
2429`mh-signature-file-name'."
2328 :type 'hook 2430 :type 'hook
2329 :group 'mh-hooks 2431 :group 'mh-hooks
2330 :group 'mh-letter) 2432 :group 'mh-letter)
@@ -2332,16 +2434,16 @@ used to insert the signature with `mh-signature-file-name'."
2332(defcustom mh-kill-folder-suppress-prompt-hooks '(mh-index-p) 2434(defcustom mh-kill-folder-suppress-prompt-hooks '(mh-index-p)
2333 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder]. 2435 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
2334 2436
2335The hook functions are called with no arguments and should return a 2437The hook functions are called with no arguments and should return
2336non-nil value to suppress the normal prompt when you remove a folder. 2438a non-nil value to suppress the normal prompt when you remove a
2337This is useful for folders that are easily regenerated. 2439folder. This is useful for folders that are easily regenerated.
2338 2440
2339The default value of `mh-index-p' suppresses the prompt on folders 2441The default value of `mh-index-p' suppresses the prompt on
2340generated by an index search. 2442folders generated by an index search.
2341 2443
2342WARNING: Use this hook with care. If there is a bug in your hook which 2444WARNING: Use this hook with care. If there is a bug in your hook
2343returns t on \"+inbox\" and you hit \\[mh-kill-folder] by accident in 2445which returns t on \"+inbox\" and you hit \\[mh-kill-folder] by
2344the \"+inbox\" folder, you will not be happy." 2446accident in the \"+inbox\" folder, you will not be happy."
2345 :type 'hook 2447 :type 'hook
2346 :group 'mh-hooks 2448 :group 'mh-hooks
2347 :group 'mh-folder) 2449 :group 'mh-folder)
@@ -2349,10 +2451,11 @@ the \"+inbox\" folder, you will not be happy."
2349(defcustom mh-letter-mode-hook nil 2451(defcustom mh-letter-mode-hook nil
2350 "Hook run by `mh-letter-mode' on a new letter. 2452 "Hook run by `mh-letter-mode' on a new letter.
2351 2453
2352This hook allows you to do some processing before editing a letter. 2454This hook allows you to do some processing before editing a
2353For example, you may wish to modify the header after \"repl\" has done 2455letter. For example, you may wish to modify the header after
2354its work, or you may have a complicated \"components\" file and need 2456\"repl\" has done its work, or you may have a complicated
2355to tell MH-E where the cursor should go." 2457\"components\" file and need to tell MH-E where the cursor should
2458go."
2356 :type 'hook 2459 :type 'hook
2357 :group 'mh-hooks 2460 :group 'mh-hooks
2358 :group 'mh-sending-mail) 2461 :group 'mh-sending-mail)
@@ -2366,10 +2469,10 @@ to tell MH-E where the cursor should go."
2366(defcustom mh-pick-mode-hook nil 2469(defcustom mh-pick-mode-hook nil
2367 "Hook run upon entry to `mh-pick-mode'\\<mh-folder-mode-map>. 2470 "Hook run upon entry to `mh-pick-mode'\\<mh-folder-mode-map>.
2368 2471
2369If you find that you do the same thing over and over when editing the 2472If you find that you do the same thing over and over when editing
2370search template, you may wish to bind some shortcuts to keys. This can 2473the search template, you may wish to bind some shortcuts to keys.
2371be done with this hook which is called when \\[mh-search-folder] is 2474This can be done with this hook which is called when
2372run on a new pattern." 2475\\[mh-search-folder] is run on a new pattern."
2373 :type 'hook 2476 :type 'hook
2374 :group 'mh-hooks 2477 :group 'mh-hooks
2375 :group 'mh-index) 2478 :group 'mh-index)
@@ -2377,8 +2480,8 @@ run on a new pattern."
2377(defcustom mh-quit-hook nil 2480(defcustom mh-quit-hook nil
2378 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E. 2481 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
2379 2482
2380This hook is not run in an MH-E context, so you might use it to modify 2483This hook is not run in an MH-E context, so you might use it to
2381the window setup. 2484modify the window setup.
2382 2485
2383See also `mh-before-quit-hook'." 2486See also `mh-before-quit-hook'."
2384 :type 'hook 2487 :type 'hook
@@ -2394,9 +2497,9 @@ See also `mh-before-quit-hook'."
2394(defcustom mh-show-hook nil 2497(defcustom mh-show-hook nil
2395 "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message. 2498 "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
2396 2499
2397It is the last thing called after messages are displayed. It's used to 2500It is the last thing called after messages are displayed. It's
2398affect the behavior of MH-E in general or when `mh-show-mode-hook' is 2501used to affect the behavior of MH-E in general or when
2399too early." 2502`mh-show-mode-hook' is too early."
2400 :type 'hook 2503 :type 'hook
2401 :group 'mh-hooks 2504 :group 'mh-hooks
2402 :group 'mh-show) 2505 :group 'mh-show)
@@ -2404,8 +2507,9 @@ too early."
2404(defcustom mh-show-mode-hook nil 2507(defcustom mh-show-mode-hook nil
2405 "Hook run upon entry to `mh-show-mode'. 2508 "Hook run upon entry to `mh-show-mode'.
2406 2509
2407This hook is called early on in the process of the message display. It 2510This hook is called early on in the process of the message
2408is usually used to perform some action on the message's content." 2511display. It is usually used to perform some action on the
2512message's content."
2409 :type 'hook 2513 :type 'hook
2410 :group 'mh-hooks 2514 :group 'mh-hooks
2411 :group 'mh-show) 2515 :group 'mh-show)
@@ -2413,8 +2517,9 @@ is usually used to perform some action on the message's content."
2413(defcustom mh-unseen-updated-hook nil 2517(defcustom mh-unseen-updated-hook nil
2414 "Hook run after the unseen sequence has been updated. 2518 "Hook run after the unseen sequence has been updated.
2415 2519
2416The variable `mh-seen-list' can be used by this hook to obtain the 2520The variable `mh-seen-list' can be used by this hook to obtain
2417list of messages which were removed from the unseen sequence." 2521the list of messages which were removed from the unseen
2522sequence."
2418 :type 'hook 2523 :type 'hook
2419 :group 'mh-hooks 2524 :group 'mh-hooks
2420 :group 'mh-sequences) 2525 :group 'mh-sequences)
@@ -2693,7 +2798,8 @@ list of messages which were removed from the unseen sequence."
2693 2798
2694(defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown 2799(defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown
2695 "Face used to highlight a PGG signature whose status is unknown. 2800 "Face used to highlight a PGG signature whose status is unknown.
2696This face is also used for a signature when the signer is untrusted.") 2801This face is also used for a signature when the signer is
2802untrusted.")
2697(defface mh-show-pgg-unknown 2803(defface mh-show-pgg-unknown
2698 '((t 2804 '((t
2699 (:bold t :foreground "DarkGoldenrod2"))) 2805 (:bold t :foreground "DarkGoldenrod2")))
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index e0a8c3a004f..6a50563585a 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -102,7 +102,8 @@
102 102
103(defvar mh-partial-folder-mode-line-annotation "select" 103(defvar mh-partial-folder-mode-line-annotation "select"
104 "Annotation when displaying part of a folder. 104 "Annotation when displaying part of a folder.
105The string is displayed after the folder's name. nil for no annotation.") 105The string is displayed after the folder's name. nil for no
106annotation.")
106 107
107 108
108 109
@@ -133,15 +134,16 @@ The string is displayed after the folder's name. nil for no annotation.")
133 "%<(zero)%17(friendly{from})%> " 134 "%<(zero)%17(friendly{from})%> "
134 "%{subject}%<{body}<<%{body}%>") 135 "%{subject}%<{body}<<%{body}%>")
135 "*Scan format string for MH. 136 "*Scan format string for MH.
136This string is passed to the scan program via the -format argument. 137This string is passed to the scan program via the -format
137This format is identical to the default except that additional hints for 138argument. This format is identical to the default except that
138fontification have been added to the fifth column (remember that in Emacs, the 139additional hints for fontification have been added to the fifth
139first column is 0). 140column (remember that in Emacs, the first column is 0).
140 141
141The values of the fifth column, in priority order, are: `-' if the message has 142The values of the fifth column, in priority order, are: `-' if
142been replied to, t if an address on the To: line matches one of the 143the message has been replied to, t if an address on the To: line
143mailboxes of the current user, `c' if the Cc: line matches, `b' if the Bcc: 144matches one of the mailboxes of the current user, `c' if the Cc:
144line matches, and `n' if a non-empty Newsgroups: header is present.") 145line matches, `b' if the Bcc: line matches, and `n' if a
146non-empty Newsgroups: header is present.")
145 147
146(defvar mh-scan-format-nmh 148(defvar mh-scan-format-nmh
147 (concat 149 (concat
@@ -159,14 +161,15 @@ line matches, and `n' if a non-empty Newsgroups: header is present.")
159 "%(decode{subject})%<{body}<<%{body}%>") 161 "%(decode{subject})%<{body}<<%{body}%>")
160 "*Scan format string for nmh. 162 "*Scan format string for nmh.
161This string is passed to the scan program via the -format arg. 163This string is passed to the scan program via the -format arg.
162This format is identical to the default except that additional hints for 164This format is identical to the default except that additional
163fontification have been added to the fifth column (remember that in Emacs, the 165hints for fontification have been added to the fifth
164first column is 0). 166column (remember that in Emacs, the first column is 0).
165 167
166The values of the fifth column, in priority order, are: `-' if the message has 168The values of the fifth column, in priority order, are: `-' if
167been replied to, t if an address on the To: field matches one of the 169the message has been replied to, t if an address on the To: field
168mailboxes of the current user, `c' if the Cc: field matches, `b' if the Bcc: 170matches one of the mailboxes of the current user, `c' if the Cc:
169field matches, and `n' if a non-empty Newsgroups: field is present.") 171field matches, `b' if the Bcc: field matches, and `n' if a
172non-empty Newsgroups: field is present.")
170 173
171(defvar mh-note-deleted ?D 174(defvar mh-note-deleted ?D
172 "Messages that have been deleted are marked by this character. 175 "Messages that have been deleted are marked by this character.
@@ -182,101 +185,140 @@ See also `mh-scan-cur-msg-number-regexp'.")
182 185
183(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]" 186(defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]"
184 "This regular expression matches \"good\" messages. 187 "This regular expression matches \"good\" messages.
185It must match from the beginning of the line. Note that the default setting of 188
186`mh-folder-font-lock-keywords' expects this expression to contain at least one 189It must match from the beginning of the line. Note that the
187parenthesized expression which matches the message number as in the default of 190default setting of `mh-folder-font-lock-keywords' expects this
188\"^\\\\( *[0-9]+\\\\)[^D^0-9]\". This expression includes the leading space 191expression to contain at least one parenthesized expression which
189within the parenthesis since it looks better to highlight it as well. This 192matches the message number as in the default of
190regular expression should be correct as it is needed by non-fontification 193
194 \"^\\\\( *[0-9]+\\\\)[^D^0-9]\".
195
196This expression includes the leading space within the parenthesis
197since it looks better to highlight it as well. This regular
198expression should be correct as it is needed by non-fontification
191functions.") 199functions.")
192 200
193(defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D" 201(defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D"
194 "This regular expression matches deleted messages. 202 "This regular expression matches deleted messages.
195It must match from the beginning of the line. Note that the default setting of 203
196`mh-folder-font-lock-keywords' expects this expression to contain at least one 204It must match from the beginning of the line. Note that the
197parenthesized expression which matches the message number as in the default of 205default setting of `mh-folder-font-lock-keywords' expects this
198\"^\\\\( *[0-9]+\\\\)D\". This expression includes the leading space within 206expression to contain at least one parenthesized expression which
199the parenthesis since it looks better to highlight it as well. This regular 207matches the message number as in the default of
200expression should be correct as it is needed by non-fontification functions. 208
201See also `mh-note-deleted'.") 209 \"^\\\\( *[0-9]+\\\\)D\".
210
211This expression includes the leading space within the parenthesis
212since it looks better to highlight it as well. This regular
213expression should be correct as it is needed by non-fontification
214functions. See also `mh-note-deleted'.")
202 215
203(defvar mh-scan-refiled-msg-regexp "^\\( *[0-9]+\\)\\^" 216(defvar mh-scan-refiled-msg-regexp "^\\( *[0-9]+\\)\\^"
204 "This regular expression matches refiled messages. 217 "This regular expression matches refiled messages.
205It must match from the beginning of the line. Note that the default setting of 218
206`mh-folder-font-lock-keywords' expects this expression to contain at least one 219It must match from the beginning of the line. Note that the
207parenthesized expression which matches the message number as in the default of 220default setting of `mh-folder-font-lock-keywords' expects this
208\"^\\\\( *[0-9]+\\\\)\\\\^\". This expression includes the leading space 221expression to contain at least one parenthesized expression which
209within the parenthesis since it looks better to highlight it as well. This 222matches the message number as in the default of
210regular expression should be correct as it is needed by non-fontification 223
224 \"^\\\\( *[0-9]+\\\\)\\\\^\".
225
226This expression includes the leading space within the parenthesis
227since it looks better to highlight it as well. This regular
228expression should be correct as it is needed by non-fontification
211functions. See also `mh-note-refiled'.") 229functions. See also `mh-note-refiled'.")
212 230
213(defvar mh-scan-valid-regexp "^ *[0-9]" 231(defvar mh-scan-valid-regexp "^ *[0-9]"
214 "This regular expression describes a valid scan line. 232 "This regular expression describes a valid scan line.
215This is used to eliminate error messages that are occasionally produced by 233
216\"inc\".") 234This is used to eliminate error messages that are occasionally
235produced by \"inc\".")
217 236
218(defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*" 237(defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*"
219 "This regular expression matches the current message. 238 "This regular expression matches the current message.
220It must match from the beginning of the line. Note that the default setting of 239
221`mh-folder-font-lock-keywords' expects this expression to contain at least one 240It must match from the beginning of the line. Note that the
222parenthesized expression which matches the message number as in the default of 241default setting of `mh-folder-font-lock-keywords' expects this
223\"^\\\\( *[0-9]+\\\\+\\\\).*\". This expression includes the leading space and 242expression to contain at least one parenthesized expression which
224current message marker \"+\" within the parenthesis since it looks better to 243matches the message number as in the default of
225highlight these items as well. This regular expression should be correct as it 244
226is needed by non-fontification functions. See also `mh-note-cur'.") 245 \"^\\\\( *[0-9]+\\\\+\\\\).*\".
246
247This expression includes the leading space and current message
248marker \"+\" within the parenthesis since it looks better to
249highlight these items as well. This regular expression should be
250correct as it is needed by non-fontification functions. See also
251`mh-note-cur'.")
227 252
228(defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)" 253(defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)"
229 "This regular expression matches a valid date. 254 "This regular expression matches a valid date.
230It must not be anchored to the beginning or the end of the line. Note that the 255
231default setting of `mh-folder-font-lock-keywords' expects this expression to 256It must not be anchored to the beginning or the end of the line.
232contain only one parenthesized expression which matches the date field as in 257Note that the default setting of `mh-folder-font-lock-keywords'
233the default of \"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular 258expects this expression to contain only one parenthesized
234expression is not correct, the date will not be highlighted. See also 259expression which matches the date field as in the default of
260\"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression
261is not correct, the date will not be highlighted. See also
235`mh-scan-format-regexp'.") 262`mh-scan-format-regexp'.")
236 263
237(defvar mh-scan-rcpt-regexp "\\(To:\\)\\(..............\\)" 264(defvar mh-scan-rcpt-regexp "\\(To:\\)\\(..............\\)"
238 "This regular expression specifies the recipient in messages you sent. 265 "This regular expression specifies the recipient in messages you sent.
266
239Note that the default setting of `mh-folder-font-lock-keywords' 267Note that the default setting of `mh-folder-font-lock-keywords'
240expects this expression to contain two parenthesized expressions. The 268expects this expression to contain two parenthesized expressions.
241first is expected to match the `To:' that the default scan format 269The first is expected to match the `To:' that the default scan
242file generates. The second is expected to match the recipient's name 270format file generates. The second is expected to match the
243as in the default of \"\\\\(To:\\\\)\\\\(..............\\\\)\". If this 271recipient's name as in the default of
244regular expression is not correct, the recipient will not be highlighted.") 272\"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular
273expression is not correct, the recipient will not be
274highlighted.")
245 275
246(defvar mh-scan-body-regexp "\\(<<\\([^\n]+\\)?\\)" 276(defvar mh-scan-body-regexp "\\(<<\\([^\n]+\\)?\\)"
247 "This regular expression matches the message body fragment. 277 "This regular expression matches the message body fragment.
248Note that the default setting of `mh-folder-font-lock-keywords' expects this 278
249expression to contain at least one parenthesized expression which matches the 279Note that the default setting of `mh-folder-font-lock-keywords'
250body text as in the default of \"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this 280expects this expression to contain at least one parenthesized
251regular expression is not correct, the body fragment will not be highlighted.") 281expression which matches the body text as in the default of
282\"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is
283not correct, the body fragment will not be highlighted.")
252 284
253(defvar mh-scan-subject-regexp 285(defvar mh-scan-subject-regexp
254 "^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)" 286 "^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"
255 "This regular expression matches the subject. 287 "This regular expression matches the subject.
256It must match from the beginning of the line. Note that the default setting 288
257of `mh-folder-font-lock-keywords' expects this expression to contain at least 289It must match from the beginning of the line. Note that the
258three parenthesized expressions. The first is expected to match the `Re:' 290default setting of `mh-folder-font-lock-keywords' expects this
259string, if any. The second matches an optional bracketed number after `Re:', 291expression to contain at least three parenthesized expressions.
260such as in `Re[2]:' (and is thus a sub-expression of the first expression) and 292The first is expected to match the `Re:' string, if any. The
261the third is expected to match the subject line itself as in the default of 293second matches an optional bracketed number after `Re:', such as
262\(broken on multiple lines for readability): 294in `Re[2]:' (and is thus a sub-expression of the first
295expression) and the third is expected to match the subject line
296itself as in the default of \(broken on multiple lines for
297readability):
298
263 ^ *[0-9]+........[ ]*................... 299 ^ *[0-9]+........[ ]*...................
264 \\\\([Rr][Ee]\\\\(\\\\\\=[[0-9]+\\\\]\\\\)?:\\\\s-*\\\\)* 300 \\\\([Rr][Ee]\\\\(\\\\\\=[[0-9]+\\\\]\\\\)?:\\\\s-*\\\\)*
265 \\\\([^<\\n]*\\\\) 301 \\\\([^<\\n]*\\\\)
266This regular expression should be correct as it is needed by non-fontification 302
267functions.") 303This regular expression should be correct as it is needed by
304non-fontification functions.")
268 305
269(defvar mh-scan-format-regexp 306(defvar mh-scan-format-regexp
270 (concat "\\([bct]\\)" mh-scan-date-regexp " *\\(..................\\)") 307 (concat "\\([bct]\\)" mh-scan-date-regexp " *\\(..................\\)")
271 "This regular expression matches the output of scan. 308 "This regular expression matches the output of scan.
272Note that the default setting of `mh-folder-font-lock-keywords' expects this 309
273expression to contain at least three parenthesized expressions. The first 310Note that the default setting of `mh-folder-font-lock-keywords'
274should match the fontification hint (see `mh-scan-format-nmh'), the second is 311expects this expression to contain at least three parenthesized
275found in `mh-scan-date-regexp', and the third should match the user name as in 312expressions. The first should match the fontification hint (see
276the default of \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp 313`mh-scan-format-nmh'), the second is found in
277 \"*\\\\(..................\\\\)\")\". 314`mh-scan-date-regexp', and the third should match the user name
278If this regular expression is not correct, the notation hints and the sender 315as in the default of
279will not be highlighted.") 316
317 \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp
318 \"*\\\\(..................\\\\)\")\".
319
320If this regular expression is not correct, the notation hints and
321the sender will not be highlighted.")
280 322
281 323
282 324
@@ -313,22 +355,27 @@ will not be highlighted.")
313 355
314(defvar mh-scan-cmd-note-width 1 356(defvar mh-scan-cmd-note-width 1
315 "Number of columns consumed by the cmd-note field in `mh-scan-format'. 357 "Number of columns consumed by the cmd-note field in `mh-scan-format'.
316This column will have one of the values: ` ', `D', `^', `+' and where 358
317` ' is the default value, 359This column will have one of the values: ` ', `D', `^', `+' and
318`D' is the `mh-note-deleted' character, 360where ` ' is the default value,
319`^' is the `mh-note-refiled' character, and 361
320`+' is the `mh-note-cur' character.") 362 `D' is the `mh-note-deleted' character,
363 `^' is the `mh-note-refiled' character, and
364 `+' is the `mh-note-cur' character.")
321 365
322(defvar mh-scan-destination-width 1 366(defvar mh-scan-destination-width 1
323 "Number of columns consumed by the destination field in `mh-scan-format'. 367 "Number of columns consumed by the destination field in `mh-scan-format'.
324This column will have one of ' ', '%', '-', 't', 'c', 'b', or `n' in it. 368
325A ' ' blank space is the default character. 369This column will have one of ' ', '%', '-', 't', 'c', 'b', or `n'
326A '%' indicates that the message in in a named MH sequence. 370in it.
327A '-' indicates that the message has been annotated with a replied field. 371
328A 't' indicates that the message contains mymbox in the To: field. 372 ' ' blank space is the default character.
329A 'c' indicates that the message contains mymbox in the Cc: field. 373 '%' indicates that the message in in a named MH sequence.
330A 'b' indicates that the message contains mymbox in the Bcc: field. 374 '-' indicates that the message has been annotated with a replied field.
331A 'n' indicates that the message contains a Newsgroups: field.") 375 't' indicates that the message contains mymbox in the To: field.
376 'c' indicates that the message contains mymbox in the Cc: field.
377 'b' indicates that the message contains mymbox in the Bcc: field.
378 'n' indicates that the message contains a Newsgroups: field.")
332 379
333(defvar mh-scan-date-width 5 380(defvar mh-scan-date-width 5
334 "Number of columns consumed by the date field in `mh-scan-format'. 381 "Number of columns consumed by the date field in `mh-scan-format'.
@@ -336,7 +383,8 @@ This column will typically be of the form mm/dd.")
336 383
337(defvar mh-scan-date-flag-width 1 384(defvar mh-scan-date-flag-width 1
338 "Number of columns consumed to flag (in)valid dates in `mh-scan-format'. 385 "Number of columns consumed to flag (in)valid dates in `mh-scan-format'.
339This column will have ` ' for valid and `*' for invalid or missing dates.") 386This column will have ` ' for valid and `*' for invalid or
387missing dates.")
340 388
341(defvar mh-scan-from-mbox-width 17 389(defvar mh-scan-from-mbox-width 17
342 "Number of columns consumed with the \"From:\" line in `mh-scan-format'. 390 "Number of columns consumed with the \"From:\" line in `mh-scan-format'.
@@ -388,17 +436,17 @@ This column will only ever have spaces in it.")
388 436
389(defmacro mh-generate-sequence-font-lock (seq prefix face) 437(defmacro mh-generate-sequence-font-lock (seq prefix face)
390 "Generate the appropriate code to fontify messages in SEQ. 438 "Generate the appropriate code to fontify messages in SEQ.
391PREFIX is used to generate unique names for the variables and functions 439PREFIX is used to generate unique names for the variables and
392defined by the macro. So a different prefix should be provided for every 440functions defined by the macro. So a different prefix should be
393invocation. 441provided for every invocation.
394FACE is the font-lock face used to display the matching scan lines." 442FACE is the font-lock face used to display the matching scan lines."
395 (let ((cache (intern (format "mh-folder-%s-seq-cache" prefix))) 443 (let ((cache (intern (format "mh-folder-%s-seq-cache" prefix)))
396 (func (intern (format "mh-folder-font-lock-%s" prefix)))) 444 (func (intern (format "mh-folder-font-lock-%s" prefix))))
397 `(progn 445 `(progn
398 (defvar ,cache nil 446 (defvar ,cache nil
399 "Internal cache variable used for font-lock in MH-E. 447 "Internal cache variable used for font-lock in MH-E.
400Should only be non-nil through font-lock stepping, and nil once font-lock 448Should only be non-nil through font-lock stepping, and nil once
401is done highlighting.") 449font-lock is done highlighting.")
402 (make-variable-buffer-local ',cache) 450 (make-variable-buffer-local ',cache)
403 451
404 (defun ,func (limit) 452 (defun ,func (limit)
@@ -463,16 +511,19 @@ is done highlighting.")
463 511
464(defvar mh-delete-list nil 512(defvar mh-delete-list nil
465 "List of message numbers to delete. 513 "List of message numbers to delete.
466This variable can be used by `mh-before-commands-processed-hook'.") 514This variable can be used by
515`mh-before-commands-processed-hook'.")
467 516
468(defvar mh-refile-list nil 517(defvar mh-refile-list nil
469 "List of folder names in `mh-seq-list'. 518 "List of folder names in `mh-seq-list'.
470This variable can be used by `mh-before-commands-processed-hook'.") 519This variable can be used by
520`mh-before-commands-processed-hook'.")
471 521
472(defvar mh-folders-changed nil 522(defvar mh-folders-changed nil
473 "Lists which folders were affected by deletes and refiles. 523 "Lists which folders were affected by deletes and refiles.
474This list will always include the current folder `mh-current-folder'. 524This list will always include the current folder
475This variable can be used by `mh-before-commands-processed-hook'.") 525`mh-current-folder'. This variable can be used by
526`mh-before-commands-processed-hook'.")
476 527
477(defvar mh-next-direction 'forward 528(defvar mh-next-direction 'forward
478 "Direction to move to next message.") 529 "Direction to move to next message.")
@@ -534,9 +585,11 @@ These operations include narrowing or threading.")
534 585
535;;;###autoload 586;;;###autoload
536(defun mh-rmail (&optional arg) 587(defun mh-rmail (&optional arg)
537 "Inc(orporate) new mail with MH. 588 "Incorporate new mail with MH.
538Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, 589Scan an MH folder if ARG is non-nil.
539the Emacs interface to the MH mail system." 590
591This function is an entry point to MH-E, the Emacs interface to
592the MH mail system."
540 (interactive "P") 593 (interactive "P")
541 (mh-find-path) 594 (mh-find-path)
542 (if arg 595 (if arg
@@ -548,8 +601,10 @@ the Emacs interface to the MH mail system."
548;;;###autoload 601;;;###autoload
549(defun mh-nmail (&optional arg) 602(defun mh-nmail (&optional arg)
550 "Check for new mail in inbox folder. 603 "Check for new mail in inbox folder.
551Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, 604Scan an MH folder if ARG is non-nil.
552the Emacs interface to the MH mail system." 605
606This function is an entry point to MH-E, the Emacs interface to
607the MH mail system."
553 (interactive "P") 608 (interactive "P")
554 (mh-find-path) ; init mh-inbox 609 (mh-find-path) ; init mh-inbox
555 (if arg 610 (if arg
@@ -563,20 +618,21 @@ the Emacs interface to the MH mail system."
563(defun mh-delete-msg (range) 618(defun mh-delete-msg (range)
564 "Delete RANGE\\<mh-folder-mode-map>. 619 "Delete RANGE\\<mh-folder-mode-map>.
565 620
566To mark a message for deletion, use this command. A \"D\" is placed by the 621To mark a message for deletion, use this command. A \"D\" is
567message in the scan window, and the next undeleted message is displayed. If 622placed by the message in the scan window, and the next undeleted
568the previous command had been \\[mh-previous-undeleted-msg], then the next 623message is displayed. If the previous command had been
569message displayed is the first undeleted message previous to the message just 624\\[mh-previous-undeleted-msg], then the next message displayed is
570deleted. Use \\[mh-next-undeleted-msg] to force subsequent \\[mh-delete-msg] 625the first undeleted message previous to the message just deleted.
571commands to move forward to the next undeleted message after deleting the 626Use \\[mh-next-undeleted-msg] to force subsequent
572message under the cursor. 627\\[mh-delete-msg] commands to move forward to the next undeleted
573 628message after deleting the message under the cursor.
574The hook `mh-delete-msg-hook' is called after you mark a message for deletion. 629
575For example, a past maintainer of MH-E used this once when he kept statistics 630The hook `mh-delete-msg-hook' is called after you mark a message
576on his mail usage. 631for deletion. For example, a past maintainer of MH-E used this
577 632once when he kept statistics on his mail usage.
578Check the documentation of `mh-interactive-range' to see how RANGE is read in 633
579interactive use." 634Check the documentation of `mh-interactive-range' to see how
635RANGE is read in interactive use."
580 (interactive (list (mh-interactive-range "Delete"))) 636 (interactive (list (mh-interactive-range "Delete")))
581 (mh-delete-msg-no-motion range) 637 (mh-delete-msg-no-motion range)
582 (if (looking-at mh-scan-deleted-msg-regexp) 638 (if (looking-at mh-scan-deleted-msg-regexp)
@@ -585,11 +641,12 @@ interactive use."
585(defun mh-delete-msg-no-motion (range) 641(defun mh-delete-msg-no-motion (range)
586 "Delete RANGE, don't move to next message. 642 "Delete RANGE, don't move to next message.
587 643
588This command marks the RANGE for deletion but leaves the cursor at the current 644This command marks the RANGE for deletion but leaves the cursor
589message in case you wish to perform other operations on the message. 645at the current message in case you wish to perform other
646operations on the message.
590 647
591Check the documentation of `mh-interactive-range' to see how RANGE is read in 648Check the documentation of `mh-interactive-range' to see how
592interactive use." 649RANGE is read in interactive use."
593 (interactive (list (mh-interactive-range "Delete"))) 650 (interactive (list (mh-interactive-range "Delete")))
594 (mh-iterate-on-range () range 651 (mh-iterate-on-range () range
595 (mh-delete-a-msg nil))) 652 (mh-delete-a-msg nil)))
@@ -597,16 +654,17 @@ interactive use."
597(defun mh-execute-commands () 654(defun mh-execute-commands ()
598 "Process outstanding delete and refile requests\\<mh-folder-mode-map>. 655 "Process outstanding delete and refile requests\\<mh-folder-mode-map>.
599 656
600If you've marked messages to be deleted or refiled and you want to go ahead 657If you've marked messages to be deleted or refiled and you want
601and delete or refile the messages, use this command. Many MH-E commands that 658to go ahead and delete or refile the messages, use this command.
602may affect the numbering of the messages (such as \\[mh-rescan-folder] or 659Many MH-E commands that may affect the numbering of the
603\\[mh-pack-folder]) will ask if you want to process refiles or deletes first 660messages (such as \\[mh-rescan-folder] or \\[mh-pack-folder])
604and then either run this command for you or undo the pending refiles and 661will ask if you want to process refiles or deletes first and then
662either run this command for you or undo the pending refiles and
605deletes, which are lost. 663deletes, which are lost.
606 664
607This function runs `mh-before-commands-processed-hook' before the commands are 665This function runs `mh-before-commands-processed-hook' before the
608processed and `mh-after-commands-processed-hook' after the commands are 666commands are processed and `mh-after-commands-processed-hook'
609processed." 667after the commands are processed."
610 (interactive) 668 (interactive)
611 (if mh-folder-view-stack (mh-widen t)) 669 (if mh-folder-view-stack (mh-widen t))
612 (mh-process-commands mh-current-folder) 670 (mh-process-commands mh-current-folder)
@@ -643,15 +701,17 @@ Use the command \\[mh-show] to show the message normally again."
643 "Incorporate new mail into a folder. 701 "Incorporate new mail into a folder.
644 702
645You can incorporate mail from any file into the current folder by 703You can incorporate mail from any file into the current folder by
646specifying a prefix argument; you'll be prompted for the name of the 704specifying a prefix argument; you'll be prompted for the name of
647file to use as well as the destination folder 705the file to use as well as the destination folder
648 706
649The hook `mh-inc-folder-hook' is run after incorporating new mail. Do 707The hook `mh-inc-folder-hook' is run after incorporating new
650not call this function from outside MH-E; use \\[mh-rmail] instead. 708mail. Do not call this function from outside MH-E; use
709\\[mh-rmail] instead.
651 710
652In a program optional argument MAILDROP-NAME specifies an alternate 711In a program optional argument MAILDROP-NAME specifies an
653maildrop from the default. The optional argument FOLDER specifies 712alternate maildrop from the default. The optional argument FOLDER
654where to incorporate mail instead of the default named by `mh-inbox'." 713specifies where to incorporate mail instead of the default named
714by `mh-inbox'."
655 (interactive (list (if current-prefix-arg 715 (interactive (list (if current-prefix-arg
656 (expand-file-name 716 (expand-file-name
657 (read-file-name "inc mail from file: " 717 (read-file-name "inc mail from file: "
@@ -695,12 +755,12 @@ where to incorporate mail instead of the default named by `mh-inbox'."
695(defun mh-next-undeleted-msg (&optional count wait-after-complaining-flag) 755(defun mh-next-undeleted-msg (&optional count wait-after-complaining-flag)
696 "Display next message. 756 "Display next message.
697 757
698This command can be given a prefix argument COUNT to specify how many unread 758This command can be given a prefix argument COUNT to specify how
699messages to skip. 759many unread messages to skip.
700 760
701In a program, pause for a second after printing message if we are at the last 761In a program, pause for a second after printing message if we are
702undeleted message and optional argument WAIT-AFTER-COMPLAINING-FLAG is 762at the last undeleted message and optional argument
703non-nil." 763WAIT-AFTER-COMPLAINING-FLAG is non-nil."
704 (interactive "p") 764 (interactive "p")
705 (setq mh-next-direction 'forward) 765 (setq mh-next-direction 'forward)
706 (forward-line 1) 766 (forward-line 1)
@@ -716,18 +776,19 @@ non-nil."
716 776
717The name of the folder is derived as follows: 777The name of the folder is derived as follows:
718 778
719 a) The folder name associated with the first address found in the list 779 a) The folder name associated with the first address found in
720 `mh-default-folder-list' is used. Each element in this list contains a 780 the list `mh-default-folder-list' is used. Each element in
721 `Check Recipient' item. If this item is turned on, then the address is 781 this list contains a `Check Recipient' item. If this item is
722 checked against the recipient instead of the sender. This is useful for 782 turned on, then the address is checked against the recipient
723 mailing lists. 783 instead of the sender. This is useful for mailing lists.
724 784
725 b) An alias prefixed by `mh-default-folder-prefix' corresponding to the 785 b) An alias prefixed by `mh-default-folder-prefix'
726 address is used. The prefix is used to prevent clutter in your mail 786 corresponding to the address is used. The prefix is used to
727 directory. 787 prevent clutter in your mail directory.
728 788
729Return nil if a folder name was not derived, or if the variable 789Return nil if a folder name was not derived, or if the variable
730`mh-default-folder-must-exist-flag' is t and the folder does not exist." 790`mh-default-folder-must-exist-flag' is t and the folder does not
791exist."
731 ;; Loop for all entries in mh-default-folder-list 792 ;; Loop for all entries in mh-default-folder-list
732 (save-restriction 793 (save-restriction
733 (goto-char (point-min)) 794 (goto-char (point-min))
@@ -792,15 +853,15 @@ The default folder name is generated by the option
792(defun mh-refile-msg (range folder &optional dont-update-last-destination-flag) 853(defun mh-refile-msg (range folder &optional dont-update-last-destination-flag)
793 "Refile (output) RANGE into FOLDER. 854 "Refile (output) RANGE into FOLDER.
794 855
795You are prompted for the folder name. Note that this command can also be used 856You are prompted for the folder name. Note that this command can also
796to create folders. If you specify a folder that does not exist, you will be 857be used to create folders. If you specify a folder that does not
797prompted to create it. 858exist, you will be prompted to create it.
798 859
799The hook `mh-refile-msg-hook' is called after a message is marked to be 860The hook `mh-refile-msg-hook' is called after a message is marked to
800refiled. 861be refiled.
801 862
802Check the documentation of `mh-interactive-range' to see how RANGE is read in 863Check the documentation of `mh-interactive-range' to see how RANGE is
803interactive use. 864read in interactive use.
804 865
805In a program, the variables `mh-last-destination' and 866In a program, the variables `mh-last-destination' and
806`mh-last-destination-folder' are not updated if 867`mh-last-destination-folder' are not updated if
@@ -817,14 +878,14 @@ DONT-UPDATE-LAST-DESTINATION-FLAG is non-nil."
817(defun mh-refile-or-write-again (range &optional interactive-flag) 878(defun mh-refile-or-write-again (range &optional interactive-flag)
818 "Repeat last output command. 879 "Repeat last output command.
819 880
820If you are refiling several messages into the same folder, you can use this 881If you are refiling several messages into the same folder, you can use
821command to repeat the last refile or write. You can use a range. 882this command to repeat the last refile or write. You can use a range.
822 883
823Check the documentation of `mh-interactive-range' to see how RANGE is read in 884Check the documentation of `mh-interactive-range' to see how RANGE is
824interactive use. 885read in interactive use.
825 886
826In a program, a non-nil INTERACTIVE-FLAG means that the function was called 887In a program, a non-nil INTERACTIVE-FLAG means that the function was
827interactively." 888called interactively."
828 (interactive (list (mh-interactive-range "Redo") t)) 889 (interactive (list (mh-interactive-range "Redo") t))
829 (if (null mh-last-destination) 890 (if (null mh-last-destination)
830 (error "No previous refile or write")) 891 (error "No previous refile or write"))
@@ -840,18 +901,20 @@ interactively."
840(defun mh-quit () 901(defun mh-quit ()
841 "Quit the current MH-E folder. 902 "Quit the current MH-E folder.
842 903
843When you want to quit using MH-E and go back to editing, you can use this 904When you want to quit using MH-E and go back to editing, you can use
844command. This buries the buffers of the current MH-E folder and restores the 905this command. This buries the buffers of the current MH-E folder and
845buffers that were present when you first ran \\[mh-rmail]. It also removes any 906restores the buffers that were present when you first ran
846MH-E working buffers whose name begins with \" *mh-\" or \"*MH-E \". You can 907\\[mh-rmail]. It also removes any MH-E working buffers whose name
847later restore your MH-E session by selecting the \"+inbox\" buffer or by 908begins with \" *mh-\" or \"*MH-E \". You can later restore your MH-E
848running \\[mh-rmail] again. 909session by selecting the \"+inbox\" buffer or by running \\[mh-rmail]
849 910again.
850The two hooks `mh-before-quit-hook' and `mh-quit-hook' are called by this 911
851function. The former one is called before the quit occurs, so you might use it 912The two hooks `mh-before-quit-hook' and `mh-quit-hook' are called by
852to perform any MH-E operations; you could perform some query and abort the 913this function. The former one is called before the quit occurs, so you
853quit or call `mh-execute-commands', for example. The latter is not run in an 914might use it to perform any MH-E operations; you could perform some
854MH-E context, so you might use it to modify the window setup." 915query and abort the quit or call `mh-execute-commands', for example.
916The latter is not run in an MH-E context, so you might use it to
917modify the window setup."
855 (interactive) 918 (interactive)
856 (run-hooks 'mh-before-quit-hook) 919 (run-hooks 'mh-before-quit-hook)
857 (let ((show-buffer (get-buffer mh-show-buffer))) 920 (let ((show-buffer (get-buffer mh-show-buffer)))
@@ -874,9 +937,9 @@ MH-E context, so you might use it to modify the window setup."
874(defun mh-page-msg (&optional lines) 937(defun mh-page-msg (&optional lines)
875 "Display next page in message. 938 "Display next page in message.
876 939
877You can give this command a prefix argument that specifies the number of LINES 940You can give this command a prefix argument that specifies the
878to scroll. This command will also show the next undeleted message if it is 941number of LINES to scroll. This command will also show the next
879used at the bottom of a message." 942undeleted message if it is used at the bottom of a message."
880 (interactive "P") 943 (interactive "P")
881 (if mh-showing-mode 944 (if mh-showing-mode
882 (if mh-page-to-next-msg-flag 945 (if mh-page-to-next-msg-flag
@@ -899,8 +962,8 @@ used at the bottom of a message."
899(defun mh-previous-page (&optional lines) 962(defun mh-previous-page (&optional lines)
900 "Display next page in message. 963 "Display next page in message.
901 964
902You can give this command a prefix argument that specifies the number of LINES 965You can give this command a prefix argument that specifies the
903to scroll." 966number of LINES to scroll."
904 (interactive "P") 967 (interactive "P")
905 (mh-in-show-buffer (mh-show-buffer) 968 (mh-in-show-buffer (mh-show-buffer)
906 (scroll-down lines))) 969 (scroll-down lines)))
@@ -908,12 +971,12 @@ to scroll."
908(defun mh-previous-undeleted-msg (&optional count wait-after-complaining-flag) 971(defun mh-previous-undeleted-msg (&optional count wait-after-complaining-flag)
909 "Display previous message. 972 "Display previous message.
910 973
911This command can be given a prefix argument COUNT to specify how many unread 974This command can be given a prefix argument COUNT to specify how
912messages to skip. 975many unread messages to skip.
913 976
914In a program, pause for a second after printing message if we are at the last 977In a program, pause for a second after printing message if we are
915undeleted message and optional argument WAIT-AFTER-COMPLAINING-FLAG is 978at the last undeleted message and optional argument
916non-nil." 979WAIT-AFTER-COMPLAINING-FLAG is non-nil."
917 (interactive "p") 980 (interactive "p")
918 (setq mh-next-direction 'backward) 981 (setq mh-next-direction 'backward)
919 (beginning-of-line) 982 (beginning-of-line)
@@ -925,8 +988,8 @@ non-nil."
925(defun mh-previous-unread-msg (&optional count) 988(defun mh-previous-unread-msg (&optional count)
926 "Display previous unread message. 989 "Display previous unread message.
927 990
928This command can be given a prefix argument COUNT to specify how many unread 991This command can be given a prefix argument COUNT to specify how
929messages to skip." 992many unread messages to skip."
930 (interactive "p") 993 (interactive "p")
931 (unless (> count 0) 994 (unless (> count 0)
932 (error "The function mh-previous-unread-msg expects positive argument")) 995 (error "The function mh-previous-unread-msg expects positive argument"))
@@ -958,9 +1021,11 @@ messages to skip."
958 1021
959(defun mh-goto-next-button (backward-flag &optional criterion) 1022(defun mh-goto-next-button (backward-flag &optional criterion)
960 "Search for next button satisfying criterion. 1023 "Search for next button satisfying criterion.
961If BACKWARD-FLAG is non-nil search backward in the buffer for a mime button. If 1024
962CRITERION is a function or a symbol which has a function binding then that 1025If BACKWARD-FLAG is non-nil search backward in the buffer for a mime
963function must return non-nil at the button we stop." 1026button.
1027If CRITERION is a function or a symbol which has a function binding
1028then that function must return non-nil at the button we stop."
964 (unless (or (and (symbolp criterion) (fboundp criterion)) 1029 (unless (or (and (symbolp criterion) (fboundp criterion))
965 (functionp criterion)) 1030 (functionp criterion))
966 (setq criterion (lambda (x) t))) 1031 (setq criterion (lambda (x) t)))
@@ -1003,11 +1068,11 @@ function must return non-nil at the button we stop."
1003(defun mh-next-button (&optional backward-flag) 1068(defun mh-next-button (&optional backward-flag)
1004 "Go to the next button. 1069 "Go to the next button.
1005 1070
1006If the end of the buffer is reached then the search wraps over to the start of 1071If the end of the buffer is reached then the search wraps over to
1007the buffer. 1072the start of the buffer.
1008 1073
1009If an optional prefix argument BACKWARD-FLAG is given, the cursor will move to 1074If an optional prefix argument BACKWARD-FLAG is given, the cursor
1010the previous button." 1075will move to the previous button."
1011 (interactive (list current-prefix-arg)) 1076 (interactive (list current-prefix-arg))
1012 (unless mh-showing-mode 1077 (unless mh-showing-mode
1013 (mh-show)) 1078 (mh-show))
@@ -1017,17 +1082,18 @@ the previous button."
1017(defun mh-prev-button () 1082(defun mh-prev-button ()
1018 "Go to the previous button. 1083 "Go to the previous button.
1019 1084
1020If the beginning of the buffer is reached then the search wraps over to the 1085If the beginning of the buffer is reached then the search wraps
1021end of the buffer." 1086over to the end of the buffer."
1022 (interactive) 1087 (interactive)
1023 (mh-next-button t)) 1088 (mh-next-button t))
1024 1089
1025(defun mh-folder-mime-action (part-index action include-security-flag) 1090(defun mh-folder-mime-action (part-index action include-security-flag)
1026 "Go to PART-INDEX and carry out ACTION. 1091 "Go to PART-INDEX and carry out ACTION.
1027If PART-INDEX is nil then go to the next part in the buffer. The search for 1092
1028the next buffer wraps around if end of buffer is reached. If argument 1093If PART-INDEX is nil then go to the next part in the buffer. The
1029INCLUDE-SECURITY-FLAG is non-nil then include security info buttons when 1094search for the next buffer wraps around if end of buffer is reached.
1030searching for a suitable parts." 1095If argument INCLUDE-SECURITY-FLAG is non-nil then include security
1096info buttons when searching for a suitable parts."
1031 (unless mh-showing-mode 1097 (unless mh-showing-mode
1032 (mh-show)) 1098 (mh-show))
1033 (mh-in-show-buffer (mh-show-buffer) 1099 (mh-in-show-buffer (mh-show-buffer)
@@ -1058,15 +1124,17 @@ searching for a suitable parts."
1058(defun mh-folder-toggle-mime-part (part-index) 1124(defun mh-folder-toggle-mime-part (part-index)
1059 "View attachment. 1125 "View attachment.
1060 1126
1061This command displays (or hides) the attachment associated with the button 1127This command displays (or hides) the attachment associated with
1062under the cursor. If the cursor is not located over a button, then the cursor 1128the button under the cursor. If the cursor is not located over a
1063first moves to the next button, wrapping to the beginning of the message if 1129button, then the cursor first moves to the next button, wrapping
1064necessary. This command has the advantage over related commands of working 1130to the beginning of the message if necessary. This command has
1065from the MH-Folder buffer. 1131the advantage over related commands of working from the MH-Folder
1066 1132buffer.
1067You can also provide a numeric prefix argument PART-INDEX to view the 1133
1068attachment labeled with that number. If Emacs does not know how to display the 1134You can also provide a numeric prefix argument PART-INDEX to view
1069attachment, then Emacs offers to save the attachment in a file." 1135the attachment labeled with that number. If Emacs does not know
1136how to display the attachment, then Emacs offers to save the
1137attachment in a file."
1070 (interactive "P") 1138 (interactive "P")
1071 (when (consp part-index) (setq part-index (car part-index))) 1139 (when (consp part-index) (setq part-index (car part-index)))
1072 (mh-folder-mime-action part-index #'mh-press-button t)) 1140 (mh-folder-mime-action part-index #'mh-press-button t))
@@ -1074,14 +1142,15 @@ attachment, then Emacs offers to save the attachment in a file."
1074(defun mh-folder-inline-mime-part (part-index) 1142(defun mh-folder-inline-mime-part (part-index)
1075 "Show attachment verbatim. 1143 "Show attachment verbatim.
1076 1144
1077You can view the raw contents of an attachment with this command. This command 1145You can view the raw contents of an attachment with this command.
1078displays (or hides) the contents of the attachment associated with the button 1146This command displays (or hides) the contents of the attachment
1079under the cursor verbatim. If the cursor is not located over a button, then 1147associated with the button under the cursor verbatim. If the
1080the cursor first moves to the next button, wrapping to the beginning of the 1148cursor is not located over a button, then the cursor first moves
1081message if necessary. 1149to the next button, wrapping to the beginning of the message if
1150necessary.
1082 1151
1083You can also provide a numeric prefix argument PART-INDEX to view the 1152You can also provide a numeric prefix argument PART-INDEX to view
1084attachment labeled with that number." 1153the attachment labeled with that number."
1085 (interactive "P") 1154 (interactive "P")
1086 (when (consp part-index) (setq part-index (car part-index))) 1155 (when (consp part-index) (setq part-index (car part-index)))
1087 (mh-folder-mime-action part-index #'mh-mime-inline-part nil)) 1156 (mh-folder-mime-action part-index #'mh-mime-inline-part nil))
@@ -1089,15 +1158,16 @@ attachment labeled with that number."
1089(defun mh-folder-save-mime-part (part-index) 1158(defun mh-folder-save-mime-part (part-index)
1090 "Save (output) attachment. 1159 "Save (output) attachment.
1091 1160
1092This command saves the attachment associated with the button under the cursor. 1161This command saves the attachment associated with the button under the
1093If the cursor is not located over a button, then the cursor first moves to the 1162cursor. If the cursor is not located over a button, then the cursor
1094next button, wrapping to the beginning of the message if necessary. 1163first moves to the next button, wrapping to the beginning of the
1164message if necessary.
1095 1165
1096You can also provide a numeric prefix argument PART-INDEX to save the 1166You can also provide a numeric prefix argument PART-INDEX to save the
1097attachment labeled with that number. 1167attachment labeled with that number.
1098 1168
1099This command prompts you for a filename and suggests a specific name if it is 1169This command prompts you for a filename and suggests a specific name
1100available." 1170if it is available."
1101 (interactive "P") 1171 (interactive "P")
1102 (when (consp part-index) (setq part-index (car part-index))) 1172 (when (consp part-index) (setq part-index (car part-index)))
1103 (mh-folder-mime-action part-index #'mh-mime-save-part nil)) 1173 (mh-folder-mime-action part-index #'mh-mime-save-part nil))
@@ -1116,16 +1186,17 @@ Also removes all content from the folder buffer."
1116 "Rescan folder\\<mh-folder-mode-map>. 1186 "Rescan folder\\<mh-folder-mode-map>.
1117 1187
1118This command is useful to grab all messages in your \"+inbox\" after 1188This command is useful to grab all messages in your \"+inbox\" after
1119processing your new mail for the first time. If you don't want to rescan the 1189processing your new mail for the first time. If you don't want to
1120entire folder, this command will accept a RANGE. Check the documentation of 1190rescan the entire folder, this command will accept a RANGE. Check the
1121`mh-interactive-range' to see how RANGE is read in interactive use. 1191documentation of `mh-interactive-range' to see how RANGE is read in
1192interactive use.
1122 1193
1123This command will ask if you want to process refiles or deletes first and then 1194This command will ask if you want to process refiles or deletes first
1124either run \\[mh-execute-commands] for you or undo the pending refiles and 1195and then either run \\[mh-execute-commands] for you or undo the
1125deletes, which are lost. 1196pending refiles and deletes, which are lost.
1126 1197
1127In a program, the processing of outstanding commands is not performed if 1198In a program, the processing of outstanding commands is not performed
1128DONT-EXEC-PENDING is non-nil." 1199if DONT-EXEC-PENDING is non-nil."
1129 (interactive (list (if current-prefix-arg 1200 (interactive (list (if current-prefix-arg
1130 (mh-read-range "Rescan" mh-current-folder t nil t 1201 (mh-read-range "Rescan" mh-current-folder t nil t
1131 mh-interpret-number-as-range-flag) 1202 mh-interpret-number-as-range-flag)
@@ -1139,10 +1210,11 @@ DONT-EXEC-PENDING is non-nil."
1139(defun mh-write-msg-to-file (message file no-header) 1210(defun mh-write-msg-to-file (message file no-header)
1140 "Append MESSAGE to end of FILE\\<mh-folder-mode-map>. 1211 "Append MESSAGE to end of FILE\\<mh-folder-mode-map>.
1141 1212
1142You are prompted for the filename. If the file already exists, the message is 1213You are prompted for the filename. If the file already exists,
1143appended to it. You can also write the message to the file without the header 1214the message is appended to it. You can also write the message to
1144by specifying a prefix argument NO-HEADER. Subsequent writes to the same file 1215the file without the header by specifying a prefix argument
1145can be made with the command \\[mh-refile-or-write-again]." 1216NO-HEADER. Subsequent writes to the same file can be made with
1217the command \\[mh-refile-or-write-again]."
1146 (interactive 1218 (interactive
1147 (list (mh-get-msg-num t) 1219 (list (mh-get-msg-num t)
1148 (let ((default-dir (if (eq 'write (car mh-last-destination-write)) 1220 (let ((default-dir (if (eq 'write (car mh-last-destination-write))
@@ -1178,13 +1250,14 @@ can be made with the command \\[mh-refile-or-write-again]."
1178(defun mh-undo (range) 1250(defun mh-undo (range)
1179 "Undo pending deletes or refiles in RANGE. 1251 "Undo pending deletes or refiles in RANGE.
1180 1252
1181If you've deleted a message or refiled it, but changed your mind, you can 1253If you've deleted a message or refiled it, but changed your mind,
1182cancel the action before you've executed it. Use this command to undo a refile 1254you can cancel the action before you've executed it. Use this
1183on or deletion of a single message. You can also undo refiles and deletes for 1255command to undo a refile on or deletion of a single message. You
1184messages that are found in a given RANGE. 1256can also undo refiles and deletes for messages that are found in
1257a given RANGE.
1185 1258
1186Check the documentation of `mh-interactive-range' to see how RANGE is read in 1259Check the documentation of `mh-interactive-range' to see how
1187interactive use." 1260RANGE is read in interactive use."
1188 (interactive (list (mh-interactive-range "Undo"))) 1261 (interactive (list (mh-interactive-range "Undo")))
1189 (cond ((numberp range) 1262 (cond ((numberp range)
1190 (let ((original-position (point))) 1263 (let ((original-position (point)))
@@ -1210,8 +1283,8 @@ interactive use."
1210 1283
1211(defun mh-folder-line-matches-show-buffer-p () 1284(defun mh-folder-line-matches-show-buffer-p ()
1212 "Return t if the message under point in folder-mode is in the show buffer. 1285 "Return t if the message under point in folder-mode is in the show buffer.
1213Return nil in any other circumstance (no message under point, no show buffer, 1286Return nil in any other circumstance (no message under point, no
1214the message in the show buffer doesn't match." 1287show buffer, the message in the show buffer doesn't match."
1215 (and (eq major-mode 'mh-folder-mode) 1288 (and (eq major-mode 'mh-folder-mode)
1216 (mh-get-msg-num nil) 1289 (mh-get-msg-num nil)
1217 mh-show-buffer 1290 mh-show-buffer
@@ -1227,9 +1300,9 @@ the message in the show buffer doesn't match."
1227 1300
1228(defmacro mh-macro-expansion-time-gnus-version () 1301(defmacro mh-macro-expansion-time-gnus-version ()
1229 "Return Gnus version available at macro expansion time. 1302 "Return Gnus version available at macro expansion time.
1230The macro evaluates the Gnus version at macro expansion time. If MH-E was 1303The macro evaluates the Gnus version at macro expansion time. If
1231compiled then macro expansion happens at compile time." 1304MH-E was compiled then macro expansion happens at compile time."
1232 gnus-version) 1305gnus-version)
1233 1306
1234(defun mh-run-time-gnus-version () 1307(defun mh-run-time-gnus-version ()
1235 "Return Gnus version available at run time." 1308 "Return Gnus version available at run time."
@@ -1271,9 +1344,9 @@ compiled then macro expansion happens at compile time."
1271 1344
1272(defun mh-parse-flist-output-line (line &optional current-folder) 1345(defun mh-parse-flist-output-line (line &optional current-folder)
1273 "Parse LINE to generate folder name, unseen messages and total messages. 1346 "Parse LINE to generate folder name, unseen messages and total messages.
1274If CURRENT-FOLDER is non-nil then it contains the current folder name and it is 1347If CURRENT-FOLDER is non-nil then it contains the current folder
1275used to avoid problems in corner cases involving folders whose names end with a 1348name and it is used to avoid problems in corner cases involving
1276'+' character." 1349folders whose names end with a '+' character."
1277 (with-temp-buffer 1350 (with-temp-buffer
1278 (insert line) 1351 (insert line)
1279 (goto-char (point-max)) 1352 (goto-char (point-max))
@@ -1328,27 +1401,31 @@ used to avoid problems in corner cases involving folders whose names end with a
1328(defun mh-visit-folder (folder &optional range index-data) 1401(defun mh-visit-folder (folder &optional range index-data)
1329 "Visit FOLDER. 1402 "Visit FOLDER.
1330 1403
1331When you want to read the messages that you have refiled into folders, use 1404When you want to read the messages that you have refiled into folders,
1332this command to visit the folder. You are prompted for the folder name. 1405use this command to visit the folder. You are prompted for the folder
1406name.
1333 1407
1334The folder buffer will show just unseen messages if there are any; otherwise, 1408The folder buffer will show just unseen messages if there are any;
1335it will show all the messages in the buffer as long there are fewer than 1409otherwise, it will show all the messages in the buffer as long there
1336`mh-large-folder' messages. If there are more, then you are prompted for a 1410are fewer than `mh-large-folder' messages. If there are more, then you
1337range of messages to scan. 1411are prompted for a range of messages to scan.
1338 1412
1339You can provide a prefix argument in order to specify a RANGE of messages to 1413You can provide a prefix argument in order to specify a RANGE of
1340show when you visit the folder. In this case, regions are not used to specify 1414messages to show when you visit the folder. In this case, regions are
1341the range and `mh-large-folder' is ignored. Check the documentation of 1415not used to specify the range and `mh-large-folder' is ignored. Check
1342`mh-interactive-range' to see how RANGE is read in interactive use. 1416the documentation of `mh-interactive-range' to see how RANGE is read
1417in interactive use.
1343 1418
1344Note that this command can also be used to create folders. If you specify a 1419Note that this command can also be used to create folders. If you
1345folder that does not exist, you will be prompted to create it. 1420specify a folder that does not exist, you will be prompted to create
1421it.
1346 1422
1347Do not call this function from outside MH-E; use \\[mh-rmail] instead. 1423Do not call this function from outside MH-E; use \\[mh-rmail] instead.
1348 1424
1349If, in a program, RANGE is nil (the default), then all messages in FOLDER are 1425If, in a program, RANGE is nil (the default), then all messages in
1350displayed. If an index buffer is being created then INDEX-DATA is used to 1426FOLDER are displayed. If an index buffer is being created then
1351initialize the index buffer specific data structures." 1427INDEX-DATA is used to initialize the index buffer specific data
1428structures."
1352 (interactive (let ((folder-name (mh-prompt-for-folder "Visit" mh-inbox t))) 1429 (interactive (let ((folder-name (mh-prompt-for-folder "Visit" mh-inbox t)))
1353 (list folder-name 1430 (list folder-name
1354 (mh-read-range "Scan" folder-name t nil 1431 (mh-read-range "Scan" folder-name t nil
@@ -1387,10 +1464,11 @@ initialize the index buffer specific data structures."
1387 1464
1388(defun mh-update-sequences () 1465(defun mh-update-sequences ()
1389 "Flush MH-E's state out to MH. 1466 "Flush MH-E's state out to MH.
1390This function updates the sequence specified by your \"Unseen-Sequence:\" 1467
1391profile component, \"cur\", and the sequence listed by the `mh-tick-seq' 1468This function updates the sequence specified by your
1392option which is \"tick\" by default. The message at the cursor is used for 1469\"Unseen-Sequence:\" profile component, \"cur\", and the sequence
1393\"cur\"." 1470listed by the `mh-tick-seq' option which is \"tick\" by default.
1471The message at the cursor is used for \"cur\"."
1394 (interactive) 1472 (interactive)
1395 ;; mh-update-sequences is the opposite of mh-read-folder-sequences, 1473 ;; mh-update-sequences is the opposite of mh-read-folder-sequences,
1396 ;; which updates MH-E's state from MH. 1474 ;; which updates MH-E's state from MH.
@@ -1420,10 +1498,9 @@ option which is \"tick\" by default. The message at the cursor is used for
1420(defun mh-delete-a-msg (message) 1498(defun mh-delete-a-msg (message)
1421 "Delete MESSAGE. 1499 "Delete MESSAGE.
1422If MESSAGE is nil then the message at point is deleted. 1500If MESSAGE is nil then the message at point is deleted.
1423 1501The hook `mh-delete-msg-hook' is called after you mark a message
1424The hook `mh-delete-msg-hook' is called after you mark a message for deletion. 1502for deletion. For example, a past maintainer of MH-E used this
1425For example, a past maintainer of MH-E used this once when he kept statistics 1503once when he kept statistics on his mail usage."
1426on his mail usage."
1427 (save-excursion 1504 (save-excursion
1428 (if (numberp message) 1505 (if (numberp message)
1429 (mh-goto-msg message nil t) 1506 (mh-goto-msg message nil t)
@@ -1441,10 +1518,9 @@ on his mail usage."
1441(defun mh-refile-a-msg (message folder) 1518(defun mh-refile-a-msg (message folder)
1442 "Refile MESSAGE in FOLDER. 1519 "Refile MESSAGE in FOLDER.
1443If MESSAGE is nil then the message at point is refiled. 1520If MESSAGE is nil then the message at point is refiled.
1444
1445Folder is a symbol, not a string. 1521Folder is a symbol, not a string.
1446The hook `mh-refile-msg-hook' is called after a message is marked to be 1522The hook `mh-refile-msg-hook' is called after a message is marked to
1447refiled." 1523be refiled."
1448 (save-excursion 1524 (save-excursion
1449 (if (numberp message) 1525 (if (numberp message)
1450 (mh-goto-msg message nil t) 1526 (mh-goto-msg message nil t)
@@ -1471,9 +1547,9 @@ refiled."
1471 1547
1472(defun mh-next-msg (&optional wait-after-complaining-flag) 1548(defun mh-next-msg (&optional wait-after-complaining-flag)
1473 "Move backward or forward to the next undeleted message in the buffer. 1549 "Move backward or forward to the next undeleted message in the buffer.
1474If optional argument WAIT-AFTER-COMPLAINING-FLAG is non-nil and we are at the 1550If optional argument WAIT-AFTER-COMPLAINING-FLAG is non-nil and
1475last message, then wait for a second after telling the user that there aren't 1551we are at the last message, then wait for a second after telling
1476any more unread messages." 1552the user that there aren't any more unread messages."
1477 (if (eq mh-next-direction 'forward) 1553 (if (eq mh-next-direction 'forward)
1478 (mh-next-undeleted-msg 1 wait-after-complaining-flag) 1554 (mh-next-undeleted-msg 1 wait-after-complaining-flag)
1479 (mh-previous-undeleted-msg 1 wait-after-complaining-flag))) 1555 (mh-previous-undeleted-msg 1 wait-after-complaining-flag)))
@@ -1481,8 +1557,8 @@ any more unread messages."
1481(defun mh-next-unread-msg (&optional count) 1557(defun mh-next-unread-msg (&optional count)
1482 "Display next unread message. 1558 "Display next unread message.
1483 1559
1484This command can be given a prefix argument COUNT to specify how many unread 1560This command can be given a prefix argument COUNT to specify how
1485messages to skip." 1561many unread messages to skip."
1486 (interactive "p") 1562 (interactive "p")
1487 (unless (> count 0) 1563 (unless (> count 0)
1488 (error "The function mh-next-unread-msg expects positive argument")) 1564 (error "The function mh-next-unread-msg expects positive argument"))
@@ -1659,9 +1735,9 @@ Make it the current folder."
1659 1735
1660(defmacro mh-write-file-functions-compat () 1736(defmacro mh-write-file-functions-compat ()
1661 "Return `write-file-functions' if it exists. 1737 "Return `write-file-functions' if it exists.
1662Otherwise return `local-write-file-hooks'. This macro exists purely for 1738Otherwise return `local-write-file-hooks'. This macro exists
1663compatibility. The former symbol is used in Emacs 21.4 onward while the latter 1739purely for compatibility. The former symbol is used in Emacs 21.4
1664is used in previous versions and XEmacs." 1740onward while the latter is used in previous versions and XEmacs."
1665 (if (boundp 'write-file-functions) 1741 (if (boundp 'write-file-functions)
1666 ''write-file-functions ;Emacs 21.4 1742 ''write-file-functions ;Emacs 21.4
1667 ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs 1743 ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs
@@ -1685,36 +1761,40 @@ is used in previous versions and XEmacs."
1685(define-derived-mode mh-folder-mode fundamental-mode "MH-Folder" 1761(define-derived-mode mh-folder-mode fundamental-mode "MH-Folder"
1686 "Major MH-E mode for \"editing\" an MH folder scan listing.\\<mh-folder-mode-map> 1762 "Major MH-E mode for \"editing\" an MH folder scan listing.\\<mh-folder-mode-map>
1687 1763
1688You can show the message the cursor is pointing to, and step through the 1764You can show the message the cursor is pointing to, and step through
1689messages. Messages can be marked for deletion or refiling into another 1765the messages. Messages can be marked for deletion or refiling into
1690folder; these commands are executed all at once with a separate command. 1766another folder; these commands are executed all at once with a
1767separate command.
1691 1768
1692Options that control this mode can be changed with \\[customize-group]; 1769Options that control this mode can be changed with
1693specify the \"mh\" group. In particular, please see the `mh-scan-format-file' 1770\\[customize-group]; specify the \"mh\" group. In particular, please
1694option if you wish to modify scan's format. 1771see the `mh-scan-format-file' option if you wish to modify scan's
1772format.
1695 1773
1696When a folder is visited, the hook `mh-folder-mode-hook' is run. 1774When a folder is visited, the hook `mh-folder-mode-hook' is run.
1697 1775
1698Ranges 1776Ranges
1699====== 1777======
1700Many commands that operate on individual messages, such as `mh-forward' or 1778Many commands that operate on individual messages, such as
1701`mh-refile-msg' take a RANGE argument. This argument can be used in several 1779`mh-forward' or `mh-refile-msg' take a RANGE argument. This argument
1702ways. 1780can be used in several ways.
1703 1781
1704If you provide the prefix argument (\\[universal-argument]) to these commands, 1782If you provide the prefix argument (\\[universal-argument]) to
1705then you will be prompted for the message range. This can be any valid MH 1783these commands, then you will be prompted for the message range.
1706range which can include messages, sequences, and the abbreviations (described 1784This can be any valid MH range which can include messages,
1707in the mh(1) man page): 1785sequences, and the abbreviations (described in the mh(1) man
1786page):
1708 1787
1709<num1>-<num2> 1788<num1>-<num2>
1710 Indicates all messages in the range <num1> to <num2>, inclusive. The range 1789 Indicates all messages in the range <num1> to <num2>, inclusive.
1711 must be nonempty. 1790 The range must be nonempty.
1712 1791
1713`<num>:N' 1792`<num>:N'
1714`<num>:+N' 1793`<num>:+N'
1715`<num>:-N' 1794`<num>:-N'
1716 Up to N messages beginning with (or ending with) message num. Num may be 1795 Up to N messages beginning with (or ending with) message num. Num
1717 any of the predefined symbols: first, prev, cur, next or last. 1796 may be any of the predefined symbols: first, prev, cur, next or
1797 last.
1718 1798
1719`first:N' 1799`first:N'
1720`prev:N' 1800`prev:N'
@@ -1725,12 +1805,12 @@ in the mh(1) man page):
1725`all' 1805`all'
1726 All of the messages. 1806 All of the messages.
1727 1807
1728For example, a range that shows all of these things is `1 2 3 5-10 last:5 1808For example, a range that shows all of these things is `1 2 3
1729unseen'. 18095-10 last:5 unseen'.
1730 1810
1731If the option `transient-mark-mode' is set to t and you set a region in the 1811If the option `transient-mark-mode' is set to t and you set a
1732MH-Folder buffer, then the MH-E command will perform the operation on all 1812region in the MH-Folder buffer, then the MH-E command will
1733messages in that region. 1813perform the operation on all messages in that region.
1734 1814
1735\\{mh-folder-mode-map}" 1815\\{mh-folder-mode-map}"
1736 (mh-do-in-gnu-emacs 1816 (mh-do-in-gnu-emacs
@@ -1835,10 +1915,10 @@ messages in that region.
1835 desktop-buffer-name 1915 desktop-buffer-name
1836 desktop-buffer-misc) 1916 desktop-buffer-misc)
1837 "Restore an MH folder buffer specified in a desktop file. 1917 "Restore an MH folder buffer specified in a desktop file.
1838When desktop creates a buffer, DESKTOP-BUFFER-FILE-NAME holds the file name to 1918When desktop creates a buffer, DESKTOP-BUFFER-FILE-NAME holds the
1839visit, DESKTOP-BUFFER-NAME holds the desired buffer name, and 1919file name to visit, DESKTOP-BUFFER-NAME holds the desired buffer
1840DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the 1920name, and DESKTOP-BUFFER-MISC holds a list of miscellaneous info
1841`desktop-buffer-handlers' functions." 1921used by the `desktop-buffer-handlers' functions."
1842 (mh-find-path) 1922 (mh-find-path)
1843 (mh-visit-folder desktop-buffer-name) 1923 (mh-visit-folder desktop-buffer-name)
1844 (current-buffer)) 1924 (current-buffer))
@@ -1851,13 +1931,14 @@ DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the
1851(defun mh-scan-folder (folder range &optional dont-exec-pending) 1931(defun mh-scan-folder (folder range &optional dont-exec-pending)
1852 "Scan FOLDER over RANGE. 1932 "Scan FOLDER over RANGE.
1853 1933
1854After the scan is performed, switch to the buffer associated with FOLDER. 1934After the scan is performed, switch to the buffer associated with
1935FOLDER.
1855 1936
1856Check the documentation of `mh-interactive-range' to see how RANGE is read in 1937Check the documentation of `mh-interactive-range' to see how RANGE is
1857interactive use. 1938read in interactive use.
1858 1939
1859The processing of outstanding commands is not performed if DONT-EXEC-PENDING 1940The processing of outstanding commands is not performed if
1860is non-nil." 1941DONT-EXEC-PENDING is non-nil."
1861 (when (stringp range) 1942 (when (stringp range)
1862 (setq range (delete "" (split-string range "[ \t\n]")))) 1943 (setq range (delete "" (split-string range "[ \t\n]"))))
1863 (cond ((null (get-buffer folder)) 1944 (cond ((null (get-buffer folder))
@@ -1880,11 +1961,12 @@ is non-nil."
1880 "Return the column for notations given message number WIDTH. 1961 "Return the column for notations given message number WIDTH.
1881Note that columns in Emacs start with 0. 1962Note that columns in Emacs start with 0.
1882 1963
1883If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this means that 1964If `mh-scan-format-file' is set to \"Use MH-E scan Format\" this
1884either `mh-scan-format-mh' or `mh-scan-format-nmh' are in use. This function 1965means that either `mh-scan-format-mh' or `mh-scan-format-nmh' are
1885therefore assumes that the first column is empty (to provide room for the 1966in use. This function therefore assumes that the first column is
1886cursor), the following WIDTH columns contain the message number, and the 1967empty (to provide room for the cursor), the following WIDTH
1887column for notations comes after that." 1968columns contain the message number, and the column for notations
1969comes after that."
1888 (if (eq mh-scan-format-file t) 1970 (if (eq mh-scan-format-file t)
1889 (max (1+ width) 2) 1971 (max (1+ width) 2)
1890 (error "%s %s" "Can't call mh-msg-num-width-to-column" 1972 (error "%s %s" "Can't call mh-msg-num-width-to-column"
@@ -1943,9 +2025,9 @@ If UPDATE, append the scan lines, otherwise replace."
1943After doing an `mh-get-new-mail' operation in this FOLDER, at least 2025After doing an `mh-get-new-mail' operation in this FOLDER, at least
1944one line that looks like a truncated message number was found. 2026one line that looks like a truncated message number was found.
1945 2027
1946Remove the text added by the last `mh-inc' command. It should be the messages 2028Remove the text added by the last `mh-inc' command. It should be the
1947cur-last. Call `mh-set-cmd-note', adjusting the notation column with the width 2029messages cur-last. Call `mh-set-cmd-note', adjusting the notation
1948of the largest message number in FOLDER. 2030column with the width of the largest message number in FOLDER.
1949 2031
1950Reformat the message number width on each line in the buffer and trim 2032Reformat the message number width on each line in the buffer and trim
1951the line length to fit in the window. 2033the line length to fit in the window.
@@ -2066,8 +2148,9 @@ Return in the current buffer."
2066 2148
2067(defun mh-make-folder-mode-line (&optional ignored) 2149(defun mh-make-folder-mode-line (&optional ignored)
2068 "Set the fields of the mode line for a folder buffer. 2150 "Set the fields of the mode line for a folder buffer.
2069The optional argument is now obsolete and IGNORED. It used to be used to pass 2151The optional argument is now obsolete and IGNORED. It used to be
2070in what is now stored in the buffer-local variable `mh-mode-line-annotation'." 2152used to pass in what is now stored in the buffer-local variable
2153`mh-mode-line-annotation'."
2071 (save-excursion 2154 (save-excursion
2072 (save-window-excursion 2155 (save-window-excursion
2073 (mh-first-msg) 2156 (mh-first-msg)
@@ -2107,8 +2190,8 @@ in what is now stored in the buffer-local variable `mh-mode-line-annotation'."
2107 2190
2108(defun mh-add-sequence-notation (msg internal-seq-flag) 2191(defun mh-add-sequence-notation (msg internal-seq-flag)
2109 "Add sequence notation to the MSG on the current line. 2192 "Add sequence notation to the MSG on the current line.
2110If INTERNAL-SEQ-FLAG is non-nil, then refontify the scan line if font-lock is 2193If INTERNAL-SEQ-FLAG is non-nil, then refontify the scan line if
2111turned on." 2194font-lock is turned on."
2112 (with-mh-folder-updating (t) 2195 (with-mh-folder-updating (t)
2113 (save-excursion 2196 (save-excursion
2114 (beginning-of-line) 2197 (beginning-of-line)
@@ -2129,10 +2212,11 @@ turned on."
2129 2212
2130(defun mh-remove-sequence-notation (msg internal-seq-flag &optional all) 2213(defun mh-remove-sequence-notation (msg internal-seq-flag &optional all)
2131 "Remove sequence notation from the MSG on the current line. 2214 "Remove sequence notation from the MSG on the current line.
2132If INTERNAL-SEQ-FLAG is non-nil, then `font-lock' was used to highlight the 2215If INTERNAL-SEQ-FLAG is non-nil, then `font-lock' was used to
2133sequence. In that case, no notation needs to be removed. Otherwise the effect 2216highlight the sequence. In that case, no notation needs to be removed.
2134of inserting `mh-note-seq' needs to be reversed. 2217Otherwise the effect of inserting `mh-note-seq' needs to be reversed.
2135If ALL is non-nil, then all sequence marks on the scan line are removed." 2218If ALL is non-nil, then all sequence marks on the scan line are
2219removed."
2136 (with-mh-folder-updating (t) 2220 (with-mh-folder-updating (t)
2137 ;; This takes care of internal sequences... 2221 ;; This takes care of internal sequences...
2138 (mh-notate nil nil mh-cmd-note) 2222 (mh-notate nil nil mh-cmd-note)
@@ -2172,8 +2256,8 @@ If ALL is non-nil, then all sequence marks on the scan line are removed."
2172 2256
2173(defun mh-goto-cur-msg (&optional minimal-changes-flag) 2257(defun mh-goto-cur-msg (&optional minimal-changes-flag)
2174 "Position the cursor at the current message. 2258 "Position the cursor at the current message.
2175When optional argument MINIMAL-CHANGES-FLAG is non-nil, the function doesn't 2259When optional argument MINIMAL-CHANGES-FLAG is non-nil, the
2176recenter the folder buffer." 2260function doesn't recenter the folder buffer."
2177 (let ((cur-msg (car (mh-seq-to-msgs 'cur)))) 2261 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
2178 (cond ((and cur-msg 2262 (cond ((and cur-msg
2179 (mh-goto-msg cur-msg t t)) 2263 (mh-goto-msg cur-msg t t))
@@ -2187,7 +2271,8 @@ recenter the folder buffer."
2187 2271
2188(defun mh-process-or-undo-commands (folder) 2272(defun mh-process-or-undo-commands (folder)
2189 "If FOLDER has outstanding commands, then either process or discard them. 2273 "If FOLDER has outstanding commands, then either process or discard them.
2190Called by functions like `mh-sort-folder', so also invalidate show buffer." 2274Called by functions like `mh-sort-folder', so also invalidate
2275show buffer."
2191 (set-buffer folder) 2276 (set-buffer folder)
2192 (if (mh-outstanding-commands-p) 2277 (if (mh-outstanding-commands-p)
2193 (if (or mh-do-not-confirm-flag 2278 (if (or mh-do-not-confirm-flag
@@ -2202,9 +2287,9 @@ Called by functions like `mh-sort-folder', so also invalidate show buffer."
2202(defun mh-process-commands (folder) 2287(defun mh-process-commands (folder)
2203 "Process outstanding commands for FOLDER. 2288 "Process outstanding commands for FOLDER.
2204 2289
2205This function runs `mh-before-commands-processed-hook' before the commands are 2290This function runs `mh-before-commands-processed-hook' before the
2206processed and `mh-after-commands-processed-hook' after the commands are 2291commands are processed and `mh-after-commands-processed-hook'
2207processed." 2292after the commands are processed."
2208 (message "Processing deletes and refiles for %s..." folder) 2293 (message "Processing deletes and refiles for %s..." folder)
2209 (set-buffer folder) 2294 (set-buffer folder)
2210 (with-mh-folder-updating (nil) 2295 (with-mh-folder-updating (nil)
@@ -2334,8 +2419,8 @@ is updated."
2334(defun mh-coalesce-msg-list (messages) 2419(defun mh-coalesce-msg-list (messages)
2335 "Given a list of MESSAGES, return a list of message number ranges. 2420 "Given a list of MESSAGES, return a list of message number ranges.
2336This is the inverse of `mh-read-msg-list', which expands ranges. 2421This is the inverse of `mh-read-msg-list', which expands ranges.
2337Message lists passed to MH programs should be processed by this function 2422Message lists passed to MH programs should be processed by this
2338to avoid exceeding system command line argument limits." 2423function to avoid exceeding system command line argument limits."
2339 (let ((msgs (sort (copy-sequence messages) 'mh-greaterp)) 2424 (let ((msgs (sort (copy-sequence messages) 'mh-greaterp))
2340 (range-high nil) 2425 (range-high nil)
2341 (prev -1) 2426 (prev -1)
@@ -2433,8 +2518,9 @@ Expands ranges into set of individual numbers."
2433(defun mh-notate-user-sequences (&optional range) 2518(defun mh-notate-user-sequences (&optional range)
2434 "Mark user-defined sequences in RANGE. 2519 "Mark user-defined sequences in RANGE.
2435 2520
2436Check the documentation of `mh-interactive-range' to see how RANGE is read in 2521Check the documentation of `mh-interactive-range' to see how
2437interactive use; if nil all messages are notated." 2522RANGE is read in interactive use; if nil all messages are
2523notated."
2438 (unless range 2524 (unless range
2439 (setq range (cons (point-min) (point-max)))) 2525 (setq range (cons (point-min) (point-max))))
2440 (let ((seqs mh-seq-list) 2526 (let ((seqs mh-seq-list)
@@ -2464,10 +2550,11 @@ interactive use; if nil all messages are notated."
2464(defun mh-delete-msg-from-seq (range sequence &optional internal-flag) 2550(defun mh-delete-msg-from-seq (range sequence &optional internal-flag)
2465 "Delete RANGE from SEQUENCE. 2551 "Delete RANGE from SEQUENCE.
2466 2552
2467Check the documentation of `mh-interactive-range' to see how RANGE is read in 2553Check the documentation of `mh-interactive-range' to see how
2468interactive use. 2554RANGE is read in interactive use.
2469 2555
2470In a program, non-nil INTERNAL-FLAG means do not inform MH of the change." 2556In a program, non-nil INTERNAL-FLAG means do not inform MH of the
2557change."
2471 (interactive (list (mh-interactive-range "Delete") 2558 (interactive (list (mh-interactive-range "Delete")
2472 (mh-read-seq-default "Delete from" t) 2559 (mh-read-seq-default "Delete from" t)
2473 nil)) 2560 nil))
@@ -2495,15 +2582,16 @@ In a program, non-nil INTERNAL-FLAG means do not inform MH of the change."
2495(defun mh-catchup (range) 2582(defun mh-catchup (range)
2496 "Delete RANGE from the \"unseen\" sequence. 2583 "Delete RANGE from the \"unseen\" sequence.
2497 2584
2498Check the documentation of `mh-interactive-range' to see how RANGE is read in 2585Check the documentation of `mh-interactive-range' to see how
2499interactive use." 2586RANGE is read in interactive use."
2500 (interactive (list (mh-interactive-range "Catchup" 2587 (interactive (list (mh-interactive-range "Catchup"
2501 (cons (point-min) (point-max))))) 2588 (cons (point-min) (point-max)))))
2502 (mh-delete-msg-from-seq range mh-unseen-seq)) 2589 (mh-delete-msg-from-seq range mh-unseen-seq))
2503 2590
2504(defun mh-delete-a-msg-from-seq (msg sequence internal-flag) 2591(defun mh-delete-a-msg-from-seq (msg sequence internal-flag)
2505 "Delete MSG from SEQUENCE. 2592 "Delete MSG from SEQUENCE.
2506If INTERNAL-FLAG is non-nil, then do not inform MH of the change." 2593If INTERNAL-FLAG is non-nil, then do not inform MH of the
2594change."
2507 (let ((entry (mh-find-seq sequence))) 2595 (let ((entry (mh-find-seq sequence)))
2508 (when (and entry (memq msg (mh-seq-msgs entry))) 2596 (when (and entry (memq msg (mh-seq-msgs entry)))
2509 (if (not internal-flag) 2597 (if (not internal-flag)
@@ -2530,7 +2618,8 @@ Signals an error if SEQ is an invalid name."
2530 2618
2531(defun mh-seq-containing-msg (msg &optional include-internal-flag) 2619(defun mh-seq-containing-msg (msg &optional include-internal-flag)
2532 "Return a list of the sequences containing MSG. 2620 "Return a list of the sequences containing MSG.
2533If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." 2621If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences
2622in list."
2534 (let ((l mh-seq-list) 2623 (let ((l mh-seq-list)
2535 (seqs ())) 2624 (seqs ()))
2536 (while l 2625 (while l
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index ee8e757e728..5c3db1dd809 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -57,17 +57,19 @@
57(defun mh-burst-digest () 57(defun mh-burst-digest ()
58 "Break up digest into separate messages\\<mh-folder-mode-map>. 58 "Break up digest into separate messages\\<mh-folder-mode-map>.
59 59
60This command uses the MH command \"burst\" to break out each message in the 60This command uses the MH command \"burst\" to break out each
61digest into its own message. Using this command, you can quickly delete 61message in the digest into its own message. Using this command,
62unwanted messages, like this: Once the digest is split up, toggle out of 62you can quickly delete unwanted messages, like this: Once the
63MH-Folder Show mode with \\[mh-toggle-showing] so that the scan lines fill the 63digest is split up, toggle out of MH-Folder Show mode with
64screen and messages aren't displayed. Then use \\[mh-delete-msg] to quickly 64\\[mh-toggle-showing] so that the scan lines fill the screen and
65delete messages that you don't want to read (based on the \"Subject:\" header 65messages aren't displayed. Then use \\[mh-delete-msg] to quickly
66field). You can also burst the digest to reply directly to the people who 66delete messages that you don't want to read (based on the
67posted the messages in the digest. One problem you may encounter is that the 67\"Subject:\" header field). You can also burst the digest to
68\"From:\" header fields are preceded with a \">\" so that your reply can't 68reply directly to the people who posted the messages in the
69create the \"To:\" field correctly. In this case, you must correct the \"To:\" 69digest. One problem you may encounter is that the \"From:\"
70field yourself." 70header fields are preceded with a \">\" so that your reply can't
71create the \"To:\" field correctly. In this case, you must
72correct the \"To:\" field yourself."
71 (interactive) 73 (interactive)
72 (let ((digest (mh-get-msg-num t))) 74 (let ((digest (mh-get-msg-num t)))
73 (mh-process-or-undo-commands mh-current-folder) 75 (mh-process-or-undo-commands mh-current-folder)
@@ -85,15 +87,15 @@ field yourself."
85(defun mh-copy-msg (range folder) 87(defun mh-copy-msg (range folder)
86 "Copy RANGE to FOLDER\\<mh-folder-mode-map>. 88 "Copy RANGE to FOLDER\\<mh-folder-mode-map>.
87 89
88If you wish to copy a message to another folder, you can use this command 90If you wish to copy a message to another folder, you can use this
89\(see the \"-link\" argument to \"refile\"). Like the command 91command \(see the \"-link\" argument to \"refile\"). Like the
90\\[mh-refile-msg], this command prompts you for the name of the target folder 92command \\[mh-refile-msg], this command prompts you for the name
91and you can specify a range. Note that unlike the command \\[mh-refile-msg], 93of the target folder and you can specify a range. Note that
92the copy takes place immediately. The original copy remains in the current 94unlike the command \\[mh-refile-msg], the copy takes place
93folder. 95immediately. The original copy remains in the current folder.
94 96
95Check the documentation of `mh-interactive-range' to see how RANGE is read in 97Check the documentation of `mh-interactive-range' to see how
96interactive use." 98RANGE is read in interactive use."
97 (interactive (list (mh-interactive-range "Copy") 99 (interactive (list (mh-interactive-range "Copy")
98 (mh-prompt-for-folder "Copy to" "" t))) 100 (mh-prompt-for-folder "Copy to" "" t)))
99 (let ((msg-list (let ((result ())) 101 (let ((msg-list (let ((result ()))
@@ -108,13 +110,13 @@ interactive use."
108(defun mh-kill-folder () 110(defun mh-kill-folder ()
109 "Remove folder. 111 "Remove folder.
110 112
111Remove all of the messages (files) within the current folder, and then 113Remove all of the messages (files) within the current folder, and
112remove the folder (directory) itself. 114then remove the folder (directory) itself.
113 115
114Run the abnormal hook `mh-kill-folder-suppress-prompt-hooks'. The hook 116Run the abnormal hook `mh-kill-folder-suppress-prompt-hooks'. The
115functions are called with no arguments and should return a non-nil 117hook functions are called with no arguments and should return a
116value to suppress the normal prompt when you remove a folder. This is 118non-nil value to suppress the normal prompt when you remove a
117useful for folders that are easily regenerated." 119folder. This is useful for folders that are easily regenerated."
118 (interactive) 120 (interactive)
119 (if (or (run-hook-with-args-until-success 121 (if (or (run-hook-with-args-until-success
120 'mh-kill-folder-suppress-prompt-hooks) 122 'mh-kill-folder-suppress-prompt-hooks)
@@ -172,14 +174,15 @@ Display the results only if something went wrong."
172(defun mh-pack-folder (range) 174(defun mh-pack-folder (range)
173 "Pack folder\\<mh-folder-mode-map>. 175 "Pack folder\\<mh-folder-mode-map>.
174 176
175This command packs the folder, removing gaps from the numbering sequence. If 177This command packs the folder, removing gaps from the numbering
176you don't want to rescan the entire folder afterward, this command will accept 178sequence. If you don't want to rescan the entire folder
177a RANGE. Check the documentation of `mh-interactive-range' to see how RANGE is 179afterward, this command will accept a RANGE. Check the
178read in interactive use. 180documentation of `mh-interactive-range' to see how RANGE is read
181in interactive use.
179 182
180This command will ask if you want to process refiles or deletes first and then 183This command will ask if you want to process refiles or deletes
181either run \\[mh-execute-commands] for you or undo the pending refiles and 184first and then either run \\[mh-execute-commands] for you or undo
182deletes, which are lost." 185the pending refiles and deletes, which are lost."
183 (interactive (list (if current-prefix-arg 186 (interactive (list (if current-prefix-arg
184 (mh-read-range "Scan" mh-current-folder t nil t 187 (mh-read-range "Scan" mh-current-folder t nil t
185 mh-interpret-number-as-range-flag) 188 mh-interpret-number-as-range-flag)
@@ -210,9 +213,10 @@ Display RANGE after packing, or the entire folder if RANGE is nil."
210(defun mh-pipe-msg (command include-header) 213(defun mh-pipe-msg (command include-header)
211 "Pipe message through shell command COMMAND. 214 "Pipe message through shell command COMMAND.
212 215
213You are prompted for the Unix command through which you wish to run your 216You are prompted for the Unix command through which you wish to
214message. If you give an argument INCLUDE-HEADER to this command, the message 217run your message. If you give an argument INCLUDE-HEADER to this
215header is included in the text passed to the command." 218command, the message header is included in the text passed to the
219command."
216 (interactive 220 (interactive
217 (list (read-string "Shell command on message: ") current-prefix-arg)) 221 (list (read-string "Shell command on message: ") current-prefix-arg))
218 (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t))) 222 (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t)))
@@ -263,9 +267,11 @@ header is included in the text passed to the command."
263;;;###mh-autoload 267;;;###mh-autoload
264(defun mh-sort-folder (&optional extra-args) 268(defun mh-sort-folder (&optional extra-args)
265 "Sort the messages in the current folder by date. 269 "Sort the messages in the current folder by date.
270
266Calls the MH program sortm to do the work. 271Calls the MH program sortm to do the work.
267The arguments in the list `mh-sortm-args' are passed to sortm if the optional 272
268argument EXTRA-ARGS is given." 273The arguments in the list `mh-sortm-args' are passed to sortm if
274the optional argument EXTRA-ARGS is given."
269 (interactive "P") 275 (interactive "P")
270 (mh-process-or-undo-commands mh-current-folder) 276 (mh-process-or-undo-commands mh-current-folder)
271 (setq mh-next-direction 'forward) 277 (setq mh-next-direction 'forward)
@@ -299,10 +305,11 @@ argument EXTRA-ARGS is given."
299(defun mh-store-msg (directory) 305(defun mh-store-msg (directory)
300 "Unpack message created with `uudecode' or `shar'. 306 "Unpack message created with `uudecode' or `shar'.
301 307
302The default DIRECTORY for extraction is the current directory; however, you 308The default DIRECTORY for extraction is the current directory;
303have a chance to specify a different extraction directory. The next time you 309however, you have a chance to specify a different extraction
304use this command, the default directory is the last directory you used. If you 310directory. The next time you use this command, the default
305would like to change the initial default directory, customize the option 311directory is the last directory you used. If you would like to
312change the initial default directory, customize the option
306`mh-store-default-directory'." 313`mh-store-default-directory'."
307 (interactive (list (let ((udir (or mh-store-default-directory 314 (interactive (list (let ((udir (or mh-store-default-directory
308 default-directory))) 315 default-directory)))
@@ -318,9 +325,11 @@ would like to change the initial default directory, customize the option
318;;;###mh-autoload 325;;;###mh-autoload
319(defun mh-store-buffer (directory) 326(defun mh-store-buffer (directory)
320 "Store the file(s) contained in the current buffer into DIRECTORY. 327 "Store the file(s) contained in the current buffer into DIRECTORY.
328
321The buffer can contain a shar file or uuencoded file. 329The buffer can contain a shar file or uuencoded file.
322Default directory is the last directory used, or initially the value of 330
323`mh-store-default-directory' or the current directory." 331Default directory is the last directory used, or initially the
332value of `mh-store-default-directory' or the current directory."
324 (interactive (list (let ((udir (or mh-store-default-directory 333 (interactive (list (let ((udir (or mh-store-default-directory
325 default-directory))) 334 default-directory)))
326 (read-file-name "Store buffer in directory: " 335 (read-file-name "Store buffer in directory: "
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el
index 71220e2dd3d..a52bc5e463e 100644
--- a/lisp/mh-e/mh-gnus.el
+++ b/lisp/mh-e/mh-gnus.el
@@ -41,9 +41,9 @@
41 41
42(defmacro mh-defun-compat (function arg-list &rest body) 42(defmacro mh-defun-compat (function arg-list &rest body)
43 "This is a macro to define functions which are not defined. 43 "This is a macro to define functions which are not defined.
44It is used for Gnus utility functions which were added recently. If FUNCTION 44It is used for Gnus utility functions which were added recently.
45is not defined then it is defined to have argument list, ARG-LIST and body, 45If FUNCTION is not defined then it is defined to have argument
46BODY." 46list, ARG-LIST and body, BODY."
47 (let ((defined-p (fboundp function))) 47 (let ((defined-p (fboundp function)))
48 (unless defined-p 48 (unless defined-p
49 `(defun ,function ,arg-list ,@body)))) 49 `(defun ,function ,arg-list ,@body))))
@@ -51,9 +51,9 @@ BODY."
51 51
52(defmacro mh-defmacro-compat (function arg-list &rest body) 52(defmacro mh-defmacro-compat (function arg-list &rest body)
53 "This is a macro to define functions which are not defined. 53 "This is a macro to define functions which are not defined.
54It is used for Gnus utility functions which were added recently. If FUNCTION 54It is used for Gnus utility functions which were added recently.
55is not defined then it is defined to have argument list, ARG-LIST and body, 55If FUNCTION is not defined then it is defined to have argument
56BODY." 56list, ARG-LIST and body, BODY."
57 (let ((defined-p (fboundp function))) 57 (let ((defined-p (fboundp function)))
58 (unless defined-p 58 (unless defined-p
59 `(defmacro ,function ,arg-list ,@body)))) 59 `(defmacro ,function ,arg-list ,@body))))
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index 1e621af7df9..508b747718c 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -47,14 +47,15 @@
47 47
48(defvar mh-identity-pgg-default-user-id nil 48(defvar mh-identity-pgg-default-user-id nil
49 "Holds the GPG key ID to be used by pgg.el. 49 "Holds the GPG key ID to be used by pgg.el.
50This is normally set as part of an Identity in `mh-identity-list'.") 50This is normally set as part of an Identity in
51`mh-identity-list'.")
51(make-variable-buffer-local 'mh-identity-pgg-default-user-id) 52(make-variable-buffer-local 'mh-identity-pgg-default-user-id)
52 53
53;;;###mh-autoload 54;;;###mh-autoload
54(defun mh-identity-make-menu () 55(defun mh-identity-make-menu ()
55 "Build the Identity menu. 56 "Build the Identity menu.
56This should be called any time `mh-identity-list' or `mh-auto-fields-list' 57This should be called any time `mh-identity-list' or
57change." 58`mh-auto-fields-list' change."
58 (easy-menu-define mh-identity-menu mh-letter-mode-map 59 (easy-menu-define mh-identity-menu mh-letter-mode-map
59 "MH-E identity menu" 60 "MH-E identity menu"
60 (append 61 (append
@@ -87,9 +88,9 @@ change."
87;;;###mh-autoload 88;;;###mh-autoload
88(defun mh-identity-list-set (symbol value) 89(defun mh-identity-list-set (symbol value)
89 "Update the `mh-identity-list' variable, and rebuild the menu. 90 "Update the `mh-identity-list' variable, and rebuild the menu.
90Sets the default for SYMBOL (for example, `mh-identity-list') to VALUE (as set 91Sets the default for SYMBOL (for example, `mh-identity-list') to
91in customization). This is called after 'customize is used to alter 92VALUE (as set in customization). This is called after 'customize
92`mh-identity-list'." 93is used to alter `mh-identity-list'."
93 (set-default symbol value) 94 (set-default symbol value)
94 (mh-identity-make-menu)) 95 (mh-identity-make-menu))
95 96
@@ -120,10 +121,10 @@ Return t if anything is deleted."
120 121
121(defun mh-identity-field-handler (field) 122(defun mh-identity-field-handler (field)
122 "Return the handler for header FIELD or nil if none set. 123 "Return the handler for header FIELD or nil if none set.
123The field name is downcased. If the FIELD begins with the character 124The field name is downcased. If the FIELD begins with the
124`:', then it must have a special handler defined in 125character `:', then it must have a special handler defined in
125`mh-identity-handlers', else return an error since it is not a valid 126`mh-identity-handlers', else return an error since it is not a
126header field." 127valid header field."
127 (or (cdr (mh-assoc-ignore-case field mh-identity-handlers)) 128 (or (cdr (mh-assoc-ignore-case field mh-identity-handlers))
128 (and (eq (aref field 0) ?:) 129 (and (eq (aref field 0) ?:)
129 (error "Field %s - unknown mh-identity-handler" field)) 130 (error "Field %s - unknown mh-identity-handler" field))
@@ -169,8 +170,8 @@ See `mh-identity-list'."
169(defun mh-identity-handler-gpg-identity (field action &optional value) 170(defun mh-identity-handler-gpg-identity (field action &optional value)
170 "Process header FIELD \":pgg-default-user-id\". 171 "Process header FIELD \":pgg-default-user-id\".
171The ACTION is one of 'remove or 'add. If 'add, the VALUE is added. 172The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
172The buffer-local variable `mh-identity-pgg-default-user-id' is set to VALUE 173The buffer-local variable `mh-identity-pgg-default-user-id' is set to
173when action 'add is selected." 174VALUE when action 'add is selected."
174 (cond 175 (cond
175 ((or (equal action 'remove) 176 ((or (equal action 'remove)
176 (not value) 177 (not value)
@@ -182,7 +183,8 @@ when action 'add is selected."
182;;;###mh-autoload 183;;;###mh-autoload
183(defun mh-identity-handler-signature (field action &optional value) 184(defun mh-identity-handler-signature (field action &optional value)
184 "Process header FIELD \":signature\". 185 "Process header FIELD \":signature\".
185The ACTION is one of 'remove or 'add. If 'add, the VALUE is added." 186The ACTION is one of 'remove or 'add. If 'add, the VALUE is
187added."
186 (cond 188 (cond
187 ((equal action 'remove) 189 ((equal action 'remove)
188 (when (and (markerp mh-identity-signature-start) 190 (when (and (markerp mh-identity-signature-start)
@@ -212,7 +214,8 @@ The ACTION is one of 'remove or 'add. If 'add, the VALUE is added."
212;;;###mh-autoload 214;;;###mh-autoload
213(defun mh-identity-handler-attribution-verb (field action &optional value) 215(defun mh-identity-handler-attribution-verb (field action &optional value)
214 "Process header FIELD \":attribution-verb\". 216 "Process header FIELD \":attribution-verb\".
215The ACTION is one of 'remove or 'add. If 'add, the VALUE is added." 217The ACTION is one of 'remove or 'add. If 'add, the VALUE is
218added."
216 (when (and (markerp mh-identity-attribution-verb-start) 219 (when (and (markerp mh-identity-attribution-verb-start)
217 (markerp mh-identity-attribution-verb-end)) 220 (markerp mh-identity-attribution-verb-end))
218 (delete-region mh-identity-attribution-verb-start 221 (delete-region mh-identity-attribution-verb-start
@@ -241,9 +244,9 @@ If VALUE is nil, use `mh-extract-from-attribution-verb'."
241 244
242(defun mh-identity-handler-default (field action top &optional value) 245(defun mh-identity-handler-default (field action top &optional value)
243 "Process header FIELD. 246 "Process header FIELD.
244The ACTION is one of 'remove or 'add. If TOP is non-nil, add the field and its 247The ACTION is one of 'remove or 'add. If TOP is non-nil, add the
245VALUE at the top of the header, else add it at the bottom of the header. If 248field and its VALUE at the top of the header, else add it at the
246action is 'add, the VALUE is added." 249bottom of the header. If action is 'add, the VALUE is added."
247 (let ((field-colon (if (string-match "^.*:$" field) 250 (let ((field-colon (if (string-match "^.*:$" field)
248 field 251 field
249 (concat field ":")))) 252 (concat field ":"))))
@@ -269,15 +272,17 @@ action is 'add, the VALUE is added."
269;;;###mh-autoload 272;;;###mh-autoload
270(defun mh-identity-handler-top (field action &optional value) 273(defun mh-identity-handler-top (field action &optional value)
271 "Process header FIELD. 274 "Process header FIELD.
272The ACTION is one of 'remove or 'add. If 'add, the VALUE is added. 275The ACTION is one of 'remove or 'add. If 'add, the VALUE is
273If the field wasn't present, it is added to the top of the header." 276added. If the field wasn't present, it is added to the top of the
277header."
274 (mh-identity-handler-default field action t value)) 278 (mh-identity-handler-default field action t value))
275 279
276;;;###mh-autoload 280;;;###mh-autoload
277(defun mh-identity-handler-bottom (field action &optional value) 281(defun mh-identity-handler-bottom (field action &optional value)
278 "Process header FIELD. 282 "Process header FIELD.
279The ACTION is one of 'remove or 'add. If 'add, the VALUE is added. 283The ACTION is one of 'remove or 'add. If 'add, the VALUE is
280If the field wasn't present, it is added to the bottom of the header." 284added. If the field wasn't present, it is added to the bottom of
285the header."
281 (mh-identity-handler-default field action nil value)) 286 (mh-identity-handler-default field action nil value))
282 287
283(provide 'mh-identity) 288(provide 'mh-identity)
diff --git a/lisp/mh-e/mh-index.el b/lisp/mh-e/mh-index.el
index e261b47b753..d0bab9d120f 100644
--- a/lisp/mh-e/mh-index.el
+++ b/lisp/mh-e/mh-index.el
@@ -158,9 +158,10 @@
158 158
159(defun mh-index-execute (cmd &rest args) 159(defun mh-index-execute (cmd &rest args)
160 "Partial imitation of xargs. 160 "Partial imitation of xargs.
161The current buffer contains a list of strings, one on each line. The function 161The current buffer contains a list of strings, one on each line.
162will execute CMD with ARGS and pass the first `mh-index-max-cmdline-args' 162The function will execute CMD with ARGS and pass the first
163strings to it. This is repeated till all the strings have been used." 163`mh-index-max-cmdline-args' strings to it. This is repeated till
164all the strings have been used."
164 (goto-char (point-min)) 165 (goto-char (point-min))
165 (let ((current-buffer (current-buffer))) 166 (let ((current-buffer (current-buffer)))
166 (with-temp-buffer 167 (with-temp-buffer
@@ -183,12 +184,14 @@ strings to it. This is repeated till all the strings have been used."
183 184
184(defun mh-index-update-single-msg (msg checksum origin-map) 185(defun mh-index-update-single-msg (msg checksum origin-map)
185 "Update various maps for one message. 186 "Update various maps for one message.
186MSG is a index folder message, CHECKSUM its MD5 hash and ORIGIN-MAP, if 187MSG is a index folder message, CHECKSUM its MD5 hash and
187non-nil, a hashtable containing which maps each message in the index folder to 188ORIGIN-MAP, if non-nil, a hashtable containing which maps each
188the folder and message that it was copied from. The function updates the hash 189message in the index folder to the folder and message that it was
189tables `mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'. 190copied from. The function updates the hash tables
190 191`mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'.
191This function should only be called in the appropriate index folder buffer." 192
193This function should only be called in the appropriate index
194folder buffer."
192 (cond ((and origin-map (gethash checksum mh-index-checksum-origin-map)) 195 (cond ((and origin-map (gethash checksum mh-index-checksum-origin-map))
193 (let* ((intermediate (gethash msg origin-map)) 196 (let* ((intermediate (gethash msg origin-map))
194 (ofolder (car intermediate)) 197 (ofolder (car intermediate))
@@ -208,10 +211,11 @@ This function should only be called in the appropriate index folder buffer."
208;;;###mh-autoload 211;;;###mh-autoload
209(defun mh-index-update-maps (folder &optional origin-map) 212(defun mh-index-update-maps (folder &optional origin-map)
210 "Annotate all as yet unannotated messages in FOLDER with their MD5 hash. 213 "Annotate all as yet unannotated messages in FOLDER with their MD5 hash.
211As a side effect msg -> checksum map is updated. Optional argument ORIGIN-MAP 214As a side effect msg -> checksum map is updated. Optional
212is a hashtable which maps each message in the index folder to the original 215argument ORIGIN-MAP is a hashtable which maps each message in the
213folder and message from whence it was copied. If present the 216index folder to the original folder and message from whence it
214checksum -> (origin-folder, origin-index) map is updated too." 217was copied. If present the checksum -> (origin-folder,
218origin-index) map is updated too."
215 (clrhash mh-index-msg-checksum-map) 219 (clrhash mh-index-msg-checksum-map)
216 (save-excursion 220 (save-excursion
217 ;; Clear temp buffer 221 ;; Clear temp buffer
@@ -266,8 +270,9 @@ checksum -> (origin-folder, origin-index) map is updated too."
266 270
267(defun mh-unpropagated-sequences () 271(defun mh-unpropagated-sequences ()
268 "Return a list of sequences that aren't propagated to the source folders. 272 "Return a list of sequences that aren't propagated to the source folders.
269It is just the sequences in the variable `mh-unpropagated-sequences' in 273It is just the sequences in the variable
270addition to the Previous-Sequence (see mh-profile 5)." 274`mh-unpropagated-sequences' in addition to the
275Previous-Sequence (see mh-profile 5)."
271 (if mh-previous-seq 276 (if mh-previous-seq
272 (cons mh-previous-seq mh-unpropagated-sequences) 277 (cons mh-previous-seq mh-unpropagated-sequences)
273 mh-unpropagated-sequences)) 278 mh-unpropagated-sequences))
@@ -275,8 +280,8 @@ addition to the Previous-Sequence (see mh-profile 5)."
275;;;###mh-autoload 280;;;###mh-autoload
276(defun mh-create-sequence-map (seq-list) 281(defun mh-create-sequence-map (seq-list)
277 "Return a map from msg number to list of sequences in which it is present. 282 "Return a map from msg number to list of sequences in which it is present.
278SEQ-LIST is an assoc list whose keys are sequence names and whose cdr is the 283SEQ-LIST is an assoc list whose keys are sequence names and whose
279list of messages in that sequence." 284cdr is the list of messages in that sequence."
280 (loop with map = (make-hash-table) 285 (loop with map = (make-hash-table)
281 for seq in seq-list 286 for seq in seq-list
282 when (and (not (memq (car seq) (mh-unpropagated-sequences))) 287 when (and (not (memq (car seq) (mh-unpropagated-sequences)))
@@ -316,10 +321,11 @@ list of messages in that sequence."
316 321
317(defun mh-index-generate-pretty-name (string) 322(defun mh-index-generate-pretty-name (string)
318 "Given STRING generate a name which is suitable for use as a folder name. 323 "Given STRING generate a name which is suitable for use as a folder name.
319White space from the beginning and end are removed. All spaces in the name are 324White space from the beginning and end are removed. All spaces in
320replaced with underscores and all / are replaced with $. If STRING is longer 325the name are replaced with underscores and all / are replaced
321than 20 it is truncated too. STRING could be a list of strings in which case 326with $. If STRING is longer than 20 it is truncated too. STRING
322they are concatenated to construct the base name." 327could be a list of strings in which case they are concatenated to
328construct the base name."
323 (with-temp-buffer 329 (with-temp-buffer
324 (if (stringp string) 330 (if (stringp string)
325 (insert string) 331 (insert string)
@@ -352,60 +358,66 @@ they are concatenated to construct the base name."
352(defun* mh-index-search (redo-search-flag folder search-regexp 358(defun* mh-index-search (redo-search-flag folder search-regexp
353 &optional window-config) 359 &optional window-config)
354 "Perform an indexed search in an MH mail folder. 360 "Perform an indexed search in an MH mail folder.
361
355Use a prefix argument to repeat the search. 362Use a prefix argument to repeat the search.
356 363
357Unlike regular searches, the prompt for the folder to search can be `all' to 364Unlike regular searches, the prompt for the folder to search can be
358search all folders; in addition, the search works recursively on the listed 365`all' to search all folders; in addition, the search works recursively
359folder. The search criteria are entered in an MH-Pick buffer as described in 366on the listed folder. The search criteria are entered in an MH-Pick
360`mh-search-folder'. 367buffer as described in `mh-search-folder'.
361 368
362To perform the search, type \\<mh-pick-mode-map>\\[mh-do-search]. Another 369To perform the search, type \\<mh-pick-mode-map>\\[mh-do-search].
363difference from the regular searches is that because the search operates on 370Another difference from the regular searches is that because the
364more than one folder, the messages that are found are put in a temporary 371search operates on more than one folder, the messages that are found
365sub-folder of `+mhe-index' and are displayed in an MH-Folder buffer. This 372are put in a temporary sub-folder of `+mhe-index' and are displayed in
366buffer is special because it displays messages from multiple folders; each set 373an MH-Folder buffer. This buffer is special because it displays
367of messages from a given folder has a heading with the folder name. 374messages from multiple folders; each set of messages from a given
368 375folder has a heading with the folder name.
369In addition, the \\<mh-folder-mode-map>\\[mh-index-visit-folder] command can 376
370be used to visit the folder of the message at point. Initially, only the 377In addition, the \\<mh-folder-mode-map>\\[mh-index-visit-folder]
371messages that matched the search criteria are displayed in the folder. While 378command can be used to visit the folder of the message at point.
372the temporary buffer has its own set of message numbers, the actual messages 379Initially, only the messages that matched the search criteria are
373numbers are shown in the visited folder. Thus, the \\[mh-index-visit-folder] 380displayed in the folder. While the temporary buffer has its own set of
374command is useful to find the actual message number of an interesting message, 381message numbers, the actual messages numbers are shown in the visited
375or to view surrounding messages with the \\[mh-rescan-folder] command. 382folder. Thus, the \\[mh-index-visit-folder] command is useful to find
376 383the actual message number of an interesting message, or to view
377Because this folder is temporary, you'll probably get in the habit of killing 384surrounding messages with the \\[mh-rescan-folder] command.
378it when you're done with \\[mh-kill-folder]. 385
379 386Because this folder is temporary, you'll probably get in the habit of
380If you have run the \\[mh-search-folder] command, but change your mind while 387killing it when you're done with \\[mh-kill-folder].
381entering the search criteria and actually want to run an indexed search, then 388
382you can use the \\<mh-pick-mode-map>\\[mh-index-do-search] command in the 389If you have run the \\[mh-search-folder] command, but change your mind
383MH-Pick buffer. 390while entering the search criteria and actually want to run an indexed
384 391search, then you can use the
385The \\<mh-folder-mode-map>\\[mh-index-search] command runs the command defined 392\\<mh-pick-mode-map>\\[mh-index-do-search] command in the MH-Pick
386by the `mh-index-program' option. The default value is \"Auto-detect\" which 393buffer.
387means that MH-E will automatically choose one of \"swish++\", \"swish-e\", 394
388\"mairix\", \"namazu\", \"pick\" and \"grep\" in that order. If, for example, 395The \\<mh-folder-mode-map>\\[mh-index-search] command runs the command
389you have both \"swish++\" and \"mairix\" installed and you want to use 396defined by the `mh-index-program' option. The default value is
390\"mairix\", then you can set this option to \"mairix\". 397\"Auto-detect\" which means that MH-E will automatically choose one of
398\"swish++\", \"swish-e\", \"mairix\", \"namazu\", \"pick\" and
399\"grep\" in that order. If, for example, you have both \"swish++\" and
400\"mairix\" installed and you want to use \"mairix\", then you can set
401this option to \"mairix\".
391 402
392 *NOTE* 403 *NOTE*
393 404
394 The \"pick\" and \"grep\" commands do not perform a recursive search on 405 The \"pick\" and \"grep\" commands do not perform a
395 the given folder. 406 recursive search on the given folder.
396 407
397This command uses an \"X-MHE-Checksum:\" header field to cache the MD5 408This command uses an \"X-MHE-Checksum:\" header field to cache
398checksum of a message. This means that if an incoming message already contains 409the MD5 checksum of a message. This means that if an incoming
399an \"X-MHE-Checksum:\" field, that message might not be found by this command. 410message already contains an \"X-MHE-Checksum:\" field, that
400The following \"procmail\" recipe avoids this problem by renaming the existing 411message might not be found by this command. The following
412\"procmail\" recipe avoids this problem by renaming the existing
401header field: 413header field:
402 414
403 :0 wf 415 :0 wf
404 | formail -R \"X-MHE-Checksum\" \"X-Old-MHE-Checksum\" 416 | formail -R \"X-MHE-Checksum\" \"X-Old-MHE-Checksum\"
405 417
406The documentation for the following commands describe how to set up the 418The documentation for the following commands describe how to set
407various indexing programs to use with MH-E. The \"pick\" and \"grep\" commands 419up the various indexing programs to use with MH-E. The \"pick\"
408do not require additional configuration. 420and \"grep\" commands do not require additional configuration.
409 421
410 - `mh-swish++-execute-search' 422 - `mh-swish++-execute-search'
411 - `mh-swish-execute-search' 423 - `mh-swish-execute-search'
@@ -414,12 +426,14 @@ do not require additional configuration.
414 - `mh-pick-execute-search' 426 - `mh-pick-execute-search'
415 - `mh-grep-execute-search' 427 - `mh-grep-execute-search'
416 428
417In a program, if REDO-SEARCH-FLAG is non-nil and the current folder buffer was 429In a program, if REDO-SEARCH-FLAG is non-nil and the current
418generated by a index search, then the search is repeated. Otherwise, FOLDER is 430folder buffer was generated by a index search, then the search is
419searched with SEARCH-REGEXP and the results are presented in an MH-E folder. 431repeated. Otherwise, FOLDER is searched with SEARCH-REGEXP and
420If FOLDER is \"+\" then mail in all folders are searched. Optional argument 432the results are presented in an MH-E folder. If FOLDER is \"+\"
421WINDOW-CONFIG stores the window configuration that will be restored after the 433then mail in all folders are searched. Optional argument
422user quits the folder containing the index search results." 434WINDOW-CONFIG stores the window configuration that will be
435restored after the user quits the folder containing the index
436search results."
423 (interactive 437 (interactive
424 (list current-prefix-arg 438 (list current-prefix-arg
425 (progn 439 (progn
@@ -585,7 +599,8 @@ user quits the folder containing the index search results."
585 599
586(defun mh-index-write-hashtable (table proc) 600(defun mh-index-write-hashtable (table proc)
587 "Write TABLE to `current-buffer'. 601 "Write TABLE to `current-buffer'.
588PROC is used to serialize the values corresponding to the hash table keys." 602PROC is used to serialize the values corresponding to the hash
603table keys."
589 (pp (loop for x being the hash-keys of table 604 (pp (loop for x being the hash-keys of table
590 collect (cons x (funcall proc (gethash x table)))) 605 collect (cons x (funcall proc (gethash x table))))
591 (current-buffer)) 606 (current-buffer))
@@ -619,8 +634,9 @@ PROC is used to convert the value to actual data."
619;;;###mh-autoload 634;;;###mh-autoload
620(defun mh-index-parse-search-regexp (input-string) 635(defun mh-index-parse-search-regexp (input-string)
621 "Construct parse tree for INPUT-STRING. 636 "Construct parse tree for INPUT-STRING.
622All occurrences of &, |, ! and ~ in INPUT-STRING are replaced by AND, OR and 637All occurrences of &, |, ! and ~ in INPUT-STRING are replaced by
623NOT as appropriate. Then the resulting string is parsed." 638AND, OR and NOT as appropriate. Then the resulting string is
639parsed."
624 (let (input) 640 (let (input)
625 (with-temp-buffer 641 (with-temp-buffer
626 (insert input-string) 642 (insert input-string)
@@ -720,9 +736,10 @@ NOT as appropriate. Then the resulting string is parsed."
720;;;###mh-autoload 736;;;###mh-autoload
721(defun mh-index-next-folder (&optional backward-flag) 737(defun mh-index-next-folder (&optional backward-flag)
722 "Jump to the next folder marker. 738 "Jump to the next folder marker.
723The function is only applicable to folders displaying index search results. 739The function is only applicable to folders displaying index search
724With non-nil optional argument BACKWARD-FLAG, jump to the previous group of 740results.
725results." 741With non-nil optional argument BACKWARD-FLAG, jump to the previous
742group of results."
726 (interactive "P") 743 (interactive "P")
727 (if (null mh-index-data) 744 (if (null mh-index-data)
728 (message "Only applicable in an MH-E index search buffer") 745 (message "Only applicable in an MH-E index search buffer")
@@ -764,12 +781,12 @@ results."
764(defun mh-index-new-folder (name search-regexp) 781(defun mh-index-new-folder (name search-regexp)
765 "Return a folder name based on NAME for search results of SEARCH-REGEXP. 782 "Return a folder name based on NAME for search results of SEARCH-REGEXP.
766 783
767If folder NAME already exists and was generated for the same SEARCH-REGEXP 784If folder NAME already exists and was generated for the same
768then it is reused. 785SEARCH-REGEXP then it is reused.
769 786
770Otherwise if the folder NAME was generated from a different search then check 787Otherwise if the folder NAME was generated from a different
771if NAME<2> can be used. Otherwise try NAME<3>. This is repeated till we find a 788search then check if NAME<2> can be used. Otherwise try NAME<3>.
772new folder name. 789This is repeated till we find a new folder name.
773 790
774If the folder returned doesn't exist then it is created." 791If the folder returned doesn't exist then it is created."
775 (unless (mh-folder-name-p name) 792 (unless (mh-folder-name-p name)
@@ -794,7 +811,8 @@ If the folder returned doesn't exist then it is created."
794 811
795(defun mh-index-folder-search-regexp (folder) 812(defun mh-index-folder-search-regexp (folder)
796 "If FOLDER was created by a index search, return the search regexp. 813 "If FOLDER was created by a index search, return the search regexp.
797Return nil if FOLDER doesn't exist or the .mhe_index file is garbled." 814Return nil if FOLDER doesn't exist or the .mhe_index file is
815garbled."
798 (ignore-errors 816 (ignore-errors
799 (with-temp-buffer 817 (with-temp-buffer
800 (insert-file-contents 818 (insert-file-contents
@@ -844,8 +862,8 @@ Return nil if FOLDER doesn't exist or the .mhe_index file is garbled."
844;;;###mh-autoload 862;;;###mh-autoload
845(defun mh-index-group-by-folder () 863(defun mh-index-group-by-folder ()
846 "Partition the messages based on source folder. 864 "Partition the messages based on source folder.
847Returns an alist with the the folder names in the car and the cdr being the 865Returns an alist with the the folder names in the car and the cdr
848list of messages originally from that folder." 866being the list of messages originally from that folder."
849 (save-excursion 867 (save-excursion
850 (goto-char (point-min)) 868 (goto-char (point-min))
851 (let ((result-table (make-hash-table :test #'equal))) 869 (let ((result-table (make-hash-table :test #'equal)))
@@ -909,9 +927,9 @@ list of messages originally from that folder."
909 927
910(defun mh-index-matching-source-msgs (msgs &optional delete-from-index-data) 928(defun mh-index-matching-source-msgs (msgs &optional delete-from-index-data)
911 "Return a table of original messages and folders for messages in MSGS. 929 "Return a table of original messages and folders for messages in MSGS.
912If optional argument DELETE-FROM-INDEX-DATA is non-nil, then each of the 930If optional argument DELETE-FROM-INDEX-DATA is non-nil, then each
913messages, whose counter-part is found in some source folder, is removed from 931of the messages, whose counter-part is found in some source
914`mh-index-data'." 932folder, is removed from `mh-index-data'."
915 (let ((table (make-hash-table :test #'equal))) 933 (let ((table (make-hash-table :test #'equal)))
916 (dolist (msg msgs) 934 (dolist (msg msgs)
917 (let* ((checksum (gethash msg mh-index-msg-checksum-map)) 935 (let* ((checksum (gethash msg mh-index-msg-checksum-map))
@@ -926,9 +944,10 @@ messages, whose counter-part is found in some source folder, is removed from
926;;;###mh-autoload 944;;;###mh-autoload
927(defun mh-index-execute-commands () 945(defun mh-index-execute-commands ()
928 "Delete/refile the actual messages. 946 "Delete/refile the actual messages.
929The copies in the searched folder are then deleted/refiled to get the desired 947The copies in the searched folder are then deleted/refiled to get
930result. Before deleting the messages we make sure that the message being 948the desired result. Before deleting the messages we make sure
931deleted is identical to the one that the user has marked in the index buffer." 949that the message being deleted is identical to the one that the
950user has marked in the index buffer."
932 (save-excursion 951 (save-excursion
933 (let ((folders ()) 952 (let ((folders ())
934 (mh-speed-flists-inhibit-flag t)) 953 (mh-speed-flists-inhibit-flag t))
@@ -967,8 +986,8 @@ deleted is identical to the one that the user has marked in the index buffer."
967;;;###mh-autoload 986;;;###mh-autoload
968(defun mh-index-add-to-sequence (seq msgs) 987(defun mh-index-add-to-sequence (seq msgs)
969 "Add to SEQ the messages in the list MSGS. 988 "Add to SEQ the messages in the list MSGS.
970This function updates the source folder sequences. Also makes an attempt to 989This function updates the source folder sequences. Also makes an
971update the source folder buffer if we have it open." 990attempt to update the source folder buffer if we have it open."
972 ;; Don't need to do anything for cur 991 ;; Don't need to do anything for cur
973 (save-excursion 992 (save-excursion
974 (when (and (not (memq seq (mh-unpropagated-sequences))) 993 (when (and (not (memq seq (mh-unpropagated-sequences)))
@@ -993,8 +1012,8 @@ update the source folder buffer if we have it open."
993;;;###mh-autoload 1012;;;###mh-autoload
994(defun mh-index-delete-from-sequence (seq msgs) 1013(defun mh-index-delete-from-sequence (seq msgs)
995 "Delete from SEQ the messages in MSGS. 1014 "Delete from SEQ the messages in MSGS.
996This function updates the source folder sequences. Also makes an attempt to 1015This function updates the source folder sequences. Also makes an
997update the source folder buffer if present." 1016attempt to update the source folder buffer if present."
998 (save-excursion 1017 (save-excursion
999 (when (and (not (memq seq (mh-unpropagated-sequences))) 1018 (when (and (not (memq seq (mh-unpropagated-sequences)))
1000 (mh-valid-seq-p seq)) 1019 (mh-valid-seq-p seq))
@@ -1025,12 +1044,12 @@ update the source folder buffer if present."
1025(defun mh-pick-execute-search (folder-path search-regexp) 1044(defun mh-pick-execute-search (folder-path search-regexp)
1026 "Execute pick. 1045 "Execute pick.
1027 1046
1028Unlike the other index search programs \"pick\" only searches messages present 1047Unlike the other index search programs \"pick\" only searches
1029in the folder itself and does not descend into any sub-folders that may be 1048messages present in the folder itself and does not descend into
1030present. 1049any sub-folders that may be present.
1031 1050
1032In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used 1051In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
1033to search." 1052is used to search."
1034 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1053 (set-buffer (get-buffer-create mh-index-temp-buffer))
1035 (erase-buffer) 1054 (erase-buffer)
1036 (setq mh-index-pick-folder 1055 (setq mh-index-pick-folder
@@ -1061,12 +1080,12 @@ to search."
1061(defun mh-grep-execute-search (folder-path search-regexp) 1080(defun mh-grep-execute-search (folder-path search-regexp)
1062 "Execute grep and read the results. 1081 "Execute grep and read the results.
1063 1082
1064Unlike the other index search programs \"grep\" only searches messages present 1083Unlike the other index search programs \"grep\" only searches
1065in the folder itself and does not descend into any sub-folders that may be 1084messages present in the folder itself and does not descend into
1066present. 1085any sub-folders that may be present.
1067 1086
1068In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used 1087In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
1069to search." 1088is used to search."
1070 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1089 (set-buffer (get-buffer-create mh-index-temp-buffer))
1071 (erase-buffer) 1090 (erase-buffer)
1072 (call-process mh-grep-binary nil '(t nil) nil 1091 (call-process mh-grep-binary nil '(t nil) nil
@@ -1075,9 +1094,9 @@ to search."
1075 1094
1076(defun mh-grep-next-result () 1095(defun mh-grep-next-result ()
1077 "Read the next result. 1096 "Read the next result.
1078Parse it and return the message folder, message index and the match. If no 1097Parse it and return the message folder, message index and the
1079other matches left then return nil. If the current record is invalid return 1098match. If no other matches left then return nil. If the current
1080'error." 1099record is invalid return 'error."
1081 (prog1 1100 (prog1
1082 (block nil 1101 (block nil
1083 (when (eobp) 1102 (when (eobp)
@@ -1118,11 +1137,12 @@ other matches left then return nil. If the current record is invalid return
1118(defun mh-mairix-execute-search (folder-path search-regexp-list) 1137(defun mh-mairix-execute-search (folder-path search-regexp-list)
1119 "Execute mairix and read the results. 1138 "Execute mairix and read the results.
1120 1139
1121In the examples below, replace \"/home/user/Mail\" with the path to your MH 1140In the examples below, replace \"/home/user/Mail\" with the path
1122directory. 1141to your MH directory.
1123 1142
1124First create the directory \"/home/user/Mail/.mairix\". Then create the file 1143First create the directory \"/home/user/Mail/.mairix\". Then
1125\"/home/user/Mail/.mairix/config\" with the following contents: 1144create the file \"/home/user/Mail/.mairix/config\" with the
1145following contents:
1126 1146
1127 base=/home/user/Mail 1147 base=/home/user/Mail
1128 1148
@@ -1133,13 +1153,13 @@ First create the directory \"/home/user/Mail/.mairix\". Then create the file
1133 vfolder_format=raw 1153 vfolder_format=raw
1134 database=/home/user/Mail/mairix/database 1154 database=/home/user/Mail/mairix/database
1135 1155
1136Use the following command line to generate the mairix index. Run this daily 1156Use the following command line to generate the mairix index. Run
1137from cron: 1157this daily from cron:
1138 1158
1139 mairix -f /home/user/Mail/.mairix/config 1159 mairix -f /home/user/Mail/.mairix/config
1140 1160
1141In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP-LIST is used 1161In a program, FOLDER-PATH is the directory in which
1142to search." 1162SEARCH-REGEXP-LIST is used to search."
1143 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1163 (set-buffer (get-buffer-create mh-index-temp-buffer))
1144 (erase-buffer) 1164 (erase-buffer)
1145 (unless mh-mairix-binary 1165 (unless mh-mairix-binary
@@ -1258,9 +1278,10 @@ REGEXP-LIST is an alist of fields and values."
1258 1278
1259(defun mh-flists-execute (&rest args) 1279(defun mh-flists-execute (&rest args)
1260 "Execute flists. 1280 "Execute flists.
1261Search for messages belonging to `mh-flists-sequence' in the folders 1281Search for messages belonging to `mh-flists-sequence' in the
1262specified by `mh-flists-search-folders'. If `mh-recursive-folders-flag' is t, 1282folders specified by `mh-flists-search-folders'. If
1263then the folders are searched recursively. All parameters ARGS are ignored." 1283`mh-recursive-folders-flag' is t, then the folders are searched
1284recursively. All parameters ARGS are ignored."
1264 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1285 (set-buffer (get-buffer-create mh-index-temp-buffer))
1265 (erase-buffer) 1286 (erase-buffer)
1266 (unless (executable-find "sh") 1287 (unless (executable-find "sh")
@@ -1286,8 +1307,9 @@ then the folders are searched recursively. All parameters ARGS are ignored."
1286(defun mh-index-sequenced-messages (folders sequence) 1307(defun mh-index-sequenced-messages (folders sequence)
1287 "Display messages from FOLDERS in SEQUENCE. 1308 "Display messages from FOLDERS in SEQUENCE.
1288All messages in the sequence you provide from the folders in 1309All messages in the sequence you provide from the folders in
1289`mh-new-messages-folders' are listed. With a prefix argument, enter a 1310`mh-new-messages-folders' are listed. With a prefix argument,
1290space-separated list of folders, or nothing to search all folders." 1311enter a space-separated list of folders, or nothing to search all
1312folders."
1291 (interactive 1313 (interactive
1292 (list (if current-prefix-arg 1314 (list (if current-prefix-arg
1293 (split-string (read-string "Search folder(s) (default all): ")) 1315 (split-string (read-string "Search folder(s) (default all): "))
@@ -1330,13 +1352,14 @@ space-separated list of folders, or nothing to search all folders."
1330(defun mh-index-new-messages (folders) 1352(defun mh-index-new-messages (folders)
1331 "Display unseen messages. 1353 "Display unseen messages.
1332 1354
1333If you use a program such as `procmail' to use `rcvstore' to file your 1355If you use a program such as `procmail' to use `rcvstore' to file
1334incoming mail automatically, you can display new, unseen, messages using this 1356your incoming mail automatically, you can display new, unseen,
1335command. All messages in the `unseen' sequence from the folders in 1357messages using this command. All messages in the `unseen'
1336`mh-new-messages-folders' are listed. 1358sequence from the folders in `mh-new-messages-folders' are
1359listed.
1337 1360
1338With a prefix argument, enter a space-separated list of FOLDERS, or nothing to 1361With a prefix argument, enter a space-separated list of FOLDERS,
1339search all folders." 1362or nothing to search all folders."
1340 (interactive 1363 (interactive
1341 (list (if current-prefix-arg 1364 (list (if current-prefix-arg
1342 (split-string (read-string "Search folder(s) (default all): ")) 1365 (split-string (read-string "Search folder(s) (default all): "))
@@ -1347,11 +1370,11 @@ search all folders."
1347(defun mh-index-ticked-messages (folders) 1370(defun mh-index-ticked-messages (folders)
1348 "Display ticked messages. 1371 "Display ticked messages.
1349 1372
1350All messages in `mh-tick-seq' from the folders in `mh-ticked-messages-folders' 1373All messages in `mh-tick-seq' from the folders in
1351are listed. 1374`mh-ticked-messages-folders' are listed.
1352 1375
1353With a prefix argument, enter a space-separated list of FOLDERS, or nothing to 1376With a prefix argument, enter a space-separated list of FOLDERS,
1354search all folders." 1377or nothing to search all folders."
1355 (interactive 1378 (interactive
1356 (list (if current-prefix-arg 1379 (list (if current-prefix-arg
1357 (split-string (read-string "Search folder(s) (default all): ")) 1380 (split-string (read-string "Search folder(s) (default all): "))
@@ -1370,11 +1393,12 @@ search all folders."
1370(defun mh-swish-execute-search (folder-path search-regexp) 1393(defun mh-swish-execute-search (folder-path search-regexp)
1371 "Execute swish-e and read the results. 1394 "Execute swish-e and read the results.
1372 1395
1373In the examples below, replace \"/home/user/Mail\" with the path to your 1396In the examples below, replace \"/home/user/Mail\" with the path
1374MH directory. 1397to your MH directory.
1375 1398
1376First create the directory \"/home/user/Mail/.swish\". Then create the file 1399First create the directory \"/home/user/Mail/.swish\". Then
1377\"/home/user/Mail/.swish/config\" with the following contents: 1400create the file \"/home/user/Mail/.swish/config\" with the
1401following contents:
1378 1402
1379 DefaultContents TXT* 1403 DefaultContents TXT*
1380 IndexDir /home/user/Mail 1404 IndexDir /home/user/Mail
@@ -1397,22 +1421,22 @@ First create the directory \"/home/user/Mail/.swish\". Then create the file
1397 FileRules pathname contains /home/user/Mail/.swish 1421 FileRules pathname contains /home/user/Mail/.swish
1398 FileRules pathname contains /home/user/Mail/mhe-index 1422 FileRules pathname contains /home/user/Mail/mhe-index
1399 1423
1400This configuration does not index the folders that hold the results of your 1424This configuration does not index the folders that hold the
1401searches in \"+mhe-index\" since they tend to be ephemeral and the original 1425results of your searches in \"+mhe-index\" since they tend to be
1402messages are indexed anyway. 1426ephemeral and the original messages are indexed anyway.
1403 1427
1404If there are any directories you would like to ignore, append lines like the 1428If there are any directories you would like to ignore, append
1405following to \"config\": 1429lines like the following to \"config\":
1406 1430
1407 FileRules pathname contains /home/user/Mail/scripts 1431 FileRules pathname contains /home/user/Mail/scripts
1408 1432
1409Use the following command line to generate the swish index. Run this daily 1433Use the following command line to generate the swish index. Run
1410from cron: 1434this daily from cron:
1411 1435
1412 swish-e -c /home/user/Mail/.swish/config 1436 swish-e -c /home/user/Mail/.swish/config
1413 1437
1414In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to 1438In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
1415search." 1439is used to search."
1416 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1440 (set-buffer (get-buffer-create mh-index-temp-buffer))
1417 (erase-buffer) 1441 (erase-buffer)
1418 (unless mh-swish-binary 1442 (unless mh-swish-binary
@@ -1472,11 +1496,12 @@ search."
1472(defun mh-swish++-execute-search (folder-path search-regexp) 1496(defun mh-swish++-execute-search (folder-path search-regexp)
1473 "Execute swish++ and read the results. 1497 "Execute swish++ and read the results.
1474 1498
1475In the examples below, replace \"/home/user/Mail\" with the path to your MH 1499In the examples below, replace \"/home/user/Mail\" with the path to
1476directory. 1500your MH directory.
1477 1501
1478First create the directory \"/home/user/Mail/.swish++\". Then create the file 1502First create the directory \"/home/user/Mail/.swish++\". Then create
1479\"/home/user/Mail/.swish++/swish++.conf\" with the following contents: 1503the file \"/home/user/Mail/.swish++/swish++.conf\" with the following
1504contents:
1480 1505
1481 IncludeMeta Bcc Cc Comments Content-Description From Keywords 1506 IncludeMeta Bcc Cc Comments Content-Description From Keywords
1482 IncludeMeta Newsgroups Resent-To Subject To 1507 IncludeMeta Newsgroups Resent-To Subject To
@@ -1484,23 +1509,23 @@ First create the directory \"/home/user/Mail/.swish++\". Then create the file
1484 IncludeFile Mail * 1509 IncludeFile Mail *
1485 IndexFile /home/user/Mail/.swish++/swish++.index 1510 IndexFile /home/user/Mail/.swish++/swish++.index
1486 1511
1487Use the following command line to generate the swish index. Run this daily 1512Use the following command line to generate the swish index. Run
1488from cron: 1513this daily from cron:
1489 1514
1490 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\ 1515 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
1491 -o -path /home/user/Mail/.swish++ -prune \\ 1516 -o -path /home/user/Mail/.swish++ -prune \\
1492 -o -name \"[0-9]*\" -print \\ 1517 -o -name \"[0-9]*\" -print \\
1493 | index -c /home/user/Mail/.swish++/swish++.conf - 1518 | index -c /home/user/Mail/.swish++/swish++.conf -
1494 1519
1495This command does not index the folders that hold the results of your searches 1520This command does not index the folders that hold the results of your
1496in \"+mhe-index\" since they tend to be ephemeral and the original messages 1521searches in \"+mhe-index\" since they tend to be ephemeral and the
1497are indexed anyway. 1522original messages are indexed anyway.
1498 1523
1499On some systems (Debian GNU/Linux, for example), use \"index++\" instead of 1524On some systems (Debian GNU/Linux, for example), use \"index++\"
1500\"index\". 1525instead of \"index\".
1501 1526
1502In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to 1527In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is
1503search." 1528used to search."
1504 (set-buffer (get-buffer-create mh-index-temp-buffer)) 1529 (set-buffer (get-buffer-create mh-index-temp-buffer))
1505 (erase-buffer) 1530 (erase-buffer)
1506 (unless mh-swish++-binary 1531 (unless mh-swish++-binary
@@ -1554,29 +1579,30 @@ REGEXP-LIST is an alist of fields and values."
1554(defun mh-namazu-execute-search (folder-path search-regexp) 1579(defun mh-namazu-execute-search (folder-path search-regexp)
1555 "Execute namazu and read the results. 1580 "Execute namazu and read the results.
1556 1581
1557In the examples below, replace \"/home/user/Mail\" with the path to your MH 1582In the examples below, replace \"/home/user/Mail\" with the path to
1558directory. 1583your MH directory.
1559 1584
1560First create the directory \"/home/user/Mail/.namazu\". Then create the file 1585First create the directory \"/home/user/Mail/.namazu\". Then create
1561\"/home/user/Mail/.namazu/mknmzrc\" with the following contents: 1586the file \"/home/user/Mail/.namazu/mknmzrc\" with the following
1587contents:
1562 1588
1563 package conf; # Don't remove this line! 1589 package conf; # Don't remove this line!
1564 $ADDRESS = 'user@localhost'; 1590 $ADDRESS = 'user@localhost';
1565 $ALLOW_FILE = \"[0-9]*\"; 1591 $ALLOW_FILE = \"[0-9]*\";
1566 $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\"; 1592 $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
1567 1593
1568This configuration does not index the folders that hold the results of your 1594This configuration does not index the folders that hold the results of
1569searches in \"+mhe-index\" since they tend to be ephemeral and the original 1595your searches in \"+mhe-index\" since they tend to be ephemeral and
1570messages are indexed anyway. 1596the original messages are indexed anyway.
1571 1597
1572Use the following command line to generate the namazu index. Run this daily 1598Use the following command line to generate the namazu index. Run this
1573from cron: 1599daily from cron:
1574 1600
1575 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\ 1601 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
1576 /home/user/Mail 1602 /home/user/Mail
1577 1603
1578In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to 1604In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
1579search." 1605is used to search."
1580 (let ((namazu-index-directory 1606 (let ((namazu-index-directory
1581 (format "%s%s" mh-user-path mh-namazu-directory))) 1607 (format "%s%s" mh-user-path mh-namazu-directory)))
1582 (unless (file-exists-p namazu-index-directory) 1608 (unless (file-exists-p namazu-index-directory)
@@ -1623,10 +1649,10 @@ search."
1623;;;###mh-autoload 1649;;;###mh-autoload
1624(defun mh-index-choose () 1650(defun mh-index-choose ()
1625 "Choose an indexing function. 1651 "Choose an indexing function.
1626The side-effects of this function are that the variables `mh-indexer', 1652The side-effects of this function are that the variables
1627`mh-index-execute-search-function', and `mh-index-next-result-function' are 1653`mh-indexer', `mh-index-execute-search-function', and
1628set according to the first indexer in `mh-indexer-choices' present on the 1654`mh-index-next-result-function' are set according to the first
1629system." 1655indexer in `mh-indexer-choices' present on the system."
1630 (block nil 1656 (block nil
1631 ;; The following favors the user's preference; otherwise, the last 1657 ;; The following favors the user's preference; otherwise, the last
1632 ;; automatically chosen indexer is used for efficiency rather than going 1658 ;; automatically chosen indexer is used for efficiency rather than going
diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el
index 1bafe960eff..7b8477a4a94 100644
--- a/lisp/mh-e/mh-init.el
+++ b/lisp/mh-e/mh-init.el
@@ -81,8 +81,8 @@ Created by the function `mh-variants'")
81(defun mh-variants () 81(defun mh-variants ()
82 "Return a list of installed variants of MH on the system. 82 "Return a list of installed variants of MH on the system.
83This function looks for MH in `mh-sys-path', `mh-path' and 83This function looks for MH in `mh-sys-path', `mh-path' and
84`exec-path'. The format of the list of variants that is returned is described 84`exec-path'. The format of the list of variants that is returned
85by the variable `mh-variants'." 85is described by the variable `mh-variants'."
86 (if mh-variants 86 (if mh-variants
87 mh-variants 87 mh-variants
88 (let ((list-unique)) 88 (let ((list-unique))
@@ -100,14 +100,16 @@ by the variable `mh-variants'."
100 100
101(defvar mh-variant-in-use nil 101(defvar mh-variant-in-use nil
102 "The MH variant currently in use; a string with variant and version number. 102 "The MH variant currently in use; a string with variant and version number.
103This differs from `mh-variant' when the latter is set to `autodetect'.") 103This differs from `mh-variant' when the latter is set to
104`autodetect'.")
104 105
105;;;###mh-autoload 106;;;###mh-autoload
106(defun mh-variant-set (variant) 107(defun mh-variant-set (variant)
107 "Set the MH variant to VARIANT. 108 "Set the MH variant to VARIANT.
108Sets `mh-progs', `mh-lib', `mh-lib-progs' and `mh-flists-present-flag'. 109Sets `mh-progs', `mh-lib', `mh-lib-progs' and
109If the VARIANT is `autodetect', then first try nmh, then MH and finally 110`mh-flists-present-flag'.
110GNU mailutils." 111If the VARIANT is `autodetect', then first try nmh, then MH and
112finally GNU mailutils."
111 (interactive 113 (interactive
112 (list (completing-read 114 (list (completing-read
113 "MH Variant: " 115 "MH Variant: "
@@ -138,7 +140,8 @@ GNU mailutils."
138(defun mh-variant-set-variant (variant) 140(defun mh-variant-set-variant (variant)
139 "Setup the system variables for the MH variant named VARIANT. 141 "Setup the system variables for the MH variant named VARIANT.
140If VARIANT is a string, use that key in the variable `mh-variants'. 142If VARIANT is a string, use that key in the variable `mh-variants'.
141If VARIANT is a symbol, select the first entry that matches that variant." 143If VARIANT is a symbol, select the first entry that matches that
144variant."
142 (cond 145 (cond
143 ((stringp variant) ;e.g. "nmh 1.1-RC1" 146 ((stringp variant) ;e.g. "nmh 1.1-RC1"
144 (when (assoc variant mh-variants) 147 (when (assoc variant mh-variants)
@@ -193,7 +196,7 @@ Currently known variants are 'MH, 'nmh, and 'mu-mh."
193 "/usr/bin/mu-mh/") ; GNU mailutils - packaged 196 "/usr/bin/mu-mh/") ; GNU mailutils - packaged
194 "List of directories to search for variants of the MH variant. 197 "List of directories to search for variants of the MH variant.
195The list `exec-path' is searched in addition to this list. 198The list `exec-path' is searched in addition to this list.
196There's no need for users to modify this list. Instead add extra 199There's no need for users to modify this list. Instead add extra
197directories to the customizable variable `mh-path'.") 200directories to the customizable variable `mh-path'.")
198 201
199(defun mh-variant-mh-info (dir) 202(defun mh-variant-mh-info (dir)
@@ -302,10 +305,11 @@ This assumes that a temporary buffer is setup."
302;;;###mh-autoload 305;;;###mh-autoload
303(defun mh-image-load-path () 306(defun mh-image-load-path ()
304 "Ensure that the MH-E images are accessible by `find-image'. 307 "Ensure that the MH-E images are accessible by `find-image'.
305Images for MH-E are found in ../../etc/images relative to the files in 308Images for MH-E are found in ../../etc/images relative to the
306`lisp/mh-e'. If `image-load-path' exists (since Emacs 22), then the images 309files in `lisp/mh-e'. If `image-load-path' exists (since Emacs
307directory is added to it if isn't already there. Otherwise, the images 31022), then the images directory is added to it if isn't already
308directory is added to the `load-path' if it isn't already there." 311there. Otherwise, the images directory is added to the
312`load-path' if it isn't already there."
309 (unless mh-image-load-path-called-flag 313 (unless mh-image-load-path-called-flag
310 (let (mh-library-name mh-image-load-path) 314 (let (mh-library-name mh-image-load-path)
311 ;; First, find mh-e in the load-path. 315 ;; First, find mh-e in the load-path.
@@ -332,10 +336,11 @@ directory is added to the `load-path' if it isn't already there."
332 "Convert SPEC for defface if necessary to run on older platforms. 336 "Convert SPEC for defface if necessary to run on older platforms.
333See `defface' for the spec definition. 337See `defface' for the spec definition.
334 338
335When `mh-min-colors-defined-flag' is nil, this function finds a display with a 339When `mh-min-colors-defined-flag' is nil, this function finds a
336single \"class\" requirement with a \"color\" item, renames the requirement to 340display with a single \"class\" requirement with a \"color\"
337\"tty\" and moves it to the beginning of the list. It then strips any 341item, renames the requirement to \"tty\" and moves it to the
338\"min-colors\" requirements." 342beginning of the list. It then strips any \"min-colors\"
343requirements."
339 (when (not mh-min-colors-defined-flag) 344 (when (not mh-min-colors-defined-flag)
340 ;; Insert ((class tty)) display with ((class color)) attributes. 345 ;; Insert ((class tty)) display with ((class color)) attributes.
341 (let ((attributes (cdr (assoc '((class color)) spec)))) 346 (let ((attributes (cdr (assoc '((class color)) spec))))
diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el
index 29caef6cae7..70012163698 100644
--- a/lisp/mh-e/mh-junk.el
+++ b/lisp/mh-e/mh-junk.el
@@ -41,14 +41,15 @@
41(defun mh-junk-blacklist (range) 41(defun mh-junk-blacklist (range)
42 "Blacklist RANGE as spam. 42 "Blacklist RANGE as spam.
43 43
44This command trains the spam program in use (see the option `mh-junk-program') 44This command trains the spam program in use (see the option
45with the content of RANGE and then handles the message(s) as specified by the 45`mh-junk-program') with the content of RANGE and then handles the
46option `mh-junk-disposition'. 46message(s) as specified by the option `mh-junk-disposition'.
47 47
48Check the documentation of `mh-interactive-range' to see how RANGE is read in 48Check the documentation of `mh-interactive-range' to see how RANGE is
49interactive use. 49read in interactive use.
50 50
51For more information about using your particular spam fighting program, see: 51For more information about using your particular spam fighting
52program, see:
52 53
53 - `mh-spamassassin-blacklist' 54 - `mh-spamassassin-blacklist'
54 - `mh-bogofilter-blacklist' 55 - `mh-bogofilter-blacklist'
@@ -80,12 +81,12 @@ For more information about using your particular spam fighting program, see:
80(defun mh-junk-whitelist (range) 81(defun mh-junk-whitelist (range)
81 "Whitelist RANGE as ham. 82 "Whitelist RANGE as ham.
82 83
83This command reclassifies the RANGE as ham if it were incorrectly classified 84This command reclassifies the RANGE as ham if it were incorrectly
84as spam (see the option `mh-junk-program'). It then refiles the message into 85classified as spam (see the option `mh-junk-program'). It then
85the \"+inbox\" folder. 86refiles the message into the \"+inbox\" folder.
86 87
87Check the documentation of `mh-interactive-range' to see how RANGE is read in 88Check the documentation of `mh-interactive-range' to see how
88interactive use." 89RANGE is read in interactive use."
89 (interactive (list (mh-interactive-range "Whitelist"))) 90 (interactive (list (mh-interactive-range "Whitelist")))
90 (let ((whitelist-func (nth 2 (assoc mh-junk-choice mh-junk-function-alist)))) 91 (let ((whitelist-func (nth 2 (assoc mh-junk-choice mh-junk-function-alist))))
91 (unless whitelist-func 92 (unless whitelist-func
@@ -107,8 +108,8 @@ interactive use."
107(defun mh-spamassassin-blacklist (msg) 108(defun mh-spamassassin-blacklist (msg)
108 "Blacklist MSG with SpamAssassin. 109 "Blacklist MSG with SpamAssassin.
109 110
110SpamAssassin is one of the more popular spam filtering programs. Get it from 111SpamAssassin is one of the more popular spam filtering programs. Get
111your local distribution or from http://spamassassin.org/. 112it from your local distribution or from http://spamassassin.org/.
112 113
113To use SpamAssassin, add the following recipes to `.procmailrc': 114To use SpamAssassin, add the following recipes to `.procmailrc':
114 115
@@ -129,52 +130,56 @@ To use SpamAssassin, add the following recipes to `.procmailrc':
129 130
130If you don't use `spamc', use `spamassassin -P -a'. 131If you don't use `spamc', use `spamassassin -P -a'.
131 132
132Note that one of the recipes above throws away messages with a score greater 133Note that one of the recipes above throws away messages with a score
133than or equal to 10. Here's how you can determine a value that works best for 134greater than or equal to 10. Here's how you can determine a value that
134you. 135works best for you.
135 136
136First, run `spamassassin -t' on every mail message in your archive and use 137First, run `spamassassin -t' on every mail message in your archive and
137Gnumeric to verify that the average plus the standard deviation of good mail 138use Gnumeric to verify that the average plus the standard deviation of
138is under 5, the SpamAssassin default for \"spam\". 139good mail is under 5, the SpamAssassin default for \"spam\".
139 140
140Using Gnumeric, sort the messages by score and view the messages with the 141Using Gnumeric, sort the messages by score and view the messages with
141highest score. Determine the score which encompasses all of your interesting 142the highest score. Determine the score which encompasses all of your
142messages and add a couple of points to be conservative. Add that many dots to 143interesting messages and add a couple of points to be conservative.
143the `X-Spam-Level:' header field above to send messages with that score down 144Add that many dots to the `X-Spam-Level:' header field above to send
144the drain. 145messages with that score down the drain.
145 146
146In the example above, messages with a score of 5-9 are set aside in the 147In the example above, messages with a score of 5-9 are set aside in
147`+spam' folder for later review. The major weakness of rules-based filters is 148the `+spam' folder for later review. The major weakness of rules-based
148a plethora of false positives so it is worthwhile to check. 149filters is a plethora of false positives so it is worthwhile to check.
149 150
150If SpamAssassin classifies a message incorrectly, or is unsure, you can use 151If SpamAssassin classifies a message incorrectly, or is unsure, you
151the MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist]. 152can use the MH-E commands \\[mh-junk-blacklist] and
153\\[mh-junk-whitelist].
152 154
153The \\[mh-junk-blacklist] command adds a `blacklist_from' entry to 155The \\[mh-junk-blacklist] command adds a `blacklist_from' entry to
154`~/spamassassin/user_prefs', deletes the message, and sends the message to the 156`~/spamassassin/user_prefs', deletes the message, and sends the
155Razor, so that others might not see this spam. If the `sa-learn' command is 157message to the Razor, so that others might not see this spam. If the
156available, the message is also recategorized as spam. 158`sa-learn' command is available, the message is also recategorized as
159spam.
157 160
158The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to the 161The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to the
159`~/.spamassassin/user_prefs' file. If the `sa-learn' command is available, the 162`~/.spamassassin/user_prefs' file. If the `sa-learn' command is
160message is also recategorized as ham. 163available, the message is also recategorized as ham.
161 164
162Over time, you'll observe that the same host or domain occurs repeatedly in 165Over time, you'll observe that the same host or domain occurs
163the `blacklist_from' entries, so you might think that you could avoid future 166repeatedly in the `blacklist_from' entries, so you might think that
164spam by blacklisting all mail from a particular domain. The utility function 167you could avoid future spam by blacklisting all mail from a particular
165`mh-spamassassin-identify-spammers' helps you do precisely that. This function 168domain. The utility function `mh-spamassassin-identify-spammers' helps
166displays a frequency count of the hosts and domains in the `blacklist_from' 169you do precisely that. This function displays a frequency count of the
167entries from the last blank line in `~/.spamassassin/user_prefs' to the end of 170hosts and domains in the `blacklist_from' entries from the last blank
168the file. This information can be used so that you can replace multiple 171line in `~/.spamassassin/user_prefs' to the end of the file. This
172information can be used so that you can replace multiple
169`blacklist_from' entries with a single wildcard entry such as: 173`blacklist_from' entries with a single wildcard entry such as:
170 174
171 blacklist_from *@*amazingoffersdirect2u.com 175 blacklist_from *@*amazingoffersdirect2u.com
172 176
173In versions of SpamAssassin (2.50 and on) that support a Bayesian classifier, 177In versions of SpamAssassin (2.50 and on) that support a Bayesian
174\\[mh-junk-blacklist] uses the `sa-learn' program to recategorize the message 178classifier, \\[mh-junk-blacklist] uses the `sa-learn' program to
175as spam. Neither MH-E, nor SpamAssassin, rebuilds the database after adding 179recategorize the message as spam. Neither MH-E, nor SpamAssassin,
176words, so you will need to run `sa-learn --rebuild' periodically. This can be 180rebuilds the database after adding words, so you will need to run
177done by adding the following to your crontab: 181`sa-learn --rebuild' periodically. This can be done by adding the
182following to your crontab:
178 183
179 0 * * * * sa-learn --rebuild > /dev/null 2>&1" 184 0 * * * * sa-learn --rebuild > /dev/null 2>&1"
180 (unless mh-spamassassin-executable 185 (unless mh-spamassassin-executable
@@ -210,9 +215,9 @@ done by adding the following to your crontab:
210(defun mh-spamassassin-whitelist (msg) 215(defun mh-spamassassin-whitelist (msg)
211 "Whitelist MSG with SpamAssassin. 216 "Whitelist MSG with SpamAssassin.
212 217
213The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to the 218The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to
214`~/.spamassassin/user_prefs' file. If the `sa-learn' command is available, the 219the `~/.spamassassin/user_prefs' file. If the `sa-learn' command
215message is also recategorized as ham. 220is available, the message is also recategorized as ham.
216 221
217See `mh-spamassassin-blacklist' for more information." 222See `mh-spamassassin-blacklist' for more information."
218 (unless mh-spamassassin-executable 223 (unless mh-spamassassin-executable
@@ -263,11 +268,11 @@ The name of the rule is RULE and its body is BODY."
263(defun mh-spamassassin-identify-spammers () 268(defun mh-spamassassin-identify-spammers ()
264 "Identify spammers who are repeat offenders. 269 "Identify spammers who are repeat offenders.
265 270
266This function displays a frequency count of the hosts and domains in the 271This function displays a frequency count of the hosts and domains
267`blacklist_from' entries from the last blank line in 272in the `blacklist_from' entries from the last blank line in
268`~/.spamassassin/user_prefs' to the end of the file. This information can be 273`~/.spamassassin/user_prefs' to the end of the file. This
269used so that you can replace multiple `blacklist_from' entries with a single 274information can be used so that you can replace multiple
270wildcard entry such as: 275`blacklist_from' entries with a single wildcard entry such as:
271 276
272 blacklist_from *@*amazingoffersdirect2u.com" 277 blacklist_from *@*amazingoffersdirect2u.com"
273 (interactive) 278 (interactive)
@@ -312,8 +317,8 @@ wildcard entry such as:
312(defun mh-bogofilter-blacklist (msg) 317(defun mh-bogofilter-blacklist (msg)
313 "Blacklist MSG with bogofilter. 318 "Blacklist MSG with bogofilter.
314 319
315Bogofilter is a Bayesian spam filtering program. Get it from your local 320Bogofilter is a Bayesian spam filtering program. Get it from your
316distribution or from http://bogofilter.sourceforge.net/. 321local distribution or from http://bogofilter.sourceforge.net/.
317 322
318Bogofilter is taught by running: 323Bogofilter is taught by running:
319 324
@@ -324,9 +329,9 @@ on every good message, and
324 bogofilter -s < spam-message 329 bogofilter -s < spam-message
325 330
326on every spam message. This is called a full training; three other 331on every spam message. This is called a full training; three other
327training methods are described in the FAQ that is distributed with bogofilter. 332training methods are described in the FAQ that is distributed with
328Note that most Bayesian filters need 1000 to 5000 of each type of message to 333bogofilter. Note that most Bayesian filters need 1000 to 5000 of each
329start doing a good job. 334type of message to start doing a good job.
330 335
331To use bogofilter, add the following recipes to `.procmailrc': 336To use bogofilter, add the following recipes to `.procmailrc':
332 337
@@ -344,9 +349,9 @@ To use bogofilter, add the following recipes to `.procmailrc':
344 * ^X-Bogosity: Unsure, tests=bogofilter 349 * ^X-Bogosity: Unsure, tests=bogofilter
345 spam/unsure/. 350 spam/unsure/.
346 351
347If bogofilter classifies a message incorrectly, or is unsure, you can use the 352If bogofilter classifies a message incorrectly, or is unsure, you can
348MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist] to update 353use the MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist]
349bogofilter's training. 354to update bogofilter's training.
350 355
351The \"Bogofilter FAQ\" suggests that you run the following 356The \"Bogofilter FAQ\" suggests that you run the following
352occasionally to shrink the database: 357occasionally to shrink the database:
@@ -399,9 +404,9 @@ To use SpamProbe, add the following recipes to `.procmailrc':
399 *^X-SpamProbe: SPAM 404 *^X-SpamProbe: SPAM
400 spam/. 405 spam/.
401 406
402If SpamProbe classifies a message incorrectly, you can use the MH-E commands 407If SpamProbe classifies a message incorrectly, you can use the
403\\[mh-junk-blacklist] and \\[mh-junk-whitelist] to update SpamProbe's 408MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist] to
404training." 409update SpamProbe's training."
405 (unless mh-spamprobe-executable 410 (unless mh-spamprobe-executable
406 (error "Unable to find the spamprobe executable")) 411 (error "Unable to find the spamprobe executable"))
407 (let ((msg-file (mh-msg-filename msg mh-current-folder))) 412 (let ((msg-file (mh-msg-filename msg mh-current-folder)))
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index e8b4b2dd2c0..97d494fb5c3 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -55,12 +55,15 @@
55;;;###mh-autoload 55;;;###mh-autoload
56(defun mh-compose-insertion (&optional inline) 56(defun mh-compose-insertion (&optional inline)
57 "Add tag to include a file such as an image or sound. 57 "Add tag to include a file such as an image or sound.
58You are prompted for the filename containing the object, the media type if it
59cannot be determined automatically, and a content description. If you're using
60MH-style directives, you will also be prompted for additional attributes.
61 58
62The option `mh-compose-insertion' controls what type of tags are inserted. 59You are prompted for the filename containing the object, the
63Optional argument INLINE means make it an inline attachment." 60media type if it cannot be determined automatically, and a
61content description. If you're using MH-style directives, you
62will also be prompted for additional attributes.
63
64The option `mh-compose-insertion' controls what type of tags are
65inserted. Optional argument INLINE means make it an inline
66attachment."
64 (interactive "P") 67 (interactive "P")
65 (if (equal mh-compose-insertion 'mml) 68 (if (equal mh-compose-insertion 'mml)
66 (if inline 69 (if inline
@@ -71,8 +74,10 @@ Optional argument INLINE means make it an inline attachment."
71;;;###mh-autoload 74;;;###mh-autoload
72(defun mh-compose-forward (&optional description folder messages) 75(defun mh-compose-forward (&optional description folder messages)
73 "Add tag to forward a message. 76 "Add tag to forward a message.
74You are prompted for a content DESCRIPTION, the name of the FOLDER in which 77
75the messages to forward are located, and the MESSAGES' numbers. 78You are prompted for a content DESCRIPTION, the name of the
79FOLDER in which the messages to forward are located, and the
80MESSAGES' numbers.
76 81
77The option `mh-compose-insertion' controls what type of tags are inserted." 82The option `mh-compose-insertion' controls what type of tags are inserted."
78 (interactive (let* 83 (interactive (let*
@@ -117,9 +122,9 @@ The option `mh-compose-insertion' controls what type of tags are inserted."
117 122
118(defvar mh-mh-to-mime-args nil 123(defvar mh-mh-to-mime-args nil
119 "Extra arguments for \\[mh-mh-to-mime] to pass to the \"mhbuild\" command. 124 "Extra arguments for \\[mh-mh-to-mime] to pass to the \"mhbuild\" command.
120The arguments are passed to \"mhbuild\" if \\[mh-mh-to-mime] is given a prefix 125The arguments are passed to \"mhbuild\" if \\[mh-mh-to-mime] is
121argument. Normally default arguments to \"mhbuild\" are specified in the MH 126given a prefix argument. Normally default arguments to
122profile.") 127\"mhbuild\" are specified in the MH profile.")
123 128
124(defvar mh-media-type-regexp 129(defvar mh-media-type-regexp
125 (concat (regexp-opt '("text" "image" "audio" "video" "application" 130 (concat (regexp-opt '("text" "image" "audio" "video" "application"
@@ -151,12 +156,14 @@ profile.")
151 ("text/plain" "\.vcf" "text/x-vcard")) 156 ("text/plain" "\.vcf" "text/x-vcard"))
152 "Substitutions to make for Content-Type returned from file command. 157 "Substitutions to make for Content-Type returned from file command.
153The first element is the Content-Type returned by the file command. 158The first element is the Content-Type returned by the file command.
154The second element is a regexp matching the file name, usually the extension. 159The second element is a regexp matching the file name, usually the
160extension.
155The third element is the Content-Type to replace with.") 161The third element is the Content-Type to replace with.")
156 162
157(defun mh-file-mime-type-substitute (content-type filename) 163(defun mh-file-mime-type-substitute (content-type filename)
158 "Return possibly changed CONTENT-TYPE on the FILENAME. 164 "Return possibly changed CONTENT-TYPE on the FILENAME.
159Substitutions are made from the `mh-file-mime-type-substitutions' variable." 165Substitutions are made from the `mh-file-mime-type-substitutions'
166variable."
160 (let ((subst mh-file-mime-type-substitutions) 167 (let ((subst mh-file-mime-type-substitutions)
161 (type) (match) (answer content-type) 168 (type) (match) (answer content-type)
162 (case-fold-search t)) 169 (case-fold-search t))
@@ -225,9 +232,10 @@ See also \\[mh-mh-to-mime].")
225 232
226(defun mh-minibuffer-read-type (filename &optional default) 233(defun mh-minibuffer-read-type (filename &optional default)
227 "Return the content type associated with the given FILENAME. 234 "Return the content type associated with the given FILENAME.
228If the \"file\" command exists and recognizes the given file, then its value 235If the \"file\" command exists and recognizes the given file,
229is returned\; otherwise, the user is prompted for a type (see 236then its value is returned\; otherwise, the user is prompted for
230`mailcap-mime-types' and for Emacs 20, `mh-mime-content-types'). 237a type (see `mailcap-mime-types' and for Emacs 20,
238`mh-mime-content-types').
231Optional argument DEFAULT is returned if a type isn't entered." 239Optional argument DEFAULT is returned if a type isn't entered."
232 (mailcap-parse-mimetypes) 240 (mailcap-parse-mimetypes)
233 (let* ((default (or default 241 (let* ((default (or default
@@ -272,9 +280,10 @@ Optional argument DEFAULT is returned if a type isn't entered."
272;;;###mh-autoload 280;;;###mh-autoload
273(defun mh-mh-attach-file (filename type description attributes) 281(defun mh-mh-attach-file (filename type description attributes)
274 "Add a tag to insert a MIME message part from a file. 282 "Add a tag to insert a MIME message part from a file.
275You are prompted for the FILENAME containing the object, the media TYPE if it 283You are prompted for the FILENAME containing the object, the
276cannot be determined automatically, and a content DESCRIPTION. In addition, 284media TYPE if it cannot be determined automatically, and a
277you are also prompted for additional ATTRIBUTES. 285content DESCRIPTION. In addition, you are also prompted for
286additional ATTRIBUTES.
278 287
279See also \\[mh-mh-to-mime]." 288See also \\[mh-mh-to-mime]."
280 (interactive (let ((filename (mml-minibuffer-read-file "Attach file: "))) 289 (interactive (let ((filename (mml-minibuffer-read-file "Attach file: ")))
@@ -291,9 +300,9 @@ See also \\[mh-mh-to-mime]."
291(defun mh-mh-compose-type (filename type 300(defun mh-mh-compose-type (filename type
292 &optional description attributes comment) 301 &optional description attributes comment)
293 "Insert an MH-style directive to insert a file. 302 "Insert an MH-style directive to insert a file.
294The file specified by FILENAME is encoded as TYPE. An optional DESCRIPTION is 303The file specified by FILENAME is encoded as TYPE. An optional
295used as the Content-Description field, optional set of ATTRIBUTES and an 304DESCRIPTION is used as the Content-Description field, optional
296optional COMMENT can also be included." 305set of ATTRIBUTES and an optional COMMENT can also be included."
297 (beginning-of-line) 306 (beginning-of-line)
298 (insert "#" type) 307 (insert "#" type)
299 (and attributes 308 (and attributes
@@ -309,8 +318,8 @@ optional COMMENT can also be included."
309;;;###mh-autoload 318;;;###mh-autoload
310(defun mh-mh-compose-anon-ftp (host filename type description) 319(defun mh-mh-compose-anon-ftp (host filename type description)
311 "Add tag to include anonymous ftp reference to a file. 320 "Add tag to include anonymous ftp reference to a file.
312You can even have your message initiate an \"ftp\" transfer when the 321You can even have your message initiate an \"ftp\" transfer when
313recipient reads the message. You are prompted for the remote 322the recipient reads the message. You are prompted for the remote
314HOST and FILENAME, the media TYPE, and the content DESCRIPTION. 323HOST and FILENAME, the media TYPE, and the content DESCRIPTION.
315 324
316See also \\[mh-mh-to-mime]." 325See also \\[mh-mh-to-mime]."
@@ -325,10 +334,10 @@ See also \\[mh-mh-to-mime]."
325;;;###mh-autoload 334;;;###mh-autoload
326(defun mh-mh-compose-external-compressed-tar (host filename description) 335(defun mh-mh-compose-external-compressed-tar (host filename description)
327 "Add tag to include anonymous ftp reference to a compressed tar file. 336 "Add tag to include anonymous ftp reference to a compressed tar file.
328In addition to retrieving the file via anonymous \"ftp\" as per the 337In addition to retrieving the file via anonymous \"ftp\" as per
329\\[mh-mh-compose-anon-ftp] command, the file will also be uncompressed and 338the \\[mh-mh-compose-anon-ftp] command, the file will also be
330untarred. You are prompted for the remote HOST and FILENAME and the content 339uncompressed and untarred. You are prompted for the remote HOST
331DESCRIPTION. 340and FILENAME and the content DESCRIPTION.
332 341
333See also \\[mh-mh-to-mime]." 342See also \\[mh-mh-to-mime]."
334 (interactive (list 343 (interactive (list
@@ -347,11 +356,12 @@ See also \\[mh-mh-to-mime]."
347 attributes parameters 356 attributes parameters
348 comment) 357 comment)
349 "Add tag to refer to a remote file. 358 "Add tag to refer to a remote file.
350This command is a general utility for referencing external files. In fact, all 359This command is a general utility for referencing external files.
351of the other commands that insert directives to access external files call 360In fact, all of the other commands that insert directives to
352this command. You are prompted for the ACCESS-TYPE, remote HOST and FILENAME, 361access external files call this command. You are prompted for the
353and content TYPE. If you provide a prefix argument, you are also prompted for 362ACCESS-TYPE, remote HOST and FILENAME, and content TYPE. If you
354a content DESCRIPTION, ATTRIBUTES, PARAMETERS, and a COMMENT. 363provide a prefix argument, you are also prompted for a content
364DESCRIPTION, ATTRIBUTES, PARAMETERS, and a COMMENT.
355 365
356See also \\[mh-mh-to-mime]." 366See also \\[mh-mh-to-mime]."
357 (interactive (list 367 (interactive (list
@@ -386,8 +396,9 @@ See also \\[mh-mh-to-mime]."
386;;;###mh-autoload 396;;;###mh-autoload
387(defun mh-mh-forward-message (&optional description folder messages) 397(defun mh-mh-forward-message (&optional description folder messages)
388 "Add tag to forward a message. 398 "Add tag to forward a message.
389You are prompted for a content DESCRIPTION, the name of the FOLDER in which 399You are prompted for a content DESCRIPTION, the name of the
390the messages to forward are located, and the MESSAGES' numbers. 400FOLDER in which the messages to forward are located, and the
401MESSAGES' numbers.
391 402
392See also \\[mh-mh-to-mime]." 403See also \\[mh-mh-to-mime]."
393 (interactive (list 404 (interactive (list
@@ -420,22 +431,24 @@ See also \\[mh-mh-to-mime]."
420(defun mh-mh-to-mime (&optional extra-args) 431(defun mh-mh-to-mime (&optional extra-args)
421 "Compose MIME message from MH-style directives. 432 "Compose MIME message from MH-style directives.
422 433
423Typically, you send a message with attachments just like any other message. 434Typically, you send a message with attachments just like any other
424However, you may take a sneak preview of the MIME encoding if you wish by 435message. However, you may take a sneak preview of the MIME encoding if
425running this command. 436you wish by running this command.
426 437
427If you wish to pass additional arguments to \"mhbuild\" (\"mhn\") to affect 438If you wish to pass additional arguments to \"mhbuild\" (\"mhn\") to
428how it builds your message, use the `mh-mh-to-mime-args' option. For example, 439affect how it builds your message, use the `mh-mh-to-mime-args'
429you can build a consistency check into the message by setting 440option. For example, you can build a consistency check into the
430`mh-mh-to-mime-args' to \"-check\". The recipient of your message can then run 441message by setting `mh-mh-to-mime-args' to \"-check\". The recipient
431\"mhbuild -check\" on the message--\"mhbuild\" (\"mhn\") will complain if the 442of your message can then run \"mhbuild -check\" on the
432message has been corrupted on the way. This command only consults this option 443message--\"mhbuild\" (\"mhn\") will complain if the message has been
433when given a prefix argument EXTRA-ARGS. 444corrupted on the way. This command only consults this option when
445given a prefix argument EXTRA-ARGS.
434 446
435The hook `mh-mh-to-mime-hook' is called after the message has been 447The hook `mh-mh-to-mime-hook' is called after the message has been
436formatted. 448formatted.
437 449
438The effects of this command can be undone by running \\[mh-mh-to-mime-undo]." 450The effects of this command can be undone by running
451\\[mh-mh-to-mime-undo]."
439 (interactive "*P") 452 (interactive "*P")
440 (mh-mh-quote-unescaped-sharp) 453 (mh-mh-quote-unescaped-sharp)
441 (save-buffer) 454 (save-buffer)
@@ -457,9 +470,9 @@ The effects of this command can be undone by running \\[mh-mh-to-mime-undo]."
457 470
458(defun mh-mh-quote-unescaped-sharp () 471(defun mh-mh-quote-unescaped-sharp ()
459 "Quote `#' characters that haven't been quoted for \"mhbuild\". 472 "Quote `#' characters that haven't been quoted for \"mhbuild\".
460If the `#' character is present in the first column, but it isn't part of a 473If the `#' character is present in the first column, but it isn't
461MH-style directive then \"mhbuild\" gives an error. This function will quote 474part of a MH-style directive then \"mhbuild\" gives an error.
462all such characters." 475This function will quote all such characters."
463 (save-excursion 476 (save-excursion
464 (goto-char (point-min)) 477 (goto-char (point-min))
465 (while (re-search-forward "^#" nil t) 478 (while (re-search-forward "^#" nil t)
@@ -471,7 +484,8 @@ all such characters."
471;;;###mh-autoload 484;;;###mh-autoload
472(defun mh-mh-to-mime-undo (noconfirm) 485(defun mh-mh-to-mime-undo (noconfirm)
473 "Undo effects of \\[mh-mh-to-mime]. 486 "Undo effects of \\[mh-mh-to-mime].
474Optional non-nil argument NOCONFIRM means don't ask for confirmation." 487Optional non-nil argument NOCONFIRM means don't ask for
488confirmation."
475 (interactive "*P") 489 (interactive "*P")
476 (if (null buffer-file-name) 490 (if (null buffer-file-name)
477 (error "Buffer does not seem to be associated with any file")) 491 (error "Buffer does not seem to be associated with any file"))
@@ -499,8 +513,8 @@ Optional non-nil argument NOCONFIRM means don't ask for confirmation."
499;;;###mh-autoload 513;;;###mh-autoload
500(defun mh-mh-directive-present-p (&optional begin end) 514(defun mh-mh-directive-present-p (&optional begin end)
501 "Check if the text between BEGIN and END might be a MH-style directive. 515 "Check if the text between BEGIN and END might be a MH-style directive.
502The optional argument BEGIN defaults to the beginning of the buffer, while END 516The optional argument BEGIN defaults to the beginning of the
503defaults to the the end of the buffer." 517buffer, while END defaults to the the end of the buffer."
504 (unless begin (setq begin (point-min))) 518 (unless begin (setq begin (point-min)))
505 (unless end (setq end (point-max))) 519 (unless end (setq end (point-max)))
506 (save-excursion 520 (save-excursion
@@ -525,9 +539,10 @@ defaults to the the end of the buffer."
525;;;###mh-autoload 539;;;###mh-autoload
526(defun mh-mml-to-mime () 540(defun mh-mml-to-mime ()
527 "Compose MIME message from MML tags. 541 "Compose MIME message from MML tags.
528Typically, you send a message with attachments just like any other message. 542
529However, you may take a sneak preview of the MIME encoding if you wish by 543Typically, you send a message with attachments just like any
530running this command. 544other message. However, you may take a sneak preview of the MIME
545encoding if you wish by running this command.
531 546
532This action can be undone by running \\[undo]." 547This action can be undone by running \\[undo]."
533 (interactive) 548 (interactive)
@@ -548,8 +563,9 @@ This action can be undone by running \\[undo]."
548;;;###mh-autoload 563;;;###mh-autoload
549(defun mh-mml-forward-message (description folder message) 564(defun mh-mml-forward-message (description folder message)
550 "Forward a message as attachment. 565 "Forward a message as attachment.
551The function will prompt the user for a DESCRIPTION, a FOLDER and MESSAGE 566
552number." 567The function will prompt the user for a DESCRIPTION, a FOLDER and
568MESSAGE number."
553 (let ((msg (if (and (equal message "") (numberp mh-sent-from-msg)) 569 (let ((msg (if (and (equal message "") (numberp mh-sent-from-msg))
554 mh-sent-from-msg 570 mh-sent-from-msg
555 (car (read-from-string message))))) 571 (car (read-from-string message)))))
@@ -582,9 +598,10 @@ number."
582;;;###mh-autoload 598;;;###mh-autoload
583(defun mh-mml-attach-file (&optional disposition) 599(defun mh-mml-attach-file (&optional disposition)
584 "Add a tag to insert a MIME message part from a file. 600 "Add a tag to insert a MIME message part from a file.
585You are prompted for the filename containing the object, the media type if it 601
586cannot be determined automatically, a content description and the DISPOSITION 602You are prompted for the filename containing the object, the
587of the attachment. 603media type if it cannot be determined automatically, a content
604description and the DISPOSITION of the attachment.
588 605
589This is basically `mml-attach-file' from Gnus, modified such that a prefix 606This is basically `mml-attach-file' from Gnus, modified such that a prefix
590argument yields an `inline' disposition and Content-Type is determined 607argument yields an `inline' disposition and Content-Type is determined
@@ -601,6 +618,7 @@ automatically."
601 618
602(defun mh-secure-message (method mode &optional identity) 619(defun mh-secure-message (method mode &optional identity)
603 "Add tag to encrypt or sign message. 620 "Add tag to encrypt or sign message.
621
604METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". 622METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\".
605MODE should be one of: \"sign\", \"encrypt\", \"signencrypt\", \"none\". 623MODE should be one of: \"sign\", \"encrypt\", \"signencrypt\", \"none\".
606IDENTITY is optionally the default-user-id to use." 624IDENTITY is optionally the default-user-id to use."
@@ -635,30 +653,33 @@ The argument IGNORE is not used."
635;;;###mh-autoload 653;;;###mh-autoload
636(defun mh-mml-secure-message-sign (method) 654(defun mh-mml-secure-message-sign (method)
637 "Add tag to sign the message. 655 "Add tag to sign the message.
638A proper multipart message is created for you when you send the message. Use 656
639the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix 657A proper multipart message is created for you when you send the
640argument METHOD to be prompted for one of the possible security methods 658message. Use the \\[mh-mml-unsecure-message] command to remove
641\(see `mh-mml-method-default')." 659this tag. Use a prefix argument METHOD to be prompted for one of
660the possible security methods \(see `mh-mml-method-default')."
642 (interactive (list (mh-mml-query-cryptographic-method))) 661 (interactive (list (mh-mml-query-cryptographic-method)))
643 (mh-secure-message method "sign" mh-identity-pgg-default-user-id)) 662 (mh-secure-message method "sign" mh-identity-pgg-default-user-id))
644 663
645;;;###mh-autoload 664;;;###mh-autoload
646(defun mh-mml-secure-message-encrypt (method) 665(defun mh-mml-secure-message-encrypt (method)
647 "Add tag to encrypt the message. 666 "Add tag to encrypt the message.
648A proper multipart message is created for you when you send the message. Use 667
649the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix 668A proper multipart message is created for you when you send the
650argument METHOD to be prompted for one of the possible security methods 669message. Use the \\[mh-mml-unsecure-message] command to remove
651\(see `mh-mml-method-default')." 670this tag. Use a prefix argument METHOD to be prompted for one of
671the possible security methods \(see `mh-mml-method-default')."
652 (interactive (list (mh-mml-query-cryptographic-method))) 672 (interactive (list (mh-mml-query-cryptographic-method)))
653 (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id)) 673 (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id))
654 674
655;;;###mh-autoload 675;;;###mh-autoload
656(defun mh-mml-secure-message-signencrypt (method) 676(defun mh-mml-secure-message-signencrypt (method)
657 "Add tag to encrypt and sign the message. 677 "Add tag to encrypt and sign the message.
658A proper multipart message is created for you when you send the message. Use 678
659the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix 679A proper multipart message is created for you when you send the
660argument METHOD to be prompted for one of the possible security methods 680message. Use the \\[mh-mml-unsecure-message] command to remove
661\(see `mh-mml-method-default')." 681this tag. Use a prefix argument METHOD to be prompted for one of
682the possible security methods \(see `mh-mml-method-default')."
662 (interactive (list (mh-mml-query-cryptographic-method))) 683 (interactive (list (mh-mml-query-cryptographic-method)))
663 (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id)) 684 (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id))
664 685
@@ -695,10 +716,11 @@ argument METHOD to be prompted for one of the possible security methods
695 716
696(defun mh-handle-set-external-undisplayer (folder handle function) 717(defun mh-handle-set-external-undisplayer (folder handle function)
697 "Replacement for `mm-handle-set-external-undisplayer'. 718 "Replacement for `mm-handle-set-external-undisplayer'.
698This is only called in recent versions of Gnus. The MIME handles are stored 719
699in data structures corresponding to MH-E folder buffer FOLDER instead of in 720This is only called in recent versions of Gnus. The MIME handles
700Gnus (as in the original). The MIME part, HANDLE is associated with the 721are stored in data structures corresponding to MH-E folder buffer
701undisplayer FUNCTION." 722FOLDER instead of in Gnus (as in the original). The MIME part,
723HANDLE is associated with the undisplayer FUNCTION."
702 (if (mm-keep-viewer-alive-p handle) 724 (if (mm-keep-viewer-alive-p handle)
703 (let ((new-handle (copy-sequence handle))) 725 (let ((new-handle (copy-sequence handle)))
704 (mm-handle-set-undisplayer new-handle function) 726 (mm-handle-set-undisplayer new-handle function)
@@ -716,7 +738,8 @@ undisplayer FUNCTION."
716;;;###mh-autoload 738;;;###mh-autoload
717(defun mh-add-missing-mime-version-header () 739(defun mh-add-missing-mime-version-header ()
718 "Some mail programs don't put a MIME-Version header. 740 "Some mail programs don't put a MIME-Version header.
719I have seen this only in spam, so maybe we shouldn't fix this ;-)" 741I have seen this only in spam, so maybe we shouldn't fix
742this ;-)"
720 (save-excursion 743 (save-excursion
721 (goto-char (point-min)) 744 (goto-char (point-min))
722 (re-search-forward "\n\n" nil t) 745 (re-search-forward "\n\n" nil t)
@@ -729,7 +752,8 @@ I have seen this only in spam, so maybe we shouldn't fix this ;-)"
729 752
730(defun mh-small-show-buffer-p () 753(defun mh-small-show-buffer-p ()
731 "Check if show buffer is small. 754 "Check if show buffer is small.
732This is used to decide if smileys and graphical emphasis will be displayed." 755This is used to decide if smileys and graphical emphasis will be
756displayed."
733 (let ((max nil)) 757 (let ((max nil))
734 (when (and (boundp 'font-lock-maximum-size) font-lock-maximum-size) 758 (when (and (boundp 'font-lock-maximum-size) font-lock-maximum-size)
735 (cond ((numberp font-lock-maximum-size) 759 (cond ((numberp font-lock-maximum-size)
@@ -803,12 +827,13 @@ Set from last use.")
803(defun mh-mime-save-parts (prompt) 827(defun mh-mime-save-parts (prompt)
804 "Save attachments. 828 "Save attachments.
805 829
806You can save all of the attachments at once with this command. The attachments 830You can save all of the attachments at once with this command.
807are saved in the directory specified by the option 831The attachments are saved in the directory specified by the
808`mh-mime-save-parts-default-directory' unless you use a prefix argument PROMPT 832option `mh-mime-save-parts-default-directory' unless you use a
809in which case you are prompted for the directory. These directories may be 833prefix argument PROMPT in which case you are prompted for the
810superseded by MH profile components, since this function calls on 834directory. These directories may be superseded by MH profile
811\"mhstore\" (\"mhn\") to do the work." 835components, since this function calls on \"mhstore\" (\"mhn\") to
836do the work."
812 (interactive "P") 837 (interactive "P")
813 (let ((msg (if (eq major-mode 'mh-show-mode) 838 (let ((msg (if (eq major-mode 'mh-show-mode)
814 (mh-show-buffer-message-number) 839 (mh-show-buffer-message-number)
@@ -900,9 +925,9 @@ If message has been encoded for transfer take that into account."
900;;;###mh-autoload 925;;;###mh-autoload
901(defun mh-mime-display (&optional pre-dissected-handles) 926(defun mh-mime-display (&optional pre-dissected-handles)
902 "Display (and possibly decode) MIME handles. 927 "Display (and possibly decode) MIME handles.
903Optional argument, PRE-DISSECTED-HANDLES is a list of MIME handles. If 928Optional argument, PRE-DISSECTED-HANDLES is a list of MIME
904present they are displayed otherwise the buffer is parsed and then 929handles. If present they are displayed otherwise the buffer is
905displayed." 930parsed and then displayed."
906 (let ((handles ()) 931 (let ((handles ())
907 (folder mh-show-folder-buffer) 932 (folder mh-show-folder-buffer)
908 (raw-message-data (buffer-string))) 933 (raw-message-data (buffer-string)))
@@ -974,8 +999,8 @@ If no part is preferred then all the parts are displayed."
974 999
975(defun mh-mime-maybe-display-alternatives (alternatives) 1000(defun mh-mime-maybe-display-alternatives (alternatives)
976 "Show buttons for ALTERNATIVES. 1001 "Show buttons for ALTERNATIVES.
977If `mh-mime-display-alternatives-flag' is non-nil then display buttons for 1002If `mh-mime-display-alternatives-flag' is non-nil then display
978alternative parts that are usually suppressed." 1003buttons for alternative parts that are usually suppressed."
979 (when (and mh-display-buttons-for-alternatives-flag alternatives) 1004 (when (and mh-display-buttons-for-alternatives-flag alternatives)
980 (insert "\n----------------------------------------------------\n") 1005 (insert "\n----------------------------------------------------\n")
981 (insert "Alternatives:\n") 1006 (insert "Alternatives:\n")
@@ -990,9 +1015,9 @@ alternative parts that are usually suppressed."
990 1015
991(defun mh-mime-part-index (handle) 1016(defun mh-mime-part-index (handle)
992 "Generate the button number for MIME part, HANDLE. 1017 "Generate the button number for MIME part, HANDLE.
993Notice that a hash table is used to display the same number when buttons need 1018Notice that a hash table is used to display the same number when
994to be displayed multiple times (for instance when nested messages are 1019buttons need to be displayed multiple times (for instance when
995opened)." 1020nested messages are opened)."
996 (or (gethash handle (mh-mime-part-index-hash (mh-buffer-data))) 1021 (or (gethash handle (mh-mime-part-index-hash (mh-buffer-data)))
997 (setf (gethash handle (mh-mime-part-index-hash (mh-buffer-data))) 1022 (setf (gethash handle (mh-mime-part-index-hash (mh-buffer-data)))
998 (incf (mh-mime-parts-count (mh-buffer-data)))))) 1023 (incf (mh-mime-parts-count (mh-buffer-data))))))
@@ -1075,8 +1100,8 @@ This is only useful if a Content-Disposition header is not present."
1075 1100
1076(defun mh-signature-highlight (&optional handle) 1101(defun mh-signature-highlight (&optional handle)
1077 "Highlight message signature in HANDLE. 1102 "Highlight message signature in HANDLE.
1078The optional argument, HANDLE is a MIME handle if the function is being used 1103The optional argument, HANDLE is a MIME handle if the function is
1079to highlight the signature in a MIME part." 1104being used to highlight the signature in a MIME part."
1080 (let ((regexp 1105 (let ((regexp
1081 (cond ((not handle) "^-- $") 1106 (cond ((not handle) "^-- $")
1082 ((not (and (equal (mm-handle-media-supertype handle) "text") 1107 ((not (and (equal (mm-handle-media-supertype handle) "text")
@@ -1101,8 +1126,8 @@ to highlight the signature in a MIME part."
1101 1126
1102(defun mh-insert-mime-button (handle index displayed) 1127(defun mh-insert-mime-button (handle index displayed)
1103 "Insert MIME button for HANDLE. 1128 "Insert MIME button for HANDLE.
1104INDEX is the part number that will be DISPLAYED. It is also used by commands 1129INDEX is the part number that will be DISPLAYED. It is also used
1105like \"K v\" which operate on individual MIME parts." 1130by commands like \"K v\" which operate on individual MIME parts."
1106 ;; The button could be displayed by a previous decode. In that case 1131 ;; The button could be displayed by a previous decode. In that case
1107 ;; undisplay it if we need a hidden button. 1132 ;; undisplay it if we need a hidden button.
1108 (when (and (mm-handle-displayed-p handle) (not displayed)) 1133 (when (and (mm-handle-displayed-p handle) (not displayed))
@@ -1214,8 +1239,8 @@ like \"K v\" which operate on individual MIME parts."
1214(defun mh-press-button () 1239(defun mh-press-button ()
1215 "View contents of button. 1240 "View contents of button.
1216 1241
1217This command is a toggle so if you use it again on the same attachment, the 1242This command is a toggle so if you use it again on the same
1218attachment is hidden." 1243attachment, the attachment is hidden."
1219 (interactive) 1244 (interactive)
1220 (let ((mm-inline-media-tests mh-mm-inline-media-tests) 1245 (let ((mm-inline-media-tests mh-mm-inline-media-tests)
1221 (data (get-text-property (point) 'mh-data)) 1246 (data (get-text-property (point) 'mh-data))
@@ -1233,9 +1258,10 @@ attachment is hidden."
1233;;;###mh-autoload 1258;;;###mh-autoload
1234(defun mh-push-button (event) 1259(defun mh-push-button (event)
1235 "Click MIME button for EVENT. 1260 "Click MIME button for EVENT.
1236If the MIME part is visible then it is removed. Otherwise the part is 1261
1237displayed. This function is called when the mouse is used to click the MIME 1262If the MIME part is visible then it is removed. Otherwise the
1238button." 1263part is displayed. This function is called when the mouse is used
1264to click the MIME button."
1239 (interactive "e") 1265 (interactive "e")
1240 (mh-do-at-event-location event 1266 (mh-do-at-event-location event
1241 (let ((folder mh-show-folder-buffer) 1267 (let ((folder mh-show-folder-buffer)
@@ -1289,21 +1315,24 @@ button."
1289(defun mh-display-with-external-viewer (part-index) 1315(defun mh-display-with-external-viewer (part-index)
1290 "View attachment externally. 1316 "View attachment externally.
1291 1317
1292If Emacs does not know how to view an attachment, you could save it into a 1318If Emacs does not know how to view an attachment, you could save
1293file and then run some program to open it. It is easier, however, to launch 1319it into a file and then run some program to open it. It is
1294the program directly from MH-E with this command. While you'll most likely use 1320easier, however, to launch the program directly from MH-E with
1295this to view spreadsheets and documents, it is also useful to use your browser 1321this command. While you'll most likely use this to view
1296to view HTML attachments with higher fidelity than what Emacs can provide. 1322spreadsheets and documents, it is also useful to use your browser
1297 1323to view HTML attachments with higher fidelity than what Emacs can
1298This command displays the attachment associated with the button under the 1324provide.
1299cursor. If the cursor is not located over a button, then the cursor first 1325
1300moves to the next button, wrapping to the beginning of the message if 1326This command displays the attachment associated with the button
1301necessary. You can provide a numeric prefix argument PART-INDEX to view the 1327under the cursor. If the cursor is not located over a button,
1302attachment labeled with that number. 1328then the cursor first moves to the next button, wrapping to the
1303 1329beginning of the message if necessary. You can provide a numeric
1304This command tries to provide a reasonable default for the viewer by calling 1330prefix argument PART-INDEX to view the attachment labeled with
1305the Emacs function `mailcap-mime-info'. This function usually reads the file 1331that number.
1306\"/etc/mailcap\"." 1332
1333This command tries to provide a reasonable default for the viewer
1334by calling the Emacs function `mailcap-mime-info'. This function
1335usually reads the file \"/etc/mailcap\"."
1307 (interactive "P") 1336 (interactive "P")
1308 (when (consp part-index) (setq part-index (car part-index))) 1337 (when (consp part-index) (setq part-index (car part-index)))
1309 (mh-folder-mime-action 1338 (mh-folder-mime-action
@@ -1458,8 +1487,8 @@ Parameter EL is unused."
1458 1487
1459(defun mh-mm-inline-message (handle) 1488(defun mh-mm-inline-message (handle)
1460 "Display message, HANDLE. 1489 "Display message, HANDLE.
1461The function decodes the message and displays it. It avoids decoding the same 1490The function decodes the message and displays it. It avoids
1462message multiple times." 1491decoding the same message multiple times."
1463 (let ((b (point)) 1492 (let ((b (point))
1464 (clean-message-header mh-clean-message-header-flag) 1493 (clean-message-header mh-clean-message-header-flag)
1465 (invisible-headers mh-invisible-header-fields-compiled) 1494 (invisible-headers mh-invisible-header-fields-compiled)
diff --git a/lisp/mh-e/mh-pick.el b/lisp/mh-e/mh-pick.el
index 5a0a5e6c859..02de9ff859a 100644
--- a/lisp/mh-e/mh-pick.el
+++ b/lisp/mh-e/mh-pick.el
@@ -55,12 +55,12 @@
55 "Search FOLDER for messages matching a pattern. 55 "Search FOLDER for messages matching a pattern.
56 56
57With this command, you can search a folder for messages to or from a 57With this command, you can search a folder for messages to or from a
58particular person or about a particular subject. In fact, you can also search 58particular person or about a particular subject. In fact, you can also
59for messages containing selected strings in any arbitrary header field or any 59search for messages containing selected strings in any arbitrary
60string found within the messages. 60header field or any string found within the messages.
61 61
62You are first prompted for the name of the folder to search and then placed in 62You are first prompted for the name of the folder to search and then
63the following buffer in MH-Pick mode: 63placed in the following buffer in MH-Pick mode:
64 64
65 From: 65 From:
66 To: 66 To:
@@ -69,24 +69,26 @@ the following buffer in MH-Pick mode:
69 Subject: 69 Subject:
70 -------- 70 --------
71 71
72Edit this template by entering your search criteria in an appropriate header 72Edit this template by entering your search criteria in an appropriate
73field that is already there, or create a new field yourself. If the string 73header field that is already there, or create a new field yourself. If
74you're looking for could be anywhere in a message, then place the string 74the string you're looking for could be anywhere in a message, then
75underneath the row of dashes. The \\[mh-search-folder] command uses the MH 75place the string underneath the row of dashes. The
76command \"pick\" to do the real work. 76\\[mh-search-folder] command uses the MH command \"pick\" to do the
77 77real work.
78There are no semantics associated with the search criteria--they are simply 78
79treated as strings. Case is ignored when all lowercase is used, and regular 79There are no semantics associated with the search criteria--they are
80expressions (a la \"ed\") are available. It is all right to specify several 80simply treated as strings. Case is ignored when all lowercase is used,
81search criteria. What happens then is that a logical _and_ of the various 81and regular expressions (a la \"ed\") are available. It is all right
82fields is performed. If you prefer a logical _or_ operation, run 82to specify several search criteria. What happens then is that a
83\\[mh-search-folder] multiple times. 83logical _and_ of the various fields is performed. If you prefer a
84 84logical _or_ operation, run \\[mh-search-folder] multiple times.
85As an example, let's say that we want to find messages from Ginnean about 85
86horseback riding in the Kosciusko National Park (Australia) during January, 86As an example, let's say that we want to find messages from Ginnean
871994. Normally we would start with a broad search and narrow it down if 87about horseback riding in the Kosciusko National Park (Australia)
88necessary to produce a manageable amount of data, but we'll cut to the chase 88during January, 1994. Normally we would start with a broad search and
89and create a fairly restrictive set of criteria as follows: 89narrow it down if necessary to produce a manageable amount of data,
90but we'll cut to the chase and create a fairly restrictive set of
91criteria as follows:
90 92
91 From: ginnean 93 From: ginnean
92 To: 94 To:
@@ -98,29 +100,32 @@ and create a fairly restrictive set of criteria as follows:
98As with MH-Letter mode, MH-Pick provides commands like 100As with MH-Letter mode, MH-Pick provides commands like
99\\<mh-pick-mode-map>\\[mh-to-field] to help you fill in the blanks. 101\\<mh-pick-mode-map>\\[mh-to-field] to help you fill in the blanks.
100 102
101To perform the search, type \\[mh-do-search]. The selected messages are placed 103To perform the search, type \\[mh-do-search]. The selected messages
102in the \"search\" sequence, which you can use later in forwarding, printing, 104are placed in the \"search\" sequence, which you can use later in
103or narrowing your field of view. Subsequent searches are appended to the 105forwarding, printing, or narrowing your field of view. Subsequent
104\"search\" sequence. If, however, you wish to start with a clean slate, first 106searches are appended to the \"search\" sequence. If, however, you
105delete the \"search\" sequence. 107wish to start with a clean slate, first delete the \"search\"
106 108sequence.
107If you're searching in a folder that is already displayed in an MH-Folder 109
108buffer, only those messages contained in the buffer are used for the search. 110If you're searching in a folder that is already displayed in an
109Therefore, if you want to search in all messages, first kill the folder's 111MH-Folder buffer, only those messages contained in the buffer are used
110buffer with \\<mh-folder-mode-map>\\[kill-buffer] or scan the entire folder 112for the search. Therefore, if you want to search in all messages,
111with \\[mh-rescan-folder]. 113first kill the folder's buffer with
112 114\\<mh-folder-mode-map>\\[kill-buffer] or scan the entire folder with
113If you find that you do the same thing over and over when editing the search 115\\[mh-rescan-folder].
114template, you may wish to bind some shortcuts to keys. This can be done with 116
115the variable `mh-pick-mode-hook', which is called when \\[mh-search-folder] is 117If you find that you do the same thing over and over when editing the
116run on a new pattern. 118search template, you may wish to bind some shortcuts to keys. This can
117 119be done with the variable `mh-pick-mode-hook', which is called when
118If you have run the \\[mh-index-search] command, but change your mind while 120\\[mh-search-folder] is run on a new pattern.
119entering the search criteria and actually want to run a regular search, then 121
120you can use the \\<mh-pick-mode-map>\\[mh-pick-do-search] command. 122If you have run the \\[mh-index-search] command, but change your mind
121 123while entering the search criteria and actually want to run a regular
122In a program, argument WINDOW-CONFIG is the current window configuration and 124search, then you can use the \\<mh-pick-mode-map>\\[mh-pick-do-search]
123is used when the search folder is dismissed." 125command.
126
127In a program, argument WINDOW-CONFIG is the current window
128configuration and is used when the search folder is dismissed."
124 (interactive (list (mh-prompt-for-folder "Search" mh-current-folder nil nil t) 129 (interactive (list (mh-prompt-for-folder "Search" mh-current-folder nil nil t)
125 (current-window-configuration))) 130 (current-window-configuration)))
126 (let ((pick-folder (if (equal folder "+") mh-current-folder folder))) 131 (let ((pick-folder (if (equal folder "+") mh-current-folder folder)))
@@ -182,26 +187,26 @@ is used when the search folder is dismissed."
182 "where <field> is the first letter of the desired field.")) 187 "where <field> is the first letter of the desired field."))
183 "Key binding cheat sheet. 188 "Key binding cheat sheet.
184 189
185This is an associative array which is used to show the most common commands. 190This is an associative array which is used to show the most common
186The key is a prefix char. The value is one or more strings which are 191commands. The key is a prefix char. The value is one or more strings
187concatenated together and displayed in the minibuffer if ? is pressed after 192which are concatenated together and displayed in the minibuffer if ?
188the prefix character. The special key nil is used to display the 193is pressed after the prefix character. The special key nil is used to
189non-prefixed commands. 194display the non-prefixed commands.
190 195
191The substitutions described in `substitute-command-keys' are performed as 196The substitutions described in `substitute-command-keys' are performed
192well.") 197as well.")
193 198
194(put 'mh-pick-mode 'mode-class 'special) 199(put 'mh-pick-mode 'mode-class 'special)
195 200
196(define-derived-mode mh-pick-mode fundamental-mode "MH-Pick" 201(define-derived-mode mh-pick-mode fundamental-mode "MH-Pick"
197 "Mode for creating search templates in MH-E.\\<mh-pick-mode-map> 202 "Mode for creating search templates in MH-E.\\<mh-pick-mode-map>
198 203
199After each field name, enter the pattern to search for. If a field's 204After each field name, enter the pattern to search for. If a field's
200value does not matter for the search, leave it empty. To search the 205value does not matter for the search, leave it empty. To search the
201entire message, supply the pattern in the \"body\" of the template. 206entire message, supply the pattern in the \"body\" of the template.
202Each non-empty field must be matched for a message to be selected. 207Each non-empty field must be matched for a message to be selected. To
203To effect a logical \"or\", use \\[mh-search-folder] multiple times. 208effect a logical \"or\", use \\[mh-search-folder] multiple times. When
204When you have finished, type \\[mh-pick-do-search] to do the search. 209you have finished, type \\[mh-pick-do-search] to do the search.
205 210
206The hook `mh-pick-mode-hook' is called upon entry to this mode. 211The hook `mh-pick-mode-hook' is called upon entry to this mode.
207 212
@@ -216,8 +221,10 @@ The hook `mh-pick-mode-hook' is called upon entry to this mode.
216;;;###mh-autoload 221;;;###mh-autoload
217(defun mh-pick-do-search () 222(defun mh-pick-do-search ()
218 "Find messages that match the qualifications in the current pattern buffer. 223 "Find messages that match the qualifications in the current pattern buffer.
219Messages are searched for in the folder named in `mh-searching-folder'. 224
220Add the messages found to the sequence named `search'." 225Messages are searched for in the folder named in
226`mh-searching-folder'. Add the messages found to the sequence
227named `search'."
221 (interactive) 228 (interactive)
222 (let ((pattern-list (mh-pick-parse-search-buffer)) 229 (let ((pattern-list (mh-pick-parse-search-buffer))
223 (folder mh-searching-folder) 230 (folder mh-searching-folder)
@@ -251,9 +258,11 @@ Add the messages found to the sequence named `search'."
251;;;###mh-autoload 258;;;###mh-autoload
252(defun mh-do-search () 259(defun mh-do-search ()
253 "Use the default searching function. 260 "Use the default searching function.
254If \\[mh-search-folder] was used to create the search pattern then pick is used 261
255to search the folder. Otherwise if \\[mh-index-search] was used then the 262If \\[mh-search-folder] was used to create the search pattern
256indexing program specified in `mh-index-program' is used." 263then pick is used to search the folder. Otherwise if
264\\[mh-index-search] was used then the indexing program specified
265in `mh-index-program' is used."
257 (interactive) 266 (interactive)
258 (if (symbolp mh-searching-function) 267 (if (symbolp mh-searching-function)
259 (funcall mh-searching-function) 268 (funcall mh-searching-function)
@@ -261,8 +270,8 @@ indexing program specified in `mh-index-program' is used."
261 270
262(defun mh-seq-from-command (folder seq command) 271(defun mh-seq-from-command (folder seq command)
263 "In FOLDER, make a sequence named SEQ by executing COMMAND. 272 "In FOLDER, make a sequence named SEQ by executing COMMAND.
264COMMAND is a list. The first element is a program name 273COMMAND is a list. The first element is a program name and the
265and the subsequent elements are its arguments, all strings." 274subsequent elements are its arguments, all strings."
266 (let ((msg) 275 (let ((msg)
267 (msgs ()) 276 (msgs ())
268 (case-fold-search t)) 277 (case-fold-search t))
@@ -279,9 +288,9 @@ and the subsequent elements are its arguments, all strings."
279 288
280(defun mh-pick-parse-search-buffer () 289(defun mh-pick-parse-search-buffer ()
281 "Parse the search buffer contents. 290 "Parse the search buffer contents.
282The function returns a alist. The car of each element is either the header name 291The function returns a alist. The car of each element is either
283to search in or nil to search the whole message. The cdr of the element is the 292the header name to search in or nil to search the whole message.
284pattern to search." 293The cdr of the element is the pattern to search."
285 (save-excursion 294 (save-excursion
286 (let ((pattern-list ()) 295 (let ((pattern-list ())
287 (in-body-flag nil) 296 (in-body-flag nil)
diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el
index acca58c494f..a4d53731c72 100644
--- a/lisp/mh-e/mh-print.el
+++ b/lisp/mh-e/mh-print.el
@@ -47,8 +47,8 @@ Valid values are:
47 black-white - Print colors on black/white printer. 47 black-white - Print colors on black/white printer.
48 See also `ps-black-white-faces'. 48 See also `ps-black-white-faces'.
49 49
50Any other value is treated as t. This variable is initialized from 50Any other value is treated as t. This variable is initialized
51`ps-print-color-p'.") 51from `ps-print-color-p'.")
52 52
53(defvar mh-ps-print-func 'ps-spool-buffer-with-faces 53(defvar mh-ps-print-func 'ps-spool-buffer-with-faces
54 "Function to use to spool a buffer. 54 "Function to use to spool a buffer.
@@ -108,20 +108,22 @@ Pass along the PREFIX-ARG to it."
108(defun mh-ps-print-msg (range) 108(defun mh-ps-print-msg (range)
109 "Print RANGE\\<mh-folder-mode-map>. 109 "Print RANGE\\<mh-folder-mode-map>.
110 110
111Check the documentation of `mh-interactive-range' to see how RANGE is read in 111Check the documentation of `mh-interactive-range' to see how RANGE is
112interactive use. 112read in interactive use.
113 113
114This command will print inline text attachments but will not decrypt messages. 114This command will print inline text attachments but will not decrypt
115However, when a message is displayed in an MH-Show buffer, then that buffer is 115messages. However, when a message is displayed in an MH-Show buffer,
116used verbatim for printing with the caveat that only text attachments, if 116then that buffer is used verbatim for printing with the caveat that
117opened inline, are printed. Therefore, encrypted messages can be printed by 117only text attachments, if opened inline, are printed. Therefore,
118showing and decrypting them first. 118encrypted messages can be printed by showing and decrypting them
119 119first.
120MH-E uses the \"ps-print\" package to do the printing, so you can customize 120
121the printing further by going to the `ps-print' customization group. This 121MH-E uses the \"ps-print\" package to do the printing, so you can
122command does not use the options `mh-lpr-command-format' or 122customize the printing further by going to the `ps-print'
123`mh-print-background-flag'. See also the commands \\[mh-ps-print-toggle-color] 123customization group. This command does not use the options
124and \\[mh-ps-print-toggle-faces]." 124`mh-lpr-command-format' or `mh-print-background-flag'. See also the
125commands \\[mh-ps-print-toggle-color] and
126\\[mh-ps-print-toggle-faces]."
125 (interactive (list (mh-interactive-range "Print"))) 127 (interactive (list (mh-interactive-range "Print")))
126 (mh-ps-print-range range nil)) 128 (mh-ps-print-range range nil))
127 129
@@ -129,20 +131,22 @@ and \\[mh-ps-print-toggle-faces]."
129(defun mh-ps-print-msg-file (range file) 131(defun mh-ps-print-msg-file (range file)
130 "Print RANGE to FILE\\<mh-folder-mode-map>. 132 "Print RANGE to FILE\\<mh-folder-mode-map>.
131 133
132Check the documentation of `mh-interactive-range' to see how RANGE is read in 134Check the documentation of `mh-interactive-range' to see how RANGE is
133interactive use. 135read in interactive use.
134 136
135This command will print inline text attachments but will not decrypt messages. 137This command will print inline text attachments but will not decrypt
136However, when a message is displayed in an MH-Show buffer, then that buffer is 138messages. However, when a message is displayed in an MH-Show buffer,
137used verbatim for printing with the caveat that only text attachments, if 139then that buffer is used verbatim for printing with the caveat that
138opened inline, are printed. Therefore, encrypted messages can be printed by 140only text attachments, if opened inline, are printed. Therefore,
139showing and decrypting them first. 141encrypted messages can be printed by showing and decrypting them
140 142first.
141MH-E uses the \"ps-print\" package to do the printing, so you can customize 143
142the printing further by going to the `ps-print' customization group. This 144MH-E uses the \"ps-print\" package to do the printing, so you can
143command does not use the options `mh-lpr-command-format' or 145customize the printing further by going to the `ps-print'
144`mh-print-background-flag'. See also the commands \\[mh-ps-print-toggle-color] 146customization group. This command does not use the options
145and \\[mh-ps-print-toggle-faces]." 147`mh-lpr-command-format' or `mh-print-background-flag'. See also the
148commands \\[mh-ps-print-toggle-color] and
149\\[mh-ps-print-toggle-faces]."
146 (interactive (list (mh-interactive-range "Print") (mh-ps-print-preprint 1))) 150 (interactive (list (mh-interactive-range "Print") (mh-ps-print-preprint 1)))
147 (mh-ps-print-range range file)) 151 (mh-ps-print-range range file))
148 152
@@ -150,8 +154,8 @@ and \\[mh-ps-print-toggle-faces]."
150(defun mh-ps-print-toggle-faces () 154(defun mh-ps-print-toggle-faces ()
151 "Toggle whether printing is done with faces or not. 155 "Toggle whether printing is done with faces or not.
152 156
153When faces are enabled, the printed message will look very similar to the 157When faces are enabled, the printed message will look very
154message in the MH-Show buffer." 158similar to the message in the MH-Show buffer."
155 (interactive) 159 (interactive)
156 (if (eq mh-ps-print-func 'ps-spool-buffer-with-faces) 160 (if (eq mh-ps-print-func 'ps-spool-buffer-with-faces)
157 (progn 161 (progn
@@ -164,13 +168,13 @@ message in the MH-Show buffer."
164(defun mh-ps-print-toggle-color () 168(defun mh-ps-print-toggle-color ()
165 "Toggle whether color is used in printing messages. 169 "Toggle whether color is used in printing messages.
166 170
167Colors are emulated on black-and-white printers with shades of gray. This 171Colors are emulated on black-and-white printers with shades of
168might produce illegible output, even if your screen colors only use shades of 172gray. This might produce illegible output, even if your screen
169gray. If this is the case, try using this command to toggle between color, no 173colors only use shades of gray. If this is the case, try using
170color, and a black and white representation of the colors and see which works 174this command to toggle between color, no color, and a black and
171best. You change this setting permanently by customizing the option 175white representation of the colors and see which works best. You
176change this setting permanently by customizing the option
172`ps-print-color-p'." 177`ps-print-color-p'."
173
174 (interactive) 178 (interactive)
175 (if (eq mh-ps-print-color-option nil) 179 (if (eq mh-ps-print-color-option nil)
176 (progn 180 (progn
@@ -188,11 +192,12 @@ best. You change this setting permanently by customizing the option
188(defun mh-print-msg (range) 192(defun mh-print-msg (range)
189 "Print RANGE the old fashioned way\\<mh-folder-mode-map>. 193 "Print RANGE the old fashioned way\\<mh-folder-mode-map>.
190 194
191The message is formatted with \"mhl\" (see option `mh-mhl-format-file') and 195The message is formatted with \"mhl\" (see option
192printed with the \"lpr\" command (see option `mh-lpr-command-format'). 196`mh-mhl-format-file') and printed with the \"lpr\" command (see
197option `mh-lpr-command-format').
193 198
194Check the documentation of `mh-interactive-range' to see how RANGE is read in 199Check the documentation of `mh-interactive-range' to see how
195interactive use. 200RANGE is read in interactive use.
196 201
197Consider using \\[mh-ps-print-msg] instead." 202Consider using \\[mh-ps-print-msg] instead."
198 (interactive (list (mh-interactive-range "Print"))) 203 (interactive (list (mh-interactive-range "Print")))
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index 4942df58f71..956115da7bb 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -122,16 +122,18 @@
122 "Map of message index to various parts of the scan line.") 122 "Map of message index to various parts of the scan line.")
123(defvar mh-thread-scan-line-map-stack nil 123(defvar mh-thread-scan-line-map-stack nil
124 "Old map of message index to various parts of the scan line. 124 "Old map of message index to various parts of the scan line.
125This is the original map that is stored when the folder is narrowed.") 125This is the original map that is stored when the folder is
126narrowed.")
126(defvar mh-thread-subject-container-hash nil 127(defvar mh-thread-subject-container-hash nil
127 "Hashtable used to group messages by subject.") 128 "Hashtable used to group messages by subject.")
128(defvar mh-thread-duplicates nil 129(defvar mh-thread-duplicates nil
129 "Hashtable used to associate messages with the same message identifier.") 130 "Hashtable used to associate messages with the same message identifier.")
130(defvar mh-thread-history () 131(defvar mh-thread-history ()
131 "Variable to remember the transformations to the thread tree. 132 "Variable to remember the transformations to the thread tree.
132When new messages are added, these transformations are rewound, then the 133When new messages are added, these transformations are rewound,
133links are added from the newly seen messages. Finally the transformations are 134then the links are added from the newly seen messages. Finally
134redone to get the new thread tree. This makes incremental threading easier.") 135the transformations are redone to get the new thread tree. This
136makes incremental threading easier.")
135(defvar mh-thread-body-width nil 137(defvar mh-thread-body-width nil
136 "Width of scan substring that contains subject and body of message.") 138 "Width of scan substring that contains subject and body of message.")
137 139
@@ -150,9 +152,10 @@ redone to get the new thread tree. This makes incremental threading easier.")
150(defun mh-delete-seq (sequence) 152(defun mh-delete-seq (sequence)
151 "Delete SEQUENCE. 153 "Delete SEQUENCE.
152 154
153You are prompted for the sequence to delete. Note that this deletes only the 155You are prompted for the sequence to delete. Note that this
154sequence, not the messages in the sequence. If you want to delete the 156deletes only the sequence, not the messages in the sequence. If
155messages, use \"\\[universal-argument] \\[mh-delete-msg]\"." 157you want to delete the messages, use \"\\[universal-argument]
158\\[mh-delete-msg]\"."
156 (interactive (list (mh-read-seq-default "Delete" t))) 159 (interactive (list (mh-read-seq-default "Delete" t)))
157 (let ((msg-list (mh-seq-to-msgs sequence)) 160 (let ((msg-list (mh-seq-to-msgs sequence))
158 (internal-flag (mh-internal-seq sequence)) 161 (internal-flag (mh-internal-seq sequence))
@@ -216,8 +219,8 @@ The list appears in a buffer named \"*MH-E Sequences*\"."
216;;;###mh-autoload 219;;;###mh-autoload
217(defun mh-msg-is-in-seq (message) 220(defun mh-msg-is-in-seq (message)
218 "Display the sequences in which the current message appears. 221 "Display the sequences in which the current message appears.
219Use a prefix argument to display the sequences in which another MESSAGE 222Use a prefix argument to display the sequences in which another
220appears." 223MESSAGE appears."
221 (interactive "P") 224 (interactive "P")
222 (if (not message) 225 (if (not message)
223 (setq message (mh-get-msg-num t))) 226 (setq message (mh-get-msg-num t)))
@@ -243,11 +246,13 @@ appears."
243(defun mh-narrow-to-seq (sequence) 246(defun mh-narrow-to-seq (sequence)
244 "Restrict display to messages in SEQUENCE. 247 "Restrict display to messages in SEQUENCE.
245 248
246You are prompted for the name of the sequence. What this command does is show 249You are prompted for the name of the sequence. What this command
247only those messages that are in the selected sequence in the MH-Folder buffer. 250does is show only those messages that are in the selected
248In addition, it limits further MH-E searches to just those messages. 251sequence in the MH-Folder buffer. In addition, it limits further
252MH-E searches to just those messages.
249 253
250When you want to widen the view to all your messages again, use \\[mh-widen]." 254When you want to widen the view to all your messages again, use
255\\[mh-widen]."
251 (interactive (list (mh-read-seq "Narrow to" t))) 256 (interactive (list (mh-read-seq "Narrow to" t)))
252 (with-mh-folder-updating (t) 257 (with-mh-folder-updating (t)
253 (cond ((mh-seq-to-msgs sequence) 258 (cond ((mh-seq-to-msgs sequence)
@@ -283,14 +288,17 @@ When you want to widen the view to all your messages again, use \\[mh-widen]."
283(defun mh-put-msg-in-seq (range sequence) 288(defun mh-put-msg-in-seq (range sequence)
284 "Add RANGE to SEQUENCE\\<mh-folder-mode-map>. 289 "Add RANGE to SEQUENCE\\<mh-folder-mode-map>.
285 290
286To place a message in a sequence, use this command to do it manually, or use 291To place a message in a sequence, use this command to do it
287the MH command \"pick\" or the MH-E version of \"pick\", \\[mh-search-folder], 292manually, or use the MH command \"pick\" or the MH-E version of
288which create a sequence automatically. 293\"pick\", \\[mh-search-folder], which create a sequence
289 294automatically.
290Give this command a RANGE and you can add all the messages in a sequence to 295
291another sequence (for example, \"\\[universal-argument] \\[mh-put-msg-in-seq] 296Give this command a RANGE and you can add all the messages in a
292SourceSequence RET DestSequence RET\"). Check the documentation of 297sequence to another sequence (for example,
293`mh-interactive-range' to see how RANGE is read in interactive use." 298\"\\[universal-argument] \\[mh-put-msg-in-seq] SourceSequence RET
299DestSequence RET\"). Check the documentation of
300`mh-interactive-range' to see how RANGE is read in interactive
301use."
294 (interactive (list (mh-interactive-range "Add messages from") 302 (interactive (list (mh-interactive-range "Add messages from")
295 (mh-read-seq-default "Add to" nil))) 303 (mh-read-seq-default "Add to" nil)))
296 (unless (mh-valid-seq-p sequence) 304 (unless (mh-valid-seq-p sequence)
@@ -321,7 +329,8 @@ OP is one of 'widen and 'unthread."
321;;;###mh-autoload 329;;;###mh-autoload
322(defun mh-widen (&optional all-flag) 330(defun mh-widen (&optional all-flag)
323 "Remove last restriction. 331 "Remove last restriction.
324If optional prefix argument ALL-FLAG is non-nil, remove all limits." 332If optional prefix argument ALL-FLAG is non-nil, remove all
333limits."
325 (interactive "P") 334 (interactive "P")
326 (let ((msg (mh-get-msg-num nil))) 335 (let ((msg (mh-get-msg-num nil)))
327 (when mh-folder-view-stack 336 (when mh-folder-view-stack
@@ -368,8 +377,8 @@ If optional prefix argument ALL-FLAG is non-nil, remove all limits."
368;;;###mh-autoload 377;;;###mh-autoload
369(defun mh-notate-deleted-and-refiled () 378(defun mh-notate-deleted-and-refiled ()
370 "Notate messages marked for deletion or refiling. 379 "Notate messages marked for deletion or refiling.
371Messages to be deleted are given by `mh-delete-list' while messages to be 380Messages to be deleted are given by `mh-delete-list' while
372refiled are present in `mh-refile-list'." 381messages to be refiled are present in `mh-refile-list'."
373 (let ((refiled-hash (make-hash-table)) 382 (let ((refiled-hash (make-hash-table))
374 (deleted-hash (make-hash-table))) 383 (deleted-hash (make-hash-table)))
375 (dolist (msg mh-delete-list) 384 (dolist (msg mh-delete-list)
@@ -395,17 +404,18 @@ refiled are present in `mh-refile-list'."
395;;;###mh-autoload 404;;;###mh-autoload
396(defun mh-read-seq-default (prompt not-empty) 405(defun mh-read-seq-default (prompt not-empty)
397 "Read and return sequence name with default narrowed or previous sequence. 406 "Read and return sequence name with default narrowed or previous sequence.
398PROMPT is the prompt to use when reading. If NOT-EMPTY is non-nil then a 407PROMPT is the prompt to use when reading. If NOT-EMPTY is non-nil
399non-empty sequence is read." 408then a non-empty sequence is read."
400 (mh-read-seq prompt not-empty 409 (mh-read-seq prompt not-empty
401 (or mh-last-seq-used 410 (or mh-last-seq-used
402 (car (mh-seq-containing-msg (mh-get-msg-num nil) nil))))) 411 (car (mh-seq-containing-msg (mh-get-msg-num nil) nil)))))
403 412
404(defun mh-read-seq (prompt not-empty &optional default) 413(defun mh-read-seq (prompt not-empty &optional default)
405 "Read and return a sequence name. 414 "Read and return a sequence name.
406Prompt with PROMPT, raise an error if the sequence is empty and the NOT-EMPTY 415Prompt with PROMPT, raise an error if the sequence is empty and
407flag is non-nil, and supply an optional DEFAULT sequence. A reply of '%' 416the NOT-EMPTY flag is non-nil, and supply an optional DEFAULT
408defaults to the first sequence containing the current message." 417sequence. A reply of '%' defaults to the first sequence
418containing the current message."
409 (let* ((input (completing-read (format "%s %s %s" prompt "sequence:" 419 (let* ((input (completing-read (format "%s %s %s" prompt "sequence:"
410 (if default 420 (if default
411 (format "[%s] " default) 421 (format "[%s] " default)
@@ -459,35 +469,40 @@ completion is over."
459 expand-flag ask-flag number-as-range-flag) 469 expand-flag ask-flag number-as-range-flag)
460 "Read a message range with PROMPT. 470 "Read a message range with PROMPT.
461 471
462If FOLDER is non-nil then a range is read from that folder, otherwise use 472If FOLDER is non-nil then a range is read from that folder, otherwise
463`mh-current-folder'. 473use `mh-current-folder'.
464 474
465If DEFAULT is a string then use that as default range to return. If DEFAULT is 475If DEFAULT is a string then use that as default range to return. If
466nil then ask user with default answer a range based on the sequences that seem 476DEFAULT is nil then ask user with default answer a range based on the
467relevant. Finally if DEFAULT is t, try to avoid prompting the user. Unseen 477sequences that seem relevant. Finally if DEFAULT is t, try to avoid
468messages, if present, are returned. If the folder has fewer than 478prompting the user. Unseen messages, if present, are returned. If the
469`mh-large-folder' messages then \"all\" messages are returned. Finally as a 479folder has fewer than `mh-large-folder' messages then \"all\" messages
470last resort prompt the user. 480are returned. Finally as a last resort prompt the user.
471 481
472If EXPAND-FLAG is non-nil then a list of message numbers corresponding to the 482If EXPAND-FLAG is non-nil then a list of message numbers corresponding
473input is returned. If this list is empty then an error is raised. If 483to the input is returned. If this list is empty then an error is
474EXPAND-FLAG is nil just return the input string. In this case we don't check 484raised. If EXPAND-FLAG is nil just return the input string. In this
475if the range is empty. 485case we don't check if the range is empty.
476 486
477If ASK-FLAG is non-nil, then the user is always queried for a range of 487If ASK-FLAG is non-nil, then the user is always queried for a range of
478messages. If ASK-FLAG is nil, then the function checks if the unseen sequence 488messages. If ASK-FLAG is nil, then the function checks if the unseen
479is non-empty. If that is the case, `mh-unseen-seq', or the list of messages in 489sequence is non-empty. If that is the case, `mh-unseen-seq', or the
480it depending on the value of EXPAND, is returned. Otherwise if the folder has 490list of messages in it depending on the value of EXPAND, is returned.
481fewer than `mh-large-folder' messages then the list of messages corresponding 491Otherwise if the folder has fewer than `mh-large-folder' messages then
482to \"all\" is returned. If neither of the above holds then as a last resort 492the list of messages corresponding to \"all\" is returned. If neither
483the user is queried for a range of messages. 493of the above holds then as a last resort the user is queried for a
494range of messages.
484 495
485If NUMBER-AS-RANGE-FLAG is non-nil, then if a number, N is read as input, it 496If NUMBER-AS-RANGE-FLAG is non-nil, then if a number, N is read as
486is interpreted as the range \"last:N\". 497input, it is interpreted as the range \"last:N\".
498
499This function replaces the existing function `mh-read-msg-range'.
500Calls to:
487 501
488This function replaces the existing function `mh-read-msg-range'. Calls to:
489 (mh-read-msg-range folder flag) 502 (mh-read-msg-range folder flag)
503
490should be replaced with: 504should be replaced with:
505
491 (mh-read-range \"Suitable prompt\" folder t nil flag 506 (mh-read-range \"Suitable prompt\" folder t nil flag
492 mh-interpret-number-as-range-flag)" 507 mh-interpret-number-as-range-flag)"
493 (setq default (or default mh-last-seq-used 508 (setq default (or default mh-last-seq-used
@@ -565,8 +580,9 @@ should be replaced with:
565;;;###mh-autoload 580;;;###mh-autoload
566(defun mh-notate-cur () 581(defun mh-notate-cur ()
567 "Mark the MH sequence cur. 582 "Mark the MH sequence cur.
568In addition to notating the current message with `mh-note-cur' the function 583In addition to notating the current message with `mh-note-cur'
569uses `overlay-arrow-position' to put a marker in the fringe." 584the function uses `overlay-arrow-position' to put a marker in the
585fringe."
570 (let ((cur (car (mh-seq-to-msgs 'cur)))) 586 (let ((cur (car (mh-seq-to-msgs 'cur))))
571 (when (and cur (mh-goto-msg cur t t)) 587 (when (and cur (mh-goto-msg cur t t))
572 (beginning-of-line) 588 (beginning-of-line)
@@ -617,8 +633,9 @@ uses `overlay-arrow-position' to put a marker in the fringe."
617;;;###mh-autoload 633;;;###mh-autoload
618(defmacro mh-iterate-on-messages-in-region (var begin end &rest body) 634(defmacro mh-iterate-on-messages-in-region (var begin end &rest body)
619 "Iterate over region. 635 "Iterate over region.
620VAR is bound to the message on the current line as we loop starting from BEGIN 636
621till END. In each step BODY is executed. 637VAR is bound to the message on the current line as we loop
638starting from BEGIN till END. In each step BODY is executed.
622 639
623If VAR is nil then the loop is executed without any binding." 640If VAR is nil then the loop is executed without any binding."
624 (unless (symbolp var) 641 (unless (symbolp var)
@@ -639,13 +656,14 @@ If VAR is nil then the loop is executed without any binding."
639(defmacro mh-iterate-on-range (var range &rest body) 656(defmacro mh-iterate-on-range (var range &rest body)
640 "Iterate an operation over a region or sequence. 657 "Iterate an operation over a region or sequence.
641 658
642VAR is bound to each message in turn in a loop over RANGE, which can be a 659VAR is bound to each message in turn in a loop over RANGE, which
643message number, a list of message numbers, a sequence, a region in a cons 660can be a message number, a list of message numbers, a sequence, a
644cell, or a MH range (something like last:20) in a string. In each iteration, 661region in a cons cell, or a MH range (something like last:20) in
645BODY is executed. 662a string. In each iteration, BODY is executed.
646 663
647The parameter RANGE is usually created with `mh-interactive-range' 664The parameter RANGE is usually created with
648in order to provide a uniform interface to MH-E functions." 665`mh-interactive-range' in order to provide a uniform interface to
666MH-E functions."
649 (unless (symbolp var) 667 (unless (symbolp var)
650 (error "Can not bind the non-symbol %s" var)) 668 (error "Can not bind the non-symbol %s" var))
651 (let ((binding-needed-flag var) 669 (let ((binding-needed-flag var)
@@ -680,8 +698,8 @@ in order to provide a uniform interface to MH-E functions."
680(defun mh-range-to-msg-list (range) 698(defun mh-range-to-msg-list (range)
681 "Return a list of messages for RANGE. 699 "Return a list of messages for RANGE.
682 700
683Check the documentation of `mh-interactive-range' to see how RANGE is read in 701Check the documentation of `mh-interactive-range' to see how
684interactive use." 702RANGE is read in interactive use."
685 (let (msg-list) 703 (let (msg-list)
686 (mh-iterate-on-range msg range 704 (mh-iterate-on-range msg range
687 (push msg msg-list)) 705 (push msg msg-list))
@@ -692,21 +710,21 @@ interactive use."
692 "Return interactive specification for message, sequence, range or region. 710 "Return interactive specification for message, sequence, range or region.
693By convention, the name of this argument is RANGE. 711By convention, the name of this argument is RANGE.
694 712
695If variable `transient-mark-mode' is non-nil and the mark is active, then this 713If variable `transient-mark-mode' is non-nil and the mark is active,
696function returns a cons-cell of the region. 714then this function returns a cons-cell of the region.
697 715
698If optional prefix argument is provided, then prompt for message range with 716If optional prefix argument is provided, then prompt for message range
699RANGE-PROMPT. A list of messages in that range is returned. 717with RANGE-PROMPT. A list of messages in that range is returned.
700 718
701If a MH range is given, say something like last:20, then a list containing 719If a MH range is given, say something like last:20, then a list
702the messages in that range is returned. 720containing the messages in that range is returned.
703 721
704If DEFAULT non-nil then it is returned. 722If DEFAULT non-nil then it is returned.
705 723
706Otherwise, the message number at point is returned. 724Otherwise, the message number at point is returned.
707 725
708This function is usually used with `mh-iterate-on-range' in order to provide 726This function is usually used with `mh-iterate-on-range' in order to
709a uniform interface to MH-E functions." 727provide a uniform interface to MH-E functions."
710 (cond ((mh-mark-active-p t) (cons (region-beginning) (region-end))) 728 (cond ((mh-mark-active-p t) (cons (region-beginning) (region-end)))
711 (current-prefix-arg (mh-read-range range-prompt nil nil t t)) 729 (current-prefix-arg (mh-read-range range-prompt nil nil t t))
712 (default default) 730 (default default)
@@ -720,13 +738,17 @@ a uniform interface to MH-E functions."
720;; 41 for the max size of the subject part. Avoiding this would be desirable. 738;; 41 for the max size of the subject part. Avoiding this would be desirable.
721(defun mh-subject-to-sequence (all) 739(defun mh-subject-to-sequence (all)
722 "Put all following messages with same subject in sequence 'subject. 740 "Put all following messages with same subject in sequence 'subject.
723If arg ALL is t, move to beginning of folder buffer to collect all messages. 741If arg ALL is t, move to beginning of folder buffer to collect all
742messages.
724If arg ALL is nil, collect only messages fron current one on forward. 743If arg ALL is nil, collect only messages fron current one on forward.
725 744
726Return number of messages put in the sequence: 745Return number of messages put in the sequence:
727 746
728 nil -> there was no subject line. 747 nil -> there was no subject line.
729 0 -> there were no later messages with the same subject (sequence not made) 748
749 0 -> there were no later messages with the same
750 subject (sequence not made)
751
730 >1 -> the total number of messages including current one." 752 >1 -> the total number of messages including current one."
731 (if (memq 'unthread mh-view-ops) 753 (if (memq 'unthread mh-view-ops)
732 (mh-subject-to-sequence-threaded all) 754 (mh-subject-to-sequence-threaded all)
@@ -734,14 +756,17 @@ Return number of messages put in the sequence:
734 756
735(defun mh-subject-to-sequence-unthreaded (all) 757(defun mh-subject-to-sequence-unthreaded (all)
736 "Put all following messages with same subject in sequence 'subject. 758 "Put all following messages with same subject in sequence 'subject.
737This function only works with an unthreaded folder. If arg ALL is t, move to 759
738beginning of folder buffer to collect all messages. If arg ALL is nil, collect 760This function only works with an unthreaded folder. If arg ALL is
739only messages fron current one on forward. 761t, move to beginning of folder buffer to collect all messages. If
762arg ALL is nil, collect only messages fron current one on
763forward.
740 764
741Return number of messages put in the sequence: 765Return number of messages put in the sequence:
742 766
743 nil -> there was no subject line. 767 nil -> there was no subject line.
744 0 -> there were no later messages with the same subject (sequence not made) 768 0 -> there were no later messages with the same
769 subject (sequence not made)
745 >1 -> the total number of messages including current one." 770 >1 -> the total number of messages including current one."
746 (if (not (eq major-mode 'mh-folder-mode)) 771 (if (not (eq major-mode 'mh-folder-mode))
747 (error "Not in a folder buffer")) 772 (error "Not in a folder buffer"))
@@ -782,12 +807,14 @@ Return number of messages put in the sequence:
782 807
783(defun mh-subject-to-sequence-threaded (all) 808(defun mh-subject-to-sequence-threaded (all)
784 "Put all messages with the same subject in the 'subject sequence. 809 "Put all messages with the same subject in the 'subject sequence.
785This function works when the folder is threaded. In this situation the subject
786could get truncated and so the normal matching doesn't work.
787 810
788The parameter ALL is non-nil then all the messages in the buffer are 811This function works when the folder is threaded. In this
789considered, otherwise only the messages after the current one are taken into 812situation the subject could get truncated and so the normal
790account." 813matching doesn't work.
814
815The parameter ALL is non-nil then all the messages in the buffer
816are considered, otherwise only the messages after the current one
817are taken into account."
791 (let* ((cur (mh-get-msg-num nil)) 818 (let* ((cur (mh-get-msg-num nil))
792 (subject (mh-thread-find-msg-subject cur)) 819 (subject (mh-thread-find-msg-subject cur))
793 region msgs) 820 region msgs)
@@ -824,9 +851,9 @@ If no prefix arg is given, then return DEFAULT."
824 851
825(defun mh-pick-args-list (s) 852(defun mh-pick-args-list (s)
826 "Form list by grouping elements in string S suitable for pick arguments. 853 "Form list by grouping elements in string S suitable for pick arguments.
827For example, the string \"-subject a b c -from Joe User <user@domain.com>\" 854For example, the string \"-subject a b c -from Joe User
828is converted to (\"-subject\" \"a b c\" \"-from\" 855<user@domain.com>\" is converted to (\"-subject\" \"a b c\"
829\"Joe User <user@domain.com>\"" 856\"-from\" \"Joe User <user@domain.com>\""
830 (let ((full-list (split-string s)) 857 (let ((full-list (split-string s))
831 current-arg collection arg-list) 858 current-arg collection arg-list)
832 (while full-list 859 (while full-list
@@ -935,8 +962,8 @@ The MH command pick is used to do the match."
935(defun mh-narrow-to-range (range) 962(defun mh-narrow-to-range (range)
936 "Limit to RANGE. 963 "Limit to RANGE.
937 964
938Check the documentation of `mh-interactive-range' to see how RANGE is read in 965Check the documentation of `mh-interactive-range' to see how
939interactive use. 966RANGE is read in interactive use.
940 967
941Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." 968Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
942 (interactive (list (mh-interactive-range "Narrow to"))) 969 (interactive (list (mh-interactive-range "Narrow to")))
@@ -949,10 +976,11 @@ Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
949(defun mh-delete-subject () 976(defun mh-delete-subject ()
950 "Delete messages with same subject\\<mh-folder-mode-map>. 977 "Delete messages with same subject\\<mh-folder-mode-map>.
951 978
952To delete messages faster, you can use this command to delete all the messages 979To delete messages faster, you can use this command to delete all
953with the same subject as the current message. This command puts these messages 980the messages with the same subject as the current message. This
954in a sequence named \"subject\". You can undo this action by using \\[mh-undo] 981command puts these messages in a sequence named \"subject\". You
955with a prefix argument and then specifying the \"subject\" sequence." 982can undo this action by using \\[mh-undo] with a prefix argument
983and then specifying the \"subject\" sequence."
956 (interactive) 984 (interactive)
957 (let ((count (mh-subject-to-sequence nil))) 985 (let ((count (mh-subject-to-sequence nil)))
958 (cond 986 (cond
@@ -969,13 +997,14 @@ with a prefix argument and then specifying the \"subject\" sequence."
969(defun mh-delete-subject-or-thread () 997(defun mh-delete-subject-or-thread ()
970 "Delete messages with same subject or thread\\<mh-folder-mode-map>. 998 "Delete messages with same subject or thread\\<mh-folder-mode-map>.
971 999
972To delete messages faster, you can use this command to delete all the messages 1000To delete messages faster, you can use this command to delete all
973with the same subject as the current message. This command puts these messages 1001the messages with the same subject as the current message. This
974in a sequence named \"subject\". You can undo this action by using \\[mh-undo] 1002command puts these messages in a sequence named \"subject\". You
975with a prefix argument and then specifying the \"subject\" sequence. 1003can undo this action by using \\[mh-undo] with a prefix argument
1004and then specifying the \"subject\" sequence.
976 1005
977However, if the buffer is displaying a threaded view of the folder then this 1006However, if the buffer is displaying a threaded view of the
978command behaves like \\[mh-thread-delete]." 1007folder then this command behaves like \\[mh-thread-delete]."
979 (interactive) 1008 (interactive)
980 (if (memq 'unthread mh-view-ops) 1009 (if (memq 'unthread mh-view-ops)
981 (mh-thread-delete) 1010 (mh-thread-delete)
@@ -1005,8 +1034,8 @@ TEST is the test to use when creating a new hash table."
1005 1034
1006(defsubst mh-thread-id-container (id) 1035(defsubst mh-thread-id-container (id)
1007 "Given ID, return the corresponding container in `mh-thread-id-table'. 1036 "Given ID, return the corresponding container in `mh-thread-id-table'.
1008If no container exists then a suitable container is created and the id-table 1037If no container exists then a suitable container is created and
1009is updated." 1038the id-table is updated."
1010 (when (not id) 1039 (when (not id)
1011 (error "1")) 1040 (error "1"))
1012 (or (gethash id mh-thread-id-table) 1041 (or (gethash id mh-thread-id-table)
@@ -1027,9 +1056,9 @@ is updated."
1027 1056
1028(defsubst mh-thread-add-link (parent child &optional at-end-p) 1057(defsubst mh-thread-add-link (parent child &optional at-end-p)
1029 "Add links so that PARENT becomes a parent of CHILD. 1058 "Add links so that PARENT becomes a parent of CHILD.
1030Doesn't make any changes if CHILD is already an ancestor of PARENT. If 1059Doesn't make any changes if CHILD is already an ancestor of
1031optional argument AT-END-P is non-nil, the CHILD is added to the end of the 1060PARENT. If optional argument AT-END-P is non-nil, the CHILD is
1032children list of PARENT." 1061added to the end of the children list of PARENT."
1033 (let ((parent-container (cond ((null parent) nil) 1062 (let ((parent-container (cond ((null parent) nil)
1034 ((mh-thread-container-p parent) parent) 1063 ((mh-thread-container-p parent) parent)
1035 (t (mh-thread-id-container parent)))) 1064 (t (mh-thread-id-container parent))))
@@ -1053,8 +1082,8 @@ children list of PARENT."
1053 1082
1054(defun mh-thread-ancestor-p (ancestor successor) 1083(defun mh-thread-ancestor-p (ancestor successor)
1055 "Return t if ANCESTOR is really an ancestor of SUCCESSOR and nil otherwise. 1084 "Return t if ANCESTOR is really an ancestor of SUCCESSOR and nil otherwise.
1056In the limit, the function returns t if ANCESTOR and SUCCESSOR are the same 1085In the limit, the function returns t if ANCESTOR and SUCCESSOR
1057containers." 1086are the same containers."
1058 (block nil 1087 (block nil
1059 (while successor 1088 (while successor
1060 (when (eq ancestor successor) (return t)) 1089 (when (eq ancestor successor) (return t))
@@ -1063,7 +1092,8 @@ containers."
1063 1092
1064(defsubst mh-thread-get-message-container (message) 1093(defsubst mh-thread-get-message-container (message)
1065 "Return container which has MESSAGE in it. 1094 "Return container which has MESSAGE in it.
1066If there is no container present then a new container is allocated." 1095If there is no container present then a new container is
1096allocated."
1067 (let* ((id (mh-message-id message)) 1097 (let* ((id (mh-message-id message))
1068 (container (gethash id mh-thread-id-table))) 1098 (container (gethash id mh-thread-id-table)))
1069 (cond (container (setf (mh-container-message container) message) 1099 (cond (container (setf (mh-container-message container) message)
@@ -1073,8 +1103,8 @@ If there is no container present then a new container is allocated."
1073 1103
1074(defsubst mh-thread-get-message (id subject-re-p subject refs) 1104(defsubst mh-thread-get-message (id subject-re-p subject refs)
1075 "Return appropriate message. 1105 "Return appropriate message.
1076Otherwise update message already present to have the proper ID, SUBJECT-RE-P, 1106Otherwise update message already present to have the proper ID,
1077SUBJECT and REFS fields." 1107SUBJECT-RE-P, SUBJECT and REFS fields."
1078 (let* ((container (gethash id mh-thread-id-table)) 1108 (let* ((container (gethash id mh-thread-id-table))
1079 (message (if container (mh-container-message container) nil))) 1109 (message (if container (mh-container-message container) nil)))
1080 (cond (message 1110 (cond (message
@@ -1103,9 +1133,10 @@ This allows cheap string comparison with EQ."
1103 1133
1104(defsubst mh-thread-prune-subject (subject) 1134(defsubst mh-thread-prune-subject (subject)
1105 "Prune leading Re:'s, Fwd:'s etc. and trailing (fwd)'s from SUBJECT. 1135 "Prune leading Re:'s, Fwd:'s etc. and trailing (fwd)'s from SUBJECT.
1106If the result after pruning is not the empty string then it is canonicalized 1136If the result after pruning is not the empty string then it is
1107so that subjects can be tested for equality with eq. This is done so that all 1137canonicalized so that subjects can be tested for equality with
1108the messages without a subject are not put into a single thread." 1138eq. This is done so that all the messages without a subject are
1139not put into a single thread."
1109 (let ((case-fold-search t) 1140 (let ((case-fold-search t)
1110 (subject-pruned-flag nil)) 1141 (subject-pruned-flag nil))
1111 ;; Prune subject leader 1142 ;; Prune subject leader
@@ -1128,7 +1159,8 @@ the messages without a subject are not put into a single thread."
1128 1159
1129(defun mh-thread-container-subject (container) 1160(defun mh-thread-container-subject (container)
1130 "Return the subject of CONTAINER. 1161 "Return the subject of CONTAINER.
1131If CONTAINER is empty return the subject info of one of its children." 1162If CONTAINER is empty return the subject info of one of its
1163children."
1132 (cond ((and (mh-container-message container) 1164 (cond ((and (mh-container-message container)
1133 (mh-message-id (mh-container-message container))) 1165 (mh-message-id (mh-container-message container)))
1134 (mh-message-subject (mh-container-message container))) 1166 (mh-message-subject (mh-container-message container)))
@@ -1233,8 +1265,8 @@ If CONTAINER is empty return the subject info of one of its children."
1233 1265
1234(defsubst mh-thread-group-by-subject (roots) 1266(defsubst mh-thread-group-by-subject (roots)
1235 "Group the set of message containers, ROOTS based on subject. 1267 "Group the set of message containers, ROOTS based on subject.
1236Bug: Check for and make sure that something without Re: is made the parent in 1268Bug: Check for and make sure that something without Re: is made
1237preference to something that has it." 1269the parent in preference to something that has it."
1238 (clrhash mh-thread-subject-container-hash) 1270 (clrhash mh-thread-subject-container-hash)
1239 (let ((results ())) 1271 (let ((results ()))
1240 (dolist (root roots) 1272 (dolist (root roots)
@@ -1251,9 +1283,9 @@ preference to something that has it."
1251 1283
1252(defun mh-thread-process-in-reply-to (reply-to-header) 1284(defun mh-thread-process-in-reply-to (reply-to-header)
1253 "Extract message id's from REPLY-TO-HEADER. 1285 "Extract message id's from REPLY-TO-HEADER.
1254Ideally this should have some regexp which will try to guess if a string 1286Ideally this should have some regexp which will try to guess if a
1255between < and > is a message id and not an email address. For now it will 1287string between < and > is a message id and not an email address.
1256take the last string inside angles." 1288For now it will take the last string inside angles."
1257 (let ((end (mh-search-from-end ?> reply-to-header))) 1289 (let ((end (mh-search-from-end ?> reply-to-header)))
1258 (when (numberp end) 1290 (when (numberp end)
1259 (let ((begin (mh-search-from-end ?< (substring reply-to-header 0 end)))) 1291 (let ((begin (mh-search-from-end ?< (substring reply-to-header 0 end))))
@@ -1279,9 +1311,9 @@ take the last string inside angles."
1279 1311
1280(defsubst mh-thread-update-id-index-maps (id index) 1312(defsubst mh-thread-update-id-index-maps (id index)
1281 "Message with id, ID is the message in INDEX. 1313 "Message with id, ID is the message in INDEX.
1282The function also checks for duplicate messages (that is multiple messages 1314The function also checks for duplicate messages (that is multiple
1283with the same ID). These messages are put in the `mh-thread-duplicates' hash 1315messages with the same ID). These messages are put in the
1284table." 1316`mh-thread-duplicates' hash table."
1285 (let ((old-index (gethash id mh-thread-id-index-map))) 1317 (let ((old-index (gethash id mh-thread-id-index-map)))
1286 (when old-index (push old-index (gethash id mh-thread-duplicates))) 1318 (when old-index (push old-index (gethash id mh-thread-duplicates)))
1287 (setf (gethash id mh-thread-id-index-map) index) 1319 (setf (gethash id mh-thread-id-index-map) index)
@@ -1383,9 +1415,9 @@ All messages after START-POINT are added to the thread tree."
1383 1415
1384(defun mh-thread-generate-scan-lines (tree level) 1416(defun mh-thread-generate-scan-lines (tree level)
1385 "Generate scan lines. 1417 "Generate scan lines.
1386TREE is the hierarchical tree of messages, SCAN-LINE-MAP maps message indices 1418TREE is the hierarchical tree of messages, SCAN-LINE-MAP maps
1387to the corresponding scan lines and LEVEL used to determine indentation of 1419message indices to the corresponding scan lines and LEVEL used to
1388the message." 1420determine indentation of the message."
1389 (cond ((null tree) nil) 1421 (cond ((null tree) nil)
1390 ((mh-thread-container-p tree) 1422 ((mh-thread-container-p tree)
1391 (let* ((message (mh-container-message tree)) 1423 (let* ((message (mh-container-message tree))
@@ -1436,8 +1468,9 @@ the message."
1436;; the scan which generates the threading info. For now this will have to do. 1468;; the scan which generates the threading info. For now this will have to do.
1437(defun mh-thread-parse-scan-line (&optional string) 1469(defun mh-thread-parse-scan-line (&optional string)
1438 "Parse a scan line. 1470 "Parse a scan line.
1439If optional argument STRING is given then that is assumed to be the scan line. 1471If optional argument STRING is given then that is assumed to be
1440Otherwise uses the line at point as the scan line to parse." 1472the scan line. Otherwise uses the line at point as the scan line
1473to parse."
1441 (let* ((string (or string 1474 (let* ((string (or string
1442 (buffer-substring-no-properties (line-beginning-position) 1475 (buffer-substring-no-properties (line-beginning-position)
1443 (line-end-position)))) 1476 (line-end-position))))
@@ -1583,7 +1616,8 @@ MSG is the message being notated with NOTATION at OFFSET."
1583(defun mh-thread-next-sibling (&optional previous-flag) 1616(defun mh-thread-next-sibling (&optional previous-flag)
1584 "Display next sibling. 1617 "Display next sibling.
1585 1618
1586With non-nil optional argument PREVIOUS-FLAG jump to the previous sibling." 1619With non-nil optional argument PREVIOUS-FLAG jump to the previous
1620sibling."
1587 (interactive) 1621 (interactive)
1588 (cond ((not (memq 'unthread mh-view-ops)) 1622 (cond ((not (memq 'unthread mh-view-ops))
1589 (error "Folder isn't threaded")) 1623 (error "Folder isn't threaded"))
@@ -1632,9 +1666,10 @@ With non-nil optional argument PREVIOUS-FLAG jump to the previous sibling."
1632(defun mh-thread-ancestor (&optional thread-root-flag) 1666(defun mh-thread-ancestor (&optional thread-root-flag)
1633 "Display ancestor of current message. 1667 "Display ancestor of current message.
1634 1668
1635If you do not care for the way a particular thread has turned, you can move up 1669If you do not care for the way a particular thread has turned,
1636the chain of messages with this command. This command can also take a prefix 1670you can move up the chain of messages with this command. This
1637argument THREAD-ROOT-FLAG to jump to the message that started everything." 1671command can also take a prefix argument THREAD-ROOT-FLAG to jump
1672to the message that started everything."
1638 (interactive "P") 1673 (interactive "P")
1639 (beginning-of-line) 1674 (beginning-of-line)
1640 (cond ((not (memq 'unthread mh-view-ops)) 1675 (cond ((not (memq 'unthread mh-view-ops))
@@ -1652,8 +1687,9 @@ argument THREAD-ROOT-FLAG to jump to the message that started everything."
1652 1687
1653(defun mh-thread-find-children () 1688(defun mh-thread-find-children ()
1654 "Return a region containing the current message and its children. 1689 "Return a region containing the current message and its children.
1655The result is returned as a list of two elements. The first is the point at the 1690The result is returned as a list of two elements. The first is
1656start of the region and the second is the point at the end." 1691the point at the start of the region and the second is the point
1692at the end."
1657 (beginning-of-line) 1693 (beginning-of-line)
1658 (if (eobp) 1694 (if (eobp)
1659 nil 1695 nil
@@ -1744,10 +1780,11 @@ interactive use."
1744(defun mh-narrow-to-tick () 1780(defun mh-narrow-to-tick ()
1745 "Limit to ticked messages. 1781 "Limit to ticked messages.
1746 1782
1747What this command does is show only those messages that are in the \"tick\" 1783What this command does is show only those messages that are in
1748sequence (which you can customize via the `mh-tick-seq' option) in the 1784the \"tick\" sequence (which you can customize via the
1749MH-Folder buffer. In addition, it limits further MH-E searches to just those 1785`mh-tick-seq' option) in the MH-Folder buffer. In addition, it
1750messages. When you want to widen the view to all your messages again, use 1786limits further MH-E searches to just those messages. When you
1787want to widen the view to all your messages again, use
1751\\[mh-widen]." 1788\\[mh-widen]."
1752 (interactive) 1789 (interactive)
1753 (cond ((not mh-tick-seq) 1790 (cond ((not mh-tick-seq)
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index 64aa84fa8d8..5c7f5cda3ba 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -62,7 +62,8 @@
62;;;###mh-autoload 62;;;###mh-autoload
63(defun mh-folder-speedbar-buttons (buffer) 63(defun mh-folder-speedbar-buttons (buffer)
64 "Interface function to create MH-E speedbar buffer. 64 "Interface function to create MH-E speedbar buffer.
65BUFFER is the MH-E buffer for which the speedbar buffer is to be created." 65BUFFER is the MH-E buffer for which the speedbar buffer is to be
66created."
66 (unless (get-text-property (point-min) 'mh-level) 67 (unless (get-text-property (point-min) 'mh-level)
67 (erase-buffer) 68 (erase-buffer)
68 (clrhash mh-speed-folder-map) 69 (clrhash mh-speed-folder-map)
@@ -125,11 +126,13 @@ BUFFER is the MH-E buffer for which the speedbar buffer is to be created."
125 126
126(defun mh-speed-update-current-folder (force) 127(defun mh-speed-update-current-folder (force)
127 "Update speedbar highlighting of the current folder. 128 "Update speedbar highlighting of the current folder.
128The function tries to be smart so that work done is minimized. The currently 129The function tries to be smart so that work done is minimized.
129highlighted folder is cached and no highlighting happens unless it changes. 130The currently highlighted folder is cached and no highlighting
131happens unless it changes.
130Also highlighting is suspended while the speedbar frame is selected. 132Also highlighting is suspended while the speedbar frame is selected.
131Otherwise you get the disconcerting behavior of folders popping open on their 133Otherwise you get the disconcerting behavior of folders popping open
132own when you are trying to navigate around in the speedbar buffer. 134on their own when you are trying to navigate around in the speedbar
135buffer.
133 136
134The update is always carried out if FORCE is non-nil." 137The update is always carried out if FORCE is non-nil."
135 (let* ((lastf (selected-frame)) 138 (let* ((lastf (selected-frame))
@@ -237,7 +240,8 @@ The function will expand out parent folders of FOLDER if needed."
237 240
238(defun mh-speed-extract-folder-name (buffer) 241(defun mh-speed-extract-folder-name (buffer)
239 "Given an MH-E BUFFER find the folder that should be highlighted. 242 "Given an MH-E BUFFER find the folder that should be highlighted.
240Do the right thing for the different kinds of buffers that MH-E uses." 243Do the right thing for the different kinds of buffers that MH-E
244uses."
241 (save-excursion 245 (save-excursion
242 (set-buffer buffer) 246 (set-buffer buffer)
243 (cond ((eq major-mode 'mh-folder-mode) 247 (cond ((eq major-mode 'mh-folder-mode)
@@ -353,8 +357,8 @@ The optional ARGS from speedbar are ignored."
353 357
354(defmacro mh-process-kill-without-query (process) 358(defmacro mh-process-kill-without-query (process)
355 "PROCESS can be killed without query on Emacs exit. 359 "PROCESS can be killed without query on Emacs exit.
356Avoid using `process-kill-without-query' if possible since it is now 360Avoid using `process-kill-without-query' if possible since it is
357obsolete." 361now obsolete."
358 (if (fboundp 'set-process-query-on-exit-flag) 362 (if (fboundp 'set-process-query-on-exit-flag)
359 `(set-process-query-on-exit-flag ,process nil) 363 `(set-process-query-on-exit-flag ,process nil)
360 `(process-kill-without-query ,process))) 364 `(process-kill-without-query ,process)))
@@ -364,8 +368,8 @@ obsolete."
364 "Execute flists -recurse and update message counts. 368 "Execute flists -recurse and update message counts.
365If FORCE is non-nil the timer is reset. 369If FORCE is non-nil the timer is reset.
366 370
367Any number of optional FOLDERS can be specified. If specified, flists is run 371Any number of optional FOLDERS can be specified. If specified,
368only for that one folder." 372flists is run only for that one folder."
369 (interactive (list t)) 373 (interactive (list t))
370 (when force 374 (when force
371 (when mh-speed-flists-timer 375 (when mh-speed-flists-timer
@@ -412,8 +416,8 @@ only for that one folder."
412;; Copied from mh-make-folder-list-filter... 416;; Copied from mh-make-folder-list-filter...
413(defun mh-speed-parse-flists-output (process output) 417(defun mh-speed-parse-flists-output (process output)
414 "Parse the incremental results from flists. 418 "Parse the incremental results from flists.
415PROCESS is the flists process and OUTPUT is the results that must be handled 419PROCESS is the flists process and OUTPUT is the results that must
416next." 420be handled next."
417 (let ((prevailing-match-data (match-data)) 421 (let ((prevailing-match-data (match-data))
418 (position 0) 422 (position 0)
419 line-end line folder unseen total) 423 line-end line folder unseen total)
@@ -506,8 +510,9 @@ next."
506(defun mh-speed-refresh () 510(defun mh-speed-refresh ()
507 "Regenerates the list of folders in the speedbar. 511 "Regenerates the list of folders in the speedbar.
508 512
509Run this command if you've added or deleted a folder, or want to update the 513Run this command if you've added or deleted a folder, or want to
510unseen message count before the next automatic update." 514update the unseen message count before the next automatic
515update."
511 (interactive) 516 (interactive)
512 (mh-speed-flists t) 517 (mh-speed-flists t)
513 (mh-speed-invalidate-map "")) 518 (mh-speed-invalidate-map ""))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 65e1f2ac9a1..6834f0d6d4b 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -79,8 +79,8 @@
79 79
80(defun mh-search-from-end (char string) 80(defun mh-search-from-end (char string)
81 "Return the position of last occurrence of CHAR in STRING. 81 "Return the position of last occurrence of CHAR in STRING.
82If CHAR is not present in STRING then return nil. The function is used in lieu 82If CHAR is not present in STRING then return nil. The function is
83of `search' in the CL package." 83used in lieu of `search' in the CL package."
84 (loop for index from (1- (length string)) downto 0 84 (loop for index from (1- (length string)) downto 0
85 when (equal (aref string index) char) return index 85 when (equal (aref string index) char) return index
86 finally return nil)) 86 finally return nil))
@@ -94,59 +94,73 @@ of `search' in the CL package."
94 94
95(defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)" 95(defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)"
96 "This regular expression extracts the message number. 96 "This regular expression extracts the message number.
97It must match from the beginning of the line. Note that the message number 97
98must be placed in a parenthesized expression as in the default of 98It must match from the beginning of the line. Note that the
99\"^ *\\\\([0-9]+\\\\)\".") 99message number must be placed in a parenthesized expression as in
100the default of \"^ *\\\\([0-9]+\\\\)\".")
100 101
101(defvar mh-scan-msg-overflow-regexp "^[?0-9][0-9]" 102(defvar mh-scan-msg-overflow-regexp "^[?0-9][0-9]"
102 "This regular expression matches overflowed message numbers.") 103 "This regular expression matches overflowed message numbers.")
103 104
104(defvar mh-scan-msg-format-regexp "%\\([0-9]*\\)(msg)" 105(defvar mh-scan-msg-format-regexp "%\\([0-9]*\\)(msg)"
105 "This regular expression finds the message number width in a scan format. 106 "This regular expression finds the message number width in a scan format.
106Note that the message number must be placed in a parenthesized expression as 107
107in the default of \"%\\\\([0-9]*\\\\)(msg)\". This variable is only consulted 108Note that the message number must be placed in a parenthesized
108if `mh-scan-format-file' is set to \"Use MH-E scan Format\".") 109expression as in the default of \"%\\\\([0-9]*\\\\)(msg)\". This
110variable is only consulted if `mh-scan-format-file' is set to
111\"Use MH-E scan Format\".")
109 112
110(defvar mh-scan-msg-format-string "%d" 113(defvar mh-scan-msg-format-string "%d"
111 "This is a format string for width of the message number in a scan format. 114 "This is a format string for width of the message number in a scan format.
112Use `0%d' for zero-filled message numbers. This variable is only consulted if 115
113`mh-scan-format-file' is set to \"Use MH-E scan Format\".") 116Use `0%d' for zero-filled message numbers. This variable is only
117consulted if `mh-scan-format-file' is set to \"Use MH-E scan
118Format\".")
114 119
115(defvar mh-scan-msg-search-regexp "^[^0-9]*%d[^0-9]" 120(defvar mh-scan-msg-search-regexp "^[^0-9]*%d[^0-9]"
116 "This regular expression matches a particular message. 121 "This regular expression matches a particular message.
117It is a format string; use `%d' to represent the location of the message 122
118number within the expression as in the default of \"^[^0-9]*%d[^0-9]\".") 123It is a format string; use `%d' to represent the location of the
124message number within the expression as in the default of
125\"^[^0-9]*%d[^0-9]\".")
119 126
120(defvar mh-cmd-note 4 127(defvar mh-cmd-note 4
121 "Column for notations. 128 "Column for notations.
122This variable should be set with the function `mh-set-cmd-note'. This variable 129
123may be updated dynamically if `mh-adaptive-cmd-note-flag' is on. 130This variable should be set with the function `mh-set-cmd-note'.
131This variable may be updated dynamically if
132`mh-adaptive-cmd-note-flag' is on.
124 133
125Note that columns in Emacs start with 0.") 134Note that columns in Emacs start with 0.")
126(make-variable-buffer-local 'mh-cmd-note) 135(make-variable-buffer-local 'mh-cmd-note)
127 136
128(defvar mh-note-seq ?% 137(defvar mh-note-seq ?%
129 "Messages in a user-defined sequence are marked by this character. 138 "Messages in a user-defined sequence are marked by this character.
130Messages in the `search' sequence are marked by this character as well.") 139
140Messages in the `search' sequence are marked by this character as
141well.")
131 142
132 143
133 144
134(defvar mh-show-buffer-mode-line-buffer-id " {show-%s} %d" 145(defvar mh-show-buffer-mode-line-buffer-id " {show-%s} %d"
135 "Format string to produce `mode-line-buffer-identification' for show buffers. 146 "Format string to produce `mode-line-buffer-identification' for show buffers.
136First argument is folder name. Second is message number.") 147
148First argument is folder name. Second is message number.")
137 149
138 150
139 151
140(defvar mh-mail-header-separator "--------" 152(defvar mh-mail-header-separator "--------"
141 "*Line used by MH to separate headers from text in messages being composed. 153 "*Line used by MH to separate headers from text in messages being composed.
142This variable should not be used directly in programs. Programs should use
143`mail-header-separator' instead. `mail-header-separator' is initialized to
144`mh-mail-header-separator' in `mh-letter-mode'; in other contexts, you may
145have to perform this initialization yourself.
146 154
147Do not make this a regular expression as it may be the argument to `insert' 155This variable should not be used directly in programs. Programs
148and it is passed through `regexp-quote' before being used by functions like 156should use `mail-header-separator' instead.
149`re-search-forward'.") 157`mail-header-separator' is initialized to
158`mh-mail-header-separator' in `mh-letter-mode'; in other
159contexts, you may have to perform this initialization yourself.
160
161Do not make this a regular expression as it may be the argument
162to `insert' and it is passed through `regexp-quote' before being
163used by functions like `re-search-forward'.")
150 164
151(defvar mh-signature-separator-regexp "^-- $" 165(defvar mh-signature-separator-regexp "^-- $"
152 "This regular expression matches the signature separator. 166 "This regular expression matches the signature separator.
@@ -154,11 +168,12 @@ See `mh-signature-separator'.")
154 168
155(defvar mh-signature-separator "-- \n" 169(defvar mh-signature-separator "-- \n"
156 "Text of a signature separator. 170 "Text of a signature separator.
157A signature separator is used to separate the body of a message from the 171
158signature. This can be used by user agents such as MH-E to render the 172A signature separator is used to separate the body of a message
159signature differently or to suppress the inclusion of the signature in a 173from the signature. This can be used by user agents such as MH-E
160reply. 174to render the signature differently or to suppress the inclusion
161Use `mh-signature-separator-regexp' when searching for a separator.") 175of the signature in a reply. Use `mh-signature-separator-regexp'
176when searching for a separator.")
162 177
163(defun mh-signature-separator-p () 178(defun mh-signature-separator-p ()
164 "Return non-nil if buffer includes \"^-- $\"." 179 "Return non-nil if buffer includes \"^-- $\"."
@@ -288,8 +303,9 @@ Use `mh-signature-separator-regexp' when searching for a separator.")
288 303
289(defun mh-goto-address-find-address-at-point () 304(defun mh-goto-address-find-address-at-point ()
290 "Find e-mail address around or before point. 305 "Find e-mail address around or before point.
291Then search backwards to beginning of line for the start of an e-mail 306
292address. If no e-mail address found, return nil." 307Then search backwards to beginning of line for the start of an
308e-mail address. If no e-mail address found, return nil."
293 (re-search-backward "[^-_A-z0-9.@]" (line-beginning-position) 'lim) 309 (re-search-backward "[^-_A-z0-9.@]" (line-beginning-position) 'lim)
294 (if (or (looking-at mh-address-mail-regexp) ; already at start 310 (if (or (looking-at mh-address-mail-regexp) ; already at start
295 (and (re-search-forward mh-address-mail-regexp 311 (and (re-search-forward mh-address-mail-regexp
@@ -299,8 +315,10 @@ address. If no e-mail address found, return nil."
299 315
300(defun mh-mail-header-end () 316(defun mh-mail-header-end ()
301 "Substitute for `mail-header-end' that doesn't widen the buffer. 317 "Substitute for `mail-header-end' that doesn't widen the buffer.
302In MH-E we frequently need to find the end of headers in nested messages, where 318
303the buffer has been narrowed. This function works in this situation." 319In MH-E we frequently need to find the end of headers in nested
320messages, where the buffer has been narrowed. This function works
321in this situation."
304 (save-excursion 322 (save-excursion
305 ;; XXX: The following replaces a call to rfc822-goto-eoh. Occasionally, 323 ;; XXX: The following replaces a call to rfc822-goto-eoh. Occasionally,
306 ;; mail headers that MH-E has to read contains lines of the form: 324 ;; mail headers that MH-E has to read contains lines of the form:
@@ -423,10 +441,11 @@ Argument LIMIT limits search."
423(defun mh-show-font-lock-fontify-region (beg end loudly) 441(defun mh-show-font-lock-fontify-region (beg end loudly)
424 "Limit font-lock in `mh-show-mode' to the header. 442 "Limit font-lock in `mh-show-mode' to the header.
425 443
426Used when the option `mh-highlight-citation-style' is set to \"Gnus\", leaving 444Used when the option `mh-highlight-citation-style' is set to
427the body to be dealt with by Gnus highlighting. The region between BEG and END 445\"Gnus\", leaving the body to be dealt with by Gnus highlighting.
428is given over to be fontified and LOUDLY controls if a user sees a message 446The region between BEG and END is given over to be fontified and
429about the fontification operation." 447LOUDLY controls if a user sees a message about the fontification
448operation."
430 (let ((header-end (mh-mail-header-end))) 449 (let ((header-end (mh-mail-header-end)))
431 (cond 450 (cond
432 ((and (< beg header-end)(< end header-end)) 451 ((and (< beg header-end)(< end header-end))
@@ -469,28 +488,27 @@ about the fontification operation."
469 488
470;;; Internal bookkeeping variables: 489;;; Internal bookkeeping variables:
471 490
472;; Cached value of the `Path:' component in the user's MH profile. 491(defvar mh-user-path nil
473;; User's mail folder directory. 492 "Cached value of the \"Path:\" MH profile component.
474(defvar mh-user-path nil) 493User's mail folder directory.")
475 494
476;; An mh-draft-folder of nil means do not use a draft folder. 495(defvar mh-draft-folder nil
477;; Cached value of the `Draft-Folder:' component in the user's MH profile. 496 "Cached value of the \"Draft-Folder:\" MH profile component.
478;; Name of folder containing draft messages. 497Name of folder containing draft messages.
479(defvar mh-draft-folder nil) 498Nil means do not use a draft folder.")
480 499
481;; Cached value of the `Unseen-Sequence:' component in the user's MH profile. 500(defvar mh-unseen-seq nil
482;; Name of the Unseen sequence. 501 "Cached value of the \"Unseen-Sequence:\" MH profile component.
483(defvar mh-unseen-seq nil) 502Name of the Unseen sequence.")
484 503
485;; Cached value of the `Previous-Sequence:' component in the user's MH 504(defvar mh-previous-seq nil
486;; profile. 505 "Cached value of the \"Previous-Sequence:\" MH profile component.
487;; Name of the Previous sequence. 506Name of the Previous sequence.")
488(defvar mh-previous-seq nil)
489 507
490;; Cached value of the `Inbox:' component in the user's MH profile, 508(defvar mh-inbox nil
491;; or "+inbox" if no such component. 509 "Cached value of the \"Inbox:\" MH profile component.
492;; Name of the Inbox folder. 510Set to \"+inbox\" if no such component.
493(defvar mh-inbox nil) 511Name of the Inbox folder.")
494 512
495;; The names of ephemeral buffers have a " *mh-" prefix (so that they are 513;; The names of ephemeral buffers have a " *mh-" prefix (so that they are
496;; hidden and can be programmatically removed in mh-quit), and the variable 514;; hidden and can be programmatically removed in mh-quit), and the variable
@@ -511,33 +529,33 @@ about the fontification operation."
511(defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent 529(defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent
512(defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list 530(defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list
513 531
514;; Number of lines to keep in mh-log-buffer. 532(defvar mh-log-buffer-lines 100
515(defvar mh-log-buffer-lines 100) 533 "Number of lines to keep in `mh-log-buffer'.")
516 534
517;; Window configuration before MH-E command. 535(defvar mh-previous-window-config nil
518(defvar mh-previous-window-config nil) 536 "Window configuration before MH-E command.")
519 537
520;;Non-nil means next SPC or whatever goes to next undeleted message. 538(defvar mh-page-to-next-msg-flag nil
521(defvar mh-page-to-next-msg-flag nil) 539 "Non-nil means next SPC or whatever goes to next undeleted message.")
522 540
523 541
524 542
525;;; Internal variables local to a folder. 543;;; Internal variables local to a folder.
526 544
527;; Name of current folder, a string. 545(defvar mh-current-folder nil
528(defvar mh-current-folder nil) 546 "Name of current folder, a string.")
529 547
530;; Buffer that displays message for this folder. 548(defvar mh-show-buffer nil
531(defvar mh-show-buffer nil) 549 "Buffer that displays message for this folder.")
532 550
533;; Full path of directory for this folder. 551(defvar mh-folder-filename nil
534(defvar mh-folder-filename nil) 552 "Full path of directory for this folder.")
535 553
536;;Number of msgs in buffer. 554(defvar mh-msg-count nil
537(defvar mh-msg-count nil) 555 "Number of msgs in buffer.")
538 556
539;; If non-nil, show the message in a separate window. 557(defvar mh-showing-mode nil
540(defvar mh-showing-mode nil) 558 "If non-nil, show the message in a separate window.")
541 559
542(defvar mh-show-mode-map (make-sparse-keymap) 560(defvar mh-show-mode-map (make-sparse-keymap)
543 "Keymap used by the show buffer.") 561 "Keymap used by the show buffer.")
@@ -594,8 +612,8 @@ If nil, MH-Show buffer contains message processed normally.")
594 "Format is (with-mh-folder-updating (SAVE-MODIFICATION-FLAG) &body BODY). 612 "Format is (with-mh-folder-updating (SAVE-MODIFICATION-FLAG) &body BODY).
595Execute BODY, which can modify the folder buffer without having to 613Execute BODY, which can modify the folder buffer without having to
596worry about file locking or the read-only flag, and return its result. 614worry about file locking or the read-only flag, and return its result.
597If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification 615If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification flag
598flag is unchanged, otherwise it is cleared." 616is unchanged, otherwise it is cleared."
599 (setq save-modification-flag (car save-modification-flag)) ; CL style 617 (setq save-modification-flag (car save-modification-flag)) ; CL style
600 `(prog1 618 `(prog1
601 (let ((mh-folder-updating-mod-flag (buffer-modified-p)) 619 (let ((mh-folder-updating-mod-flag (buffer-modified-p))
@@ -627,8 +645,9 @@ Stronger than `save-excursion', weaker than `save-window-excursion'."
627 645
628(defmacro mh-do-at-event-location (event &rest body) 646(defmacro mh-do-at-event-location (event &rest body)
629 "Switch to the location of EVENT and execute BODY. 647 "Switch to the location of EVENT and execute BODY.
630After BODY has been executed return to original window. The modification flag 648After BODY has been executed return to original window. The
631of the buffer in the event window is preserved." 649modification flag of the buffer in the event window is
650preserved."
632 (let ((event-window (make-symbol "event-window")) 651 (let ((event-window (make-symbol "event-window"))
633 (event-position (make-symbol "event-position")) 652 (event-position (make-symbol "event-position"))
634 (original-window (make-symbol "original-window")) 653 (original-window (make-symbol "original-window"))
@@ -672,9 +691,12 @@ of the buffer in the event window is preserved."
672 691
673(defun mh-recenter (arg) 692(defun mh-recenter (arg)
674 "Like recenter but with three improvements: 693 "Like recenter but with three improvements:
694
675- At the end of the buffer it tries to show fewer empty lines. 695- At the end of the buffer it tries to show fewer empty lines.
696
676- operates only if the current buffer is in the selected window. 697- operates only if the current buffer is in the selected window.
677 (Commands like `save-some-buffers' can make this false.) 698 (Commands like `save-some-buffers' can make this false.)
699
678- nil ARG means recenter as if prefix argument had been given." 700- nil ARG means recenter as if prefix argument had been given."
679 (cond ((not (eq (get-buffer-window (current-buffer)) (selected-window))) 701 (cond ((not (eq (get-buffer-window (current-buffer)) (selected-window)))
680 nil) 702 nil)
@@ -718,8 +740,8 @@ of the buffer in the event window is preserved."
718 740
719(defun mh-get-msg-num (error-if-no-message) 741(defun mh-get-msg-num (error-if-no-message)
720 "Return the message number of the displayed message. 742 "Return the message number of the displayed message.
721If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if the cursor is 743If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if
722not pointing to a message." 744the cursor is not pointing to a message."
723 (save-excursion 745 (save-excursion
724 (beginning-of-line) 746 (beginning-of-line)
725 (cond ((looking-at mh-scan-msg-number-regexp) 747 (cond ((looking-at mh-scan-msg-number-regexp)
@@ -731,7 +753,8 @@ not pointing to a message."
731 753
732(defun mh-folder-name-p (name) 754(defun mh-folder-name-p (name)
733 "Return non-nil if NAME is the name of a folder. 755 "Return non-nil if NAME is the name of a folder.
734A name (a string or symbol) can be a folder name if it begins with \"+\"." 756A name (a string or symbol) can be a folder name if it begins
757with \"+\"."
735 (if (symbolp name) 758 (if (symbolp name)
736 (eq (aref (symbol-name name) 0) ?+) 759 (eq (aref (symbol-name name) 0) ?+)
737 (and (> (length name) 0) 760 (and (> (length name) 0)
@@ -761,8 +784,8 @@ See `expand-file-name' for description of DEFAULT."
761(defmacro mh-defun-show-buffer (function original-function 784(defmacro mh-defun-show-buffer (function original-function
762 &optional dont-return) 785 &optional dont-return)
763 "Define FUNCTION to run ORIGINAL-FUNCTION in folder buffer. 786 "Define FUNCTION to run ORIGINAL-FUNCTION in folder buffer.
764If the buffer we start in is still visible and DONT-RETURN is nil then switch 787If the buffer we start in is still visible and DONT-RETURN is nil
765to it after that." 788then switch to it after that."
766 `(defun ,function () 789 `(defun ,function ()
767 ,(format "Calls %s from the message's folder.\n%s\nSee `%s' for more info.\n" 790 ,(format "Calls %s from the message's folder.\n%s\nSee `%s' for more info.\n"
768 original-function 791 original-function
@@ -1208,8 +1231,8 @@ See also `mh-folder-mode'.
1208 1231
1209(defun mh-face-display-function () 1232(defun mh-face-display-function ()
1210 "Display a Face, X-Face, or X-Image-URL header field. 1233 "Display a Face, X-Face, or X-Image-URL header field.
1211If more than one of these are present, then the first one found in this order 1234If more than one of these are present, then the first one found
1212is used." 1235in this order is used."
1213 (save-restriction 1236 (save-restriction
1214 (goto-char (point-min)) 1237 (goto-char (point-min))
1215 (re-search-forward "\n\n" (point-max) t) 1238 (re-search-forward "\n\n" (point-max) t)
@@ -1375,9 +1398,9 @@ The directories are searched for in the order they appear in the list.")
1375 1398
1376(defun mh-picon-file-contents (file) 1399(defun mh-picon-file-contents (file)
1377 "Return details about FILE. 1400 "Return details about FILE.
1378A list of consisting of a symbol for the type of the file and the file 1401A list of consisting of a symbol for the type of the file and the
1379contents as a string is returned. If FILE is nil, then both elements of the 1402file contents as a string is returned. If FILE is nil, then both
1380list are nil." 1403elements of the list are nil."
1381 (if (stringp file) 1404 (if (stringp file)
1382 (with-temp-buffer 1405 (with-temp-buffer
1383 (let ((type (and (string-match ".*\\.\\(...\\)$" file) 1406 (let ((type (and (string-match ".*\\.\\(...\\)$" file)
@@ -1388,8 +1411,9 @@ list are nil."
1388 1411
1389(defun mh-picon-generate-path (host-list user directory) 1412(defun mh-picon-generate-path (host-list user directory)
1390 "Generate the image file path. 1413 "Generate the image file path.
1391HOST-LIST is the parsed host address of the email address, USER the username 1414HOST-LIST is the parsed host address of the email address, USER
1392and DIRECTORY is the directory relative to which the path is generated." 1415the username and DIRECTORY is the directory relative to which the
1416path is generated."
1393 (loop with acc = "" 1417 (loop with acc = ""
1394 for elem in host-list 1418 for elem in host-list
1395 do (setq acc (format "%s/%s" elem acc)) 1419 do (setq acc (format "%s/%s" elem acc))
@@ -1460,9 +1484,9 @@ Replace the ?/ character with a ?! character and append .png."
1460 1484
1461(defun mh-x-image-url-fetch-image (url cache-file marker sentinel) 1485(defun mh-x-image-url-fetch-image (url cache-file marker sentinel)
1462 "Fetch and display the image specified by URL. 1486 "Fetch and display the image specified by URL.
1463After the image is fetched, it is stored in CACHE-FILE. It will be displayed 1487After the image is fetched, it is stored in CACHE-FILE. It will
1464in a buffer and position specified by MARKER. The actual display is carried 1488be displayed in a buffer and position specified by MARKER. The
1465out by the SENTINEL function." 1489actual display is carried out by the SENTINEL function."
1466 (if mh-wget-executable 1490 (if mh-wget-executable
1467 (let ((buffer (get-buffer-create (generate-new-buffer-name 1491 (let ((buffer (get-buffer-create (generate-new-buffer-name
1468 mh-temp-fetch-buffer))) 1492 mh-temp-fetch-buffer)))
@@ -1576,18 +1600,18 @@ If optional arg MSG is non-nil, display that message instead."
1576(defun mh-show (&optional message redisplay-flag) 1600(defun mh-show (&optional message redisplay-flag)
1577 "Display message\\<mh-folder-mode-map>. 1601 "Display message\\<mh-folder-mode-map>.
1578 1602
1579If the message under the cursor is already displayed, this command scrolls to 1603If the message under the cursor is already displayed, this command
1580the beginning of the message. MH-E normally hides a lot of the superfluous 1604scrolls to the beginning of the message. MH-E normally hides a lot of
1581header fields that mailers add to a message, but if you wish to see all of 1605the superfluous header fields that mailers add to a message, but if
1582them, use the command \\[mh-header-display]. 1606you wish to see all of them, use the command \\[mh-header-display].
1583 1607
1584From a program, optional argument MESSAGE can be used to display an 1608From a program, optional argument MESSAGE can be used to display an
1585alternative message. The optional argument REDISPLAY-FLAG forces the redisplay 1609alternative message. The optional argument REDISPLAY-FLAG forces the
1586of the message even if the show buffer was already displaying the correct 1610redisplay of the message even if the show buffer was already
1587message. 1611displaying the correct message.
1588 1612
1589See the \"mh-show\" customization group for a litany of options that control 1613See the \"mh-show\" customization group for a litany of options that
1590what displayed messages look like." 1614control what displayed messages look like."
1591 (interactive (list nil t)) 1615 (interactive (list nil t))
1592 (when (or redisplay-flag 1616 (when (or redisplay-flag
1593 (and mh-showing-with-headers 1617 (and mh-showing-with-headers
@@ -1656,10 +1680,11 @@ displayed."
1656(defun mh-modify (&optional message) 1680(defun mh-modify (&optional message)
1657 "Edit message. 1681 "Edit message.
1658 1682
1659There are times when you need to edit a message. For example, you may need to 1683There are times when you need to edit a message. For example, you
1660fix a broken Content-Type header field. You can do this with this command. It 1684may need to fix a broken Content-Type header field. You can do
1661displays the raw message in an editable buffer. When you are done editing, 1685this with this command. It displays the raw message in an
1662save and kill the buffer as you would any other. 1686editable buffer. When you are done editing, save and kill the
1687buffer as you would any other.
1663 1688
1664From a program, edit MESSAGE instead if it is non-nil." 1689From a program, edit MESSAGE instead if it is non-nil."
1665 (interactive) 1690 (interactive)
@@ -1793,13 +1818,14 @@ Sets the current buffer to the show buffer."
1793 1818
1794(defun mh-clean-msg-header (start invisible-headers visible-headers) 1819(defun mh-clean-msg-header (start invisible-headers visible-headers)
1795 "Flush extraneous lines in message header. 1820 "Flush extraneous lines in message header.
1796Header is cleaned from START to the end of the message header.
1797INVISIBLE-HEADERS contains a regular expression specifying lines to delete
1798from the header. VISIBLE-HEADERS contains a regular expression specifying the
1799lines to display. INVISIBLE-HEADERS is ignored if VISIBLE-HEADERS is non-nil.
1800 1821
1801Note that MH-E no longer supports the `mh-visible-headers' variable, so 1822Header is cleaned from START to the end of the message header.
1802this function could be trimmed of this feature too." 1823INVISIBLE-HEADERS contains a regular expression specifying lines
1824to delete from the header. VISIBLE-HEADERS contains a regular
1825expression specifying the lines to display. INVISIBLE-HEADERS is
1826ignored if VISIBLE-HEADERS is non-nil."
1827 ;; XXX Note that MH-E no longer supports the `mh-visible-headers'
1828 ;; variable, so this function could be trimmed of this feature too."
1803 (let ((case-fold-search t) 1829 (let ((case-fold-search t)
1804 (buffer-read-only nil) 1830 (buffer-read-only nil)
1805 (after-change-functions nil)) ;Work around emacs-20 font-lock bug 1831 (after-change-functions nil)) ;Work around emacs-20 font-lock bug
@@ -1870,10 +1896,11 @@ If NOTATION is nil then no change in the buffer occurs."
1870You can enter the message NUMBER either before or after typing 1896You can enter the message NUMBER either before or after typing
1871\\[mh-goto-msg]. In the latter case, Emacs prompts you. 1897\\[mh-goto-msg]. In the latter case, Emacs prompts you.
1872 1898
1873In a program, optional non-nil second argument NO-ERROR-IF-NO-MESSAGE means 1899In a program, optional non-nil second argument NO-ERROR-IF-NO-MESSAGE
1874return nil instead of signaling an error if message does not exist\; in this 1900means return nil instead of signaling an error if message does not
1875case, the cursor is positioned near where the message would have been. Non-nil 1901exist\; in this case, the cursor is positioned near where the message
1876third argument DONT-SHOW means not to show the message." 1902would have been. Non-nil third argument DONT-SHOW means not to show
1903the message."
1877 (interactive "NGo to message: ") 1904 (interactive "NGo to message: ")
1878 (setq number (prefix-numeric-value number)) 1905 (setq number (prefix-numeric-value number))
1879 (let ((point (point)) 1906 (let ((point (point))
@@ -1910,12 +1937,14 @@ Returns nil if the field is not in the buffer."
1910This function sets `mh-user-path' from your \"Path:\" MH profile 1937This function sets `mh-user-path' from your \"Path:\" MH profile
1911component (but defaults to \"Mail\" if one isn't present), 1938component (but defaults to \"Mail\" if one isn't present),
1912`mh-draft-folder' from \"Draft-Folder:\", `mh-unseen-seq' from 1939`mh-draft-folder' from \"Draft-Folder:\", `mh-unseen-seq' from
1913\"Unseen-Sequence:\", `mh-previous-seq' from \"Previous-Sequence:\", 1940\"Unseen-Sequence:\", `mh-previous-seq' from
1914and `mh-inbox' from \"Inbox:\" (defaults to \"+inbox\"). 1941\"Previous-Sequence:\", and `mh-inbox' from \"Inbox:\" (defaults
1915 1942to \"+inbox\").
1916The hook `mh-find-path-hook' is run after these variables have been 1943
1917set. This hook can be used the change the value of these variables if 1944The hook `mh-find-path-hook' is run after these variables have
1918you need to run with different values between MH and MH-E." 1945been set. This hook can be used the change the value of these
1946variables if you need to run with different values between MH and
1947MH-E."
1919 (mh-variants) 1948 (mh-variants)
1920 (unless mh-find-path-run 1949 (unless mh-find-path-run
1921 (setq mh-find-path-run t) 1950 (setq mh-find-path-run t)
@@ -1970,8 +1999,8 @@ you need to run with different values between MH and MH-E."
1970 1999
1971(defun mh-install (profile error-val) 2000(defun mh-install (profile error-val)
1972 "Initialize the MH environment. 2001 "Initialize the MH environment.
1973This is called if we fail to read the PROFILE file. ERROR-VAL is the error 2002This is called if we fail to read the PROFILE file. ERROR-VAL is
1974that made this call necessary." 2003the error that made this call necessary."
1975 (if (or (getenv "MH") 2004 (if (or (getenv "MH")
1976 (file-exists-p profile) 2005 (file-exists-p profile)
1977 mh-no-install) 2006 mh-no-install)
@@ -2007,9 +2036,9 @@ that made this call necessary."
2007(defun mh-update-scan-format (fmt width) 2036(defun mh-update-scan-format (fmt width)
2008 "Return a scan format with the (msg) width in the FMT replaced with WIDTH. 2037 "Return a scan format with the (msg) width in the FMT replaced with WIDTH.
2009 2038
2010The message number width portion of the format is discovered using 2039The message number width portion of the format is discovered
2011`mh-scan-msg-format-regexp'. Its replacement is controlled with 2040using `mh-scan-msg-format-regexp'. Its replacement is controlled
2012`mh-scan-msg-format-string'." 2041with `mh-scan-msg-format-string'."
2013 (or (and 2042 (or (and
2014 (string-match mh-scan-msg-format-regexp fmt) 2043 (string-match mh-scan-msg-format-regexp fmt)
2015 (let ((begin (match-beginning 1)) 2044 (let ((begin (match-beginning 1))
@@ -2038,12 +2067,13 @@ The message number width portion of the format is discovered using
2038 2067
2039(defun mh-add-msgs-to-seq (msgs seq &optional internal-flag dont-annotate-flag) 2068(defun mh-add-msgs-to-seq (msgs seq &optional internal-flag dont-annotate-flag)
2040 "Add MSGS to SEQ. 2069 "Add MSGS to SEQ.
2041Remove duplicates and keep sequence sorted. If optional INTERNAL-FLAG is
2042non-nil, do not mark the message in the scan listing or inform MH of the
2043addition.
2044 2070
2045If DONT-ANNOTATE-FLAG is non-nil then the annotations in the folder buffer are 2071Remove duplicates and keep sequence sorted. If optional
2046not updated." 2072INTERNAL-FLAG is non-nil, do not mark the message in the scan
2073listing or inform MH of the addition.
2074
2075If DONT-ANNOTATE-FLAG is non-nil then the annotations in the
2076folder buffer are not updated."
2047 (let ((entry (mh-find-seq seq)) 2077 (let ((entry (mh-find-seq seq))
2048 (internal-seq-flag (mh-internal-seq seq))) 2078 (internal-seq-flag (mh-internal-seq seq)))
2049 (if (and msgs (atom msgs)) (setq msgs (list msgs))) 2079 (if (and msgs (atom msgs)) (setq msgs (list msgs)))
@@ -2085,8 +2115,8 @@ not updated."
2085 2115
2086(defun mh-collect-folder-names-filter (process output) 2116(defun mh-collect-folder-names-filter (process output)
2087 "Read folder names. 2117 "Read folder names.
2088PROCESS is the flists process that was run to collect folder names and the 2118PROCESS is the flists process that was run to collect folder
2089function is called when OUTPUT is available." 2119names and the function is called when OUTPUT is available."
2090 (let ((position 0) 2120 (let ((position 0)
2091 (prevailing-match-data (match-data)) 2121 (prevailing-match-data (match-data))
2092 line-end folder) 2122 line-end folder)
@@ -2124,16 +2154,18 @@ function is called when OUTPUT is available."
2124(defun mh-normalize-folder-name (folder &optional empty-string-okay 2154(defun mh-normalize-folder-name (folder &optional empty-string-okay
2125 dont-remove-trailing-slash) 2155 dont-remove-trailing-slash)
2126 "Normalizes FOLDER name. 2156 "Normalizes FOLDER name.
2127Makes sure that two '/' characters never occur next to each other. Also all
2128occurrences of \"..\" and \".\" are suitably processed. So \"+inbox/../news\"
2129will be normalized to \"+news\".
2130 2157
2131If optional argument EMPTY-STRING-OKAY is nil then a '+' is added at the 2158Makes sure that two '/' characters never occur next to each
2132front if FOLDER lacks one. If non-nil and FOLDER is the empty string then 2159other. Also all occurrences of \"..\" and \".\" are suitably
2133nothing is added. 2160processed. So \"+inbox/../news\" will be normalized to \"+news\".
2134 2161
2135If optional argument DONT-REMOVE-TRAILING-SLASH is non-nil then a trailing '/' 2162If optional argument EMPTY-STRING-OKAY is nil then a '+' is added
2136if present is retained (if present), otherwise it is removed." 2163at the front if FOLDER lacks one. If non-nil and FOLDER is the
2164empty string then nothing is added.
2165
2166If optional argument DONT-REMOVE-TRAILING-SLASH is non-nil then a
2167trailing '/' if present is retained (if present), otherwise it is
2168removed."
2137 (when (stringp folder) 2169 (when (stringp folder)
2138 ;; Replace two or more consecutive '/' characters with a single '/' 2170 ;; Replace two or more consecutive '/' characters with a single '/'
2139 (while (string-match "//" folder) 2171 (while (string-match "//" folder)
@@ -2176,11 +2208,12 @@ if present is retained (if present), otherwise it is removed."
2176 2208
2177(defun mh-sub-folders (folder &optional add-trailing-slash-flag) 2209(defun mh-sub-folders (folder &optional add-trailing-slash-flag)
2178 "Find the subfolders of FOLDER. 2210 "Find the subfolders of FOLDER.
2179The function avoids running folders unnecessarily by caching the results of 2211The function avoids running folders unnecessarily by caching the
2180the actual folders call. 2212results of the actual folders call.
2181 2213
2182If optional argument ADD-TRAILING-SLASH-FLAG is non-nil then a slash is added 2214If optional argument ADD-TRAILING-SLASH-FLAG is non-nil then a
2183to each of the sub-folder names that may have nested folders within them." 2215slash is added to each of the sub-folder names that may have
2216nested folders within them."
2184 (let* ((folder (mh-normalize-folder-name folder)) 2217 (let* ((folder (mh-normalize-folder-name folder))
2185 (match (gethash folder mh-sub-folders-cache 'no-result)) 2218 (match (gethash folder mh-sub-folders-cache 'no-result))
2186 (sub-folders (cond ((eq match 'no-result) 2219 (sub-folders (cond ((eq match 'no-result)
@@ -2195,8 +2228,8 @@ to each of the sub-folder names that may have nested folders within them."
2195 2228
2196(defun mh-sub-folders-actual (folder) 2229(defun mh-sub-folders-actual (folder)
2197 "Execute the command folders to return the sub-folders of FOLDER. 2230 "Execute the command folders to return the sub-folders of FOLDER.
2198Filters out the folder names that start with \".\" so that directories that 2231Filters out the folder names that start with \".\" so that
2199aren't usually mail folders are hidden." 2232directories that aren't usually mail folders are hidden."
2200 (let ((arg-list `(,(expand-file-name "folders" mh-progs) 2233 (let ((arg-list `(,(expand-file-name "folders" mh-progs)
2201 nil (t nil) nil "-noheader" "-norecurse" "-nototal" 2234 nil (t nil) nil "-noheader" "-norecurse" "-nototal"
2202 ,@(if (stringp folder) (list folder) ()))) 2235 ,@(if (stringp folder) (list folder) ())))
@@ -2243,13 +2276,15 @@ aren't usually mail folders are hidden."
2243 2276
2244(defun mh-remove-from-sub-folders-cache (folder) 2277(defun mh-remove-from-sub-folders-cache (folder)
2245 "Remove FOLDER and its parent from `mh-sub-folders-cache'. 2278 "Remove FOLDER and its parent from `mh-sub-folders-cache'.
2246FOLDER should be unconditionally removed from the cache. Also the last ancestor 2279FOLDER should be unconditionally removed from the cache. Also the
2247of FOLDER present in the cache must be removed as well. 2280last ancestor of FOLDER present in the cache must be removed as
2248 2281well.
2249To see why this is needed assume we have a folder +foo which has a single 2282
2250sub-folder qux. Now we create the folder +foo/bar/baz. Here we will need to 2283To see why this is needed assume we have a folder +foo which has
2251invalidate the cached sub-folders of +foo, otherwise completion on +foo won't 2284a single sub-folder qux. Now we create the folder +foo/bar/baz.
2252tell us about the option +foo/bar!" 2285Here we will need to invalidate the cached sub-folders of +foo,
2286otherwise completion on +foo won't tell us about the option
2287+foo/bar!"
2253 (remhash folder mh-sub-folders-cache) 2288 (remhash folder mh-sub-folders-cache)
2254 (block ancestor-found 2289 (block ancestor-found
2255 (let ((parent folder) 2290 (let ((parent folder)
@@ -2270,8 +2305,9 @@ tell us about the option +foo/bar!"
2270 2305
2271(defvar mh-allow-root-folder-flag nil 2306(defvar mh-allow-root-folder-flag nil
2272 "Non-nil means \"+\" is an acceptable folder name. 2307 "Non-nil means \"+\" is an acceptable folder name.
2273This variable is used to communicate with `mh-folder-completion-function'. That 2308This variable is used to communicate with
2274function can have exactly three arguments so we bind this variable to t or nil. 2309`mh-folder-completion-function'. That function can have exactly
2310three arguments so we bind this variable to t or nil.
2275 2311
2276This variable should never be set.") 2312This variable should never be set.")
2277 2313
@@ -2288,9 +2324,9 @@ This variable should never be set.")
2288 2324
2289(defun mh-folder-completion-function (name predicate flag) 2325(defun mh-folder-completion-function (name predicate flag)
2290 "Programmable completion for folder names. 2326 "Programmable completion for folder names.
2291NAME is the partial folder name that has been input. PREDICATE if non-nil is a 2327NAME is the partial folder name that has been input. PREDICATE if
2292function that is used to filter the possible choices and FLAG determines 2328non-nil is a function that is used to filter the possible choices
2293whether the completion is over." 2329and FLAG determines whether the completion is over."
2294 (let* ((orig-name name) 2330 (let* ((orig-name name)
2295 (name (mh-normalize-folder-name name nil t)) 2331 (name (mh-normalize-folder-name name nil t))
2296 (last-slash (mh-search-from-end ?/ name)) 2332 (last-slash (mh-search-from-end ?/ name))
@@ -2325,8 +2361,8 @@ whether the completion is over."
2325 2361
2326(defun mh-folder-completing-read (prompt default allow-root-folder-flag) 2362(defun mh-folder-completing-read (prompt default allow-root-folder-flag)
2327 "Read folder name with PROMPT and default result DEFAULT. 2363 "Read folder name with PROMPT and default result DEFAULT.
2328If ALLOW-ROOT-FOLDER-FLAG is non-nil then \"+\" is allowed to be a folder name 2364If ALLOW-ROOT-FOLDER-FLAG is non-nil then \"+\" is allowed to be
2329corresponding to `mh-user-path'." 2365a folder name corresponding to `mh-user-path'."
2330 (mh-normalize-folder-name 2366 (mh-normalize-folder-name
2331 (let ((minibuffer-completing-file-name t) 2367 (let ((minibuffer-completing-file-name t)
2332 (completion-root-regexp "^[+/]") 2368 (completion-root-regexp "^[+/]")
@@ -2339,12 +2375,13 @@ corresponding to `mh-user-path'."
2339(defun mh-prompt-for-folder (prompt default can-create 2375(defun mh-prompt-for-folder (prompt default can-create
2340 &optional default-string allow-root-folder-flag) 2376 &optional default-string allow-root-folder-flag)
2341 "Prompt for a folder name with PROMPT. 2377 "Prompt for a folder name with PROMPT.
2342Returns the folder's name as a string. DEFAULT is used if the folder exists 2378Returns the folder's name as a string. DEFAULT is used if the
2343and the user types return. If the CAN-CREATE flag is t, then a folder is 2379folder exists and the user types return. If the CAN-CREATE flag
2344created if it doesn't already exist. If optional argument DEFAULT-STRING is 2380is t, then a folder is created if it doesn't already exist. If
2345non-nil, use it in the prompt instead of DEFAULT. If ALLOW-ROOT-FOLDER-FLAG is 2381optional argument DEFAULT-STRING is non-nil, use it in the prompt
2346non-nil then the function will accept the folder +, which means all folders 2382instead of DEFAULT. If ALLOW-ROOT-FOLDER-FLAG is non-nil then the
2347when used in searching." 2383function will accept the folder +, which means all folders when
2384used in searching."
2348 (if (null default) 2385 (if (null default)
2349 (setq default "")) 2386 (setq default ""))
2350 (let* ((default-string (cond (default-string (format " (default %s)" default-string)) 2387 (let* ((default-string (cond (default-string (format " (default %s)" default-string))
@@ -2397,9 +2434,10 @@ when used in searching."
2397 2434
2398(defun mh-truncate-log-buffer () 2435(defun mh-truncate-log-buffer ()
2399 "If `mh-log-buffer' is too big then truncate it. 2436 "If `mh-log-buffer' is too big then truncate it.
2400If the number of lines in `mh-log-buffer' exceeds `mh-log-buffer-lines' then 2437If the number of lines in `mh-log-buffer' exceeds
2401keep only the last `mh-log-buffer-lines'. As a side effect the point is set to 2438`mh-log-buffer-lines' then keep only the last
2402the end of the log buffer. 2439`mh-log-buffer-lines'. As a side effect the point is set to the
2440end of the log buffer.
2403 2441
2404The function returns the size of the final size of the log buffer." 2442The function returns the size of the final size of the log buffer."
2405 (with-current-buffer (get-buffer-create mh-log-buffer) 2443 (with-current-buffer (get-buffer-create mh-log-buffer)
@@ -2419,9 +2457,9 @@ The function returns the size of the final size of the log buffer."
2419 2457
2420(defun mh-exec-cmd (command &rest args) 2458(defun mh-exec-cmd (command &rest args)
2421 "Execute mh-command COMMAND with ARGS. 2459 "Execute mh-command COMMAND with ARGS.
2422The side effects are what is desired. 2460The side effects are what is desired. Any output is assumed to be
2423Any output is assumed to be an error and is shown to the user. 2461an error and is shown to the user. The output is not read or
2424The output is not read or parsed by MH-E." 2462parsed by MH-E."
2425 (save-excursion 2463 (save-excursion
2426 (set-buffer (get-buffer-create mh-log-buffer)) 2464 (set-buffer (get-buffer-create mh-log-buffer))
2427 (let* ((initial-size (mh-truncate-log-buffer)) 2465 (let* ((initial-size (mh-truncate-log-buffer))
@@ -2458,9 +2496,9 @@ Signals an error if process does not complete successfully."
2458(defun mh-exec-cmd-daemon (command filter &rest args) 2496(defun mh-exec-cmd-daemon (command filter &rest args)
2459 "Execute MH command COMMAND in the background. 2497 "Execute MH command COMMAND in the background.
2460 2498
2461If FILTER is non-nil then it is used to process the output otherwise the 2499If FILTER is non-nil then it is used to process the output
2462default filter `mh-process-daemon' is used. See `set-process-filter' for more 2500otherwise the default filter `mh-process-daemon' is used. See
2463details of FILTER. 2501`set-process-filter' for more details of FILTER.
2464 2502
2465ARGS are passed to COMMAND as command line arguments." 2503ARGS are passed to COMMAND as command line arguments."
2466 (save-excursion 2504 (save-excursion
@@ -2480,9 +2518,9 @@ ARGS are passed to COMMAND as command line arguments."
2480ENV is nil or a string of space-separated \"var=value\" elements. 2518ENV is nil or a string of space-separated \"var=value\" elements.
2481Signals an error if process does not complete successfully. 2519Signals an error if process does not complete successfully.
2482 2520
2483If FILTER is non-nil then it is used to process the output otherwise the 2521If FILTER is non-nil then it is used to process the output
2484default filter `mh-process-daemon' is used. See `set-process-filter' for more 2522otherwise the default filter `mh-process-daemon' is used. See
2485details of FILTER. 2523`set-process-filter' for more details of FILTER.
2486 2524
2487ARGS are passed to COMMAND as command line arguments." 2525ARGS are passed to COMMAND as command line arguments."
2488 (let ((process-environment process-environment)) 2526 (let ((process-environment process-environment))
@@ -2492,17 +2530,20 @@ ARGS are passed to COMMAND as command line arguments."
2492 2530
2493(defun mh-process-daemon (process output) 2531(defun mh-process-daemon (process output)
2494 "PROCESS daemon that puts OUTPUT into a temporary buffer. 2532 "PROCESS daemon that puts OUTPUT into a temporary buffer.
2495Any output from the process is displayed in an asynchronous pop-up window." 2533Any output from the process is displayed in an asynchronous
2534pop-up window."
2496 (set-buffer (get-buffer-create mh-log-buffer)) 2535 (set-buffer (get-buffer-create mh-log-buffer))
2497 (insert-before-markers output) 2536 (insert-before-markers output)
2498 (display-buffer mh-log-buffer)) 2537 (display-buffer mh-log-buffer))
2499 2538
2500(defun mh-exec-cmd-quiet (raise-error command &rest args) 2539(defun mh-exec-cmd-quiet (raise-error command &rest args)
2501 "Signal RAISE-ERROR if COMMAND with ARGS fails. 2540 "Signal RAISE-ERROR if COMMAND with ARGS fails.
2502Execute MH command COMMAND with ARGS. ARGS is a list of strings. 2541Execute MH command COMMAND with ARGS. ARGS is a list of strings.
2503Return at start of mh-temp buffer, where output can be parsed and used. 2542Return at start of mh-temp buffer, where output can be parsed and
2504Returns value of `call-process', which is 0 for success, unless RAISE-ERROR is 2543used.
2505non-nil, in which case an error is signaled if `call-process' returns non-0." 2544Returns value of `call-process', which is 0 for success, unless
2545RAISE-ERROR is non-nil, in which case an error is signaled if
2546`call-process' returns non-0."
2506 (set-buffer (get-buffer-create mh-temp-buffer)) 2547 (set-buffer (get-buffer-create mh-temp-buffer))
2507 (erase-buffer) 2548 (erase-buffer)
2508 (let ((value 2549 (let ((value
@@ -2522,8 +2563,8 @@ non-nil, in which case an error is signaled if `call-process' returns non-0."
2522 2563
2523(defun mh-exchange-point-and-mark-preserving-active-mark () 2564(defun mh-exchange-point-and-mark-preserving-active-mark ()
2524 "Put the mark where point is now, and point where the mark is now. 2565 "Put the mark where point is now, and point where the mark is now.
2525This command works even when the mark is not active, and preserves whether the 2566This command works even when the mark is not active, and
2526mark is active or not." 2567preserves whether the mark is active or not."
2527 (interactive nil) 2568 (interactive nil)
2528 (let ((is-active (and (boundp 'mark-active) mark-active))) 2569 (let ((is-active (and (boundp 'mark-active) mark-active)))
2529 (let ((omark (mark t))) 2570 (let ((omark (mark t)))
@@ -2537,7 +2578,8 @@ mark is active or not."
2537 2578
2538(defun mh-exec-cmd-output (command display &rest args) 2579(defun mh-exec-cmd-output (command display &rest args)
2539 "Execute MH command COMMAND with DISPLAY flag and ARGS. 2580 "Execute MH command COMMAND with DISPLAY flag and ARGS.
2540Put the output into buffer after point. Set mark after inserted text. 2581Put the output into buffer after point.
2582Set mark after inserted text.
2541Output is expected to be shown to user, not parsed by MH-E." 2583Output is expected to be shown to user, not parsed by MH-E."
2542 (push-mark (point) t) 2584 (push-mark (point) t)
2543 (apply 'call-process 2585 (apply 'call-process
@@ -2553,7 +2595,8 @@ Output is expected to be shown to user, not parsed by MH-E."
2553 2595
2554(defun mh-exec-lib-cmd-output (command &rest args) 2596(defun mh-exec-lib-cmd-output (command &rest args)
2555 "Execute MH library command COMMAND with ARGS. 2597 "Execute MH library command COMMAND with ARGS.
2556Put the output into buffer after point. Set mark after inserted text." 2598Put the output into buffer after point.
2599Set mark after inserted text."
2557 (apply 'mh-exec-cmd-output (expand-file-name command mh-lib-progs) nil args)) 2600 (apply 'mh-exec-cmd-output (expand-file-name command mh-lib-progs) nil args))
2558 2601
2559(defun mh-handle-process-error (command status) 2602(defun mh-handle-process-error (command status)
@@ -2605,11 +2648,13 @@ Put the output into buffer after point. Set mark after inserted text."
2605 "Replace REGEXP with NEWTEXT everywhere in STRING and return result. 2648 "Replace REGEXP with NEWTEXT everywhere in STRING and return result.
2606NEWTEXT is taken literally---no \\DIGIT escapes will be recognized. 2649NEWTEXT is taken literally---no \\DIGIT escapes will be recognized.
2607 2650
2608The function body was copied from `dired-replace-in-string' in dired.el. 2651The function body was copied from `dired-replace-in-string' in
2609Emacs21 has `replace-regexp-in-string' while XEmacs has `replace-in-string'. 2652dired.el.
2610Neither is present in Emacs20. The file gnus-util.el in Gnus 5.10.1 and above 2653Emacs21 has `replace-regexp-in-string' while XEmacs has
2611has `gnus-replace-in-string'. We should use that when we decide to not support 2654`replace-in-string'.
2612older versions of Gnus." 2655Neither is present in Emacs20. The file gnus-util.el in Gnus 5.10.1
2656and above has `gnus-replace-in-string'. We should use that when we
2657decide to not support older versions of Gnus."
2613 (let ((result "") (start 0) mb me) 2658 (let ((result "") (start 0) mb me)
2614 (while (string-match regexp string start) 2659 (while (string-match regexp string start)
2615 (setq mb (match-beginning 0) 2660 (setq mb (match-beginning 0)