aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2006-03-10 11:23:32 +0000
committerKaroly Lorentey2006-03-10 11:23:32 +0000
commitd2b86d7f40873f053489f386f7ab926bbb226bef (patch)
tree8c617fed23a63e9dca406fa1aa5daa7f0f0919b6
parentdb9d7d9a54118c277fdc47b2840139e78218b1ae (diff)
parent61e66a158a521e1ebdaa2e547dcc98d383674a75 (diff)
downloademacs-d2b86d7f40873f053489f386f7ab926bbb226bef.tar.gz
emacs-d2b86d7f40873f053489f386f7ab926bbb226bef.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-136 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-137 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-138 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-139 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-140 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-141 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-142 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-143 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/gnus--rel--5.10--patch-49 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-50 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-51 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-52 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-53 Update from CVS: Makefile.in (release-*): New targets. * emacs@sv.gnu.org/gnus--rel--5.10--patch-54 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-55 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-527
-rw-r--r--admin/FOR-RELEASE7
-rw-r--r--etc/ChangeLog10
-rw-r--r--etc/GNUS-NEWS4
-rw-r--r--etc/MH-E-NEWS40
-rw-r--r--etc/NEWS2
-rw-r--r--etc/orgcard.tex4
-rw-r--r--lisp/ChangeLog183
-rw-r--r--lisp/arc-mode.el8
-rw-r--r--lisp/complete.el27
-rw-r--r--lisp/files.el10
-rw-r--r--lisp/gnus/ChangeLog28
-rw-r--r--lisp/gnus/TODO193
-rw-r--r--lisp/gnus/gnus-group.el20
-rw-r--r--lisp/gnus/gnus-sum.el2
-rw-r--r--lisp/gnus/gnus-topic.el5
-rw-r--r--lisp/gnus/gnus-util.el17
-rw-r--r--lisp/gnus/mm-util.el3
-rw-r--r--lisp/gnus/mm-view.el26
-rw-r--r--lisp/gnus/nnmail.el21
-rw-r--r--lisp/help.el64
-rw-r--r--lisp/international/fontset.el3
-rw-r--r--lisp/mh-e/ChangeLog47
-rw-r--r--lisp/mh-e/mh-compat.el78
-rw-r--r--lisp/mh-e/mh-e.el4
-rw-r--r--lisp/mh-e/mh-folder.el3
-rw-r--r--lisp/mh-e/mh-letter.el3
-rw-r--r--lisp/mh-e/mh-search.el24
-rw-r--r--lisp/mh-e/mh-utils.el133
-rw-r--r--lisp/outline.el12
-rw-r--r--lisp/progmodes/gdb-ui.el7
-rw-r--r--lisp/progmodes/gud.el18
-rw-r--r--lisp/t-mouse.el32
-rw-r--r--lisp/textmodes/org.el340
-rw-r--r--lisp/tree-widget.el178
-rw-r--r--lisp/tumme.el6
-rw-r--r--lisp/url/ChangeLog11
-rw-r--r--lisp/url/url-http.el20
-rw-r--r--lisp/wdired.el1
-rw-r--r--lispref/ChangeLog14
-rw-r--r--lispref/searching.texi47
-rw-r--r--man/ChangeLog37
-rw-r--r--man/dired.texi12
-rw-r--r--man/emacs-mime.texi13
-rw-r--r--man/gnus.texi100
-rw-r--r--man/mh-e.texi10638
-rw-r--r--man/org.texi2
-rw-r--r--man/search.texi20
-rw-r--r--src/ChangeLog45
-rw-r--r--src/image.c4
-rw-r--r--src/macfns.c31
-rw-r--r--src/macterm.c171
-rw-r--r--src/macterm.h4
-rw-r--r--src/window.c7
-rw-r--r--src/xdisp.c7
-rw-r--r--src/xselect.c1
55 files changed, 9181 insertions, 3566 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 3f035d1d55a..b04273d274e 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -33,13 +33,6 @@ Assigned to Bill Wohler <wohler@newt.com>.
33 33
34* BUGS 34* BUGS
35 35
36** Reiner Steib's 23 Jan 2006 bug report that tool bar icons don't update.
37URL/MID: http://mid.gmane.org/v9acdmrcse.fsf@marauder.physik.uni-ulm.de
38
39** Problems with moving point across invisible text,
40including Ralf Angeli's 21 Feb bug report
41and Martin Rudalics' 14 Feb bug report "Re: moving point and invisible text"
42
43** Markus Gritsch's report about Emacs looping on Windoze with the following 36** Markus Gritsch's report about Emacs looping on Windoze with the following
44.emacs file, and then reduce Emacs frame width to "something quite narrow": 37.emacs file, and then reduce Emacs frame width to "something quite narrow":
45 (setq-default truncate-lines t) 38 (setq-default truncate-lines t)
diff --git a/etc/ChangeLog b/etc/ChangeLog
index cfc2f3e9a04..22558d050e8 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,13 @@
12006-03-07 Carsten Dominik <dominik@science.uva.nl>
2
3 * orgcard.tex: Version number change only.
4
52006-03-05 Bill Wohler <wohler@newt.com>
6
7 Release MH-E version 7.93.
8
9 * NEWS, MH-E-NEWS: Update for MH-E release 7.93.
10
12006-02-23 Herbert Euler <herberteuler@hotmail.com> (tiny change) 112006-02-23 Herbert Euler <herberteuler@hotmail.com> (tiny change)
2 12
3 * TUTORIAL.cn: Fix omission bug: Add dot (ASCII 0x2E) on first line. 13 * TUTORIAL.cn: Fix omission bug: Add dot (ASCII 0x2E) on first line.
diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS
index d5fbfe78106..4032558b023 100644
--- a/etc/GNUS-NEWS
+++ b/etc/GNUS-NEWS
@@ -355,6 +355,10 @@ in the Agent, it won't get downloaded once more. Customize
355On composing messages, it is enabled by `use-hard-newlines'. Decoding 355On composing messages, it is enabled by `use-hard-newlines'. Decoding
356format=flowed was present but not documented in earlier versions. 356format=flowed was present but not documented in earlier versions.
357 357
358** The option `mm-fill-flowed' can be used to disable treatment of
359format=flowed messages. Also, flowed text is disabled when sending
360inline PGP signed messages. (New in Gnus 5.10.7)
361
358** Gnus supports the generation of RFC 2298 Disposition Notification requests. 362** Gnus supports the generation of RFC 2298 Disposition Notification requests.
359 363
360This is invoked with the C-c M-n key binding from message mode. 364This is invoked with the C-c M-n key binding from message mode.
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index 74470e47e25..0fd4ec62174 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -6,6 +6,46 @@ Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright 6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. 7notice and this notice are preserved.
8 8
9* Changes in MH-E 7.93
10
11Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in
12searching and limiting exposed during continued beta testing.
13
14** Variables Deleted in MH-E 7.93
15
16*** mh-show-use-goto-addr-flag
17
18This flag was redundant and inconsistent with
19`goto-address-highlight-p' at the same time, so we removed it. Please
20customize `goto-address-highlight-p' if you wish to turn off email
21address and URL highlighting.
22
23** Bug Fixes in MH-E 7.93
24
25*** `/ s' Can Miss the Original Mail
26
27The command `/ s' failed to include the message with the "Re:" in the
28Subject. This has been fixed (closes SF #1438369).
29
30*** XEmacs -nw Fails with number-char-or-marker-p Error
31
32Hopefully, this is the last we'll hear of problems associated with
33XEmacs' incompatible `device-color-cells' function (closes SF
34#1436924).
35
36*** Pick-based Searches Fail
37
38The command `C-c C-p' failed to find any matches. This has been fixed
39(closes SF #1435381).
40
41*** Can't Narrow to Subject with Regexp Chars
42
43The command `/ s' could not limit subjects that had special pick
44characters (such as [, *, $, .). This has been fixed (closes SF
45#1432548).
46
47
48
9* Changes in MH-E 7.92 49* Changes in MH-E 7.92
10 50
11Version 7.92, the third 8.0 beta release, removes the "sed -i" in the 51Version 7.92, the third 8.0 beta release, removes the "sed -i" in the
diff --git a/etc/NEWS b/etc/NEWS
index df6a44e2254..ae7ae7f649e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3007,7 +3007,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3007--- 3007---
3008** MH-E changes. 3008** MH-E changes.
3009 3009
3010Upgraded to MH-E version 7.92. There have been major changes since 3010Upgraded to MH-E version 7.93. There have been major changes since
3011version 5.0.2; see MH-E-NEWS for details. 3011version 5.0.2; see MH-E-NEWS for details.
3012 3012
3013** Calendar changes: 3013** Calendar changes:
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index 1e39ea23327..39508baf873 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,4 +1,4 @@
1% Reference Card for Org Mode 4.07 1% Reference Card for Org Mode 4.08
2% 2%
3%**start of header 3%**start of header
4\newcount\columnsperpage 4\newcount\columnsperpage
@@ -58,7 +58,7 @@
58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik 58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
59% for their many good ideas. 59% for their many good ideas.
60 60
61\def\orgversionnumber{4.07} 61\def\orgversionnumber{4.08}
62\def\year{2006} 62\def\year{2006}
63 63
64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9a539543947..647122caada 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,120 @@
12006-03-08 Juanma Barranquero <lekktu@gmail.com>
2
3 * help.el (view-lossage): Remove trailing whitespace before
4 inserting "\n".
5
62006-03-07 Chong Yidong <cyd@stupidchicken.com>
7
8 * files.el (hack-local-variables-confirm): Set
9 coding-system-for-read to nil before writing to .emacs.
10
11 * arc-mode.el (archive-extract): Check if an existing buffer name
12 comes from a different archive.
13
14 * help.el (describe-key-briefly): If KEY is a down event, read and
15 discard the up event.
16
172006-03-07 Nick Roberts <nickrob@snap.net.nz>
18
19 * progmodes/gud.el (gud-speedbar-buttons): Allow pointers to
20 be edited and use font-lock-warning-face for any changes.
21
22 * progmodes/gdb-ui.el (gdb-edit-value-handler): New function.
23 (gdb-edit-value): Use it to report any errors.
24
252006-03-07 Juanma Barranquero <lekktu@gmail.com>
26
27 * help.el (describe-key): Remove leftover test code.
28
292006-03-07 Carsten Dominik <dominik@science.uva.nl>
30
31 * textmodes/org.el: Move defvars out of eval-when-compile. Use
32 buffer-file-name variable.
33 (org-agenda-file-to-end, org-agenda-file-to-front): Remove unused
34 arg `file'.
35 (org-level-faces): Remove startup dependency.
36 (org-cycle, org-map-tree, org-scan-tags)
37 (org-remember-handler): Don't call `outline-level' directly.
38 (org-mhe-search-all-folders): New option.
39 (org-mhe-get-message-folder-from-index)
40 (org-mhe-get-message-folder): Fix indexing search.
41 (org-format-agenda-item): Handle nil TAGS argument.
42 (org-cleaned-string-for-export, org-activate-target-links)
43 (org-make-target-link-regexp): Deal with empty radio target list.
44 (org-tag): New face.
45 (org-get-level-face): New function.
46 (org-set-font-lock-defaults): Simplify setup for headlines.
47 (org-complete): Pass common substring to
48 `display-completion-list'.
49
502006-03-06 David Ponce <david@dponce.com>
51
52 * tree-widget.el: Update Commentary header.
53 (tree-widget-theme-name): Ignore parent themes.
54 (tree-widget-set-parent-theme): New function.
55 (tree-widget-set-theme): Use it.
56 (tree-widget-set-image-properties): Move definition. Does nothing
57 if image properties have already been set.
58 (tree-widget-image-properties): Move definition. Receive an image
59 name. Set the :pointer property.
60 (tree-widget-lookup-image): Doc fix. Search in parent themes.
61 Don't set the :pointer image property.
62 (tree-widget-convert-widget): New function. Handle :dynargs
63 compatibility here.
64 (tree-widget): Use it to :convert-widget. Add the :expander-p
65 predicate to control when the :expander function is entered.
66 Thanks to Ken Manheimer <ken.manheimer@gmail.com> for the idea.
67 (tree-widget-value-create): Handle :expander-p. widget-apply
68 :expander.
69 (tree-widget-expander-p): New function. Default value of the
70 :expander-p property.
71
722006-03-06 Chong Yidong <cyd@stupidchicken.com>
73
74 * help.el (describe-key): Properly handle the return value of
75 read-key-sequence when grabbing an up-event. Cleanup mouse-1
76 remaps. Handle string and vector `follow-link' values.
77
782006-03-06 Stefan Monnier <monnier@iro.umontreal.ca>
79
80 * complete.el (PC-expand-many-files): Try be more careful when parsing
81 the shell's output.
82
832006-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
84
85 * outline.el (hide-sublevels): Provide better interactive default.
86
872006-03-06 Kenichi Handa <handa@m17n.org>
88
89 * international/fontset.el (create-fontset-from-fontset-spec):
90 Fix regexp for paring FONTSET-SPEC (allow spaces after `:').
91
922006-03-05 Luc Teirlinck <teirllm@auburn.edu>
93
94 * progmodes/gud.el (gud-jdb-marker-filter): Quote `[' with two
95 backslashes instead of one in regexp.
96 (gud-tooltip-dereference): Add missing optional argument.
97
982006-03-04 John Paul Wallington <jpw@pobox.com>
99
100 * wdired.el (toplevel): Require `cl' at compile-time.
101
1022006-03-04 Andreas Schwab <schwab@suse.de>
103
104 * server.el (server-process-filter): Handle errors during
105 evaluation of the argument.
106
1072006-03-03 John Paul Wallington <jpw@pobox.com>
108
109 * t-mouse.el (t-mouse-drag-start, t-mouse-swap-alt-keys): Doc fix;
110 escape parentheses at beginning of line.
111 (t-mouse-tty, t-mouse-make-event): Doc fix; use imperative.
112 (t-mouse-mode): Remove period from end of error message.
113
12006-03-03 Agustin Martin <agustin.martin@hispalinux.es> 1142006-03-03 Agustin Martin <agustin.martin@hispalinux.es>
2 115
3 textmodes/flyspell.el (flyspell-process-localwords): Be 116 * textmodes/flyspell.el (flyspell-process-localwords):
4 case-sensitive. 117 Be case-sensitive.
5 118
62006-03-03 Martin Rudalics <rudalics@gmx.at> 1192006-03-03 Martin Rudalics <rudalics@gmx.at>
7 120
@@ -14,7 +127,7 @@
14 they have no special meaning. 127 they have no special meaning.
15 128
16 * midnight.el (clean-buffer-list): Handle case where base-buffer of 129 * midnight.el (clean-buffer-list): Handle case where base-buffer of
17 indirect buffer gets killed before indirect buffer. Use dolist. 130 indirect buffer gets killed before indirect buffer. Use dolist.
18 131
192006-03-03 Ken Manheimer <ken.manheimer@gmail.com> 1322006-03-03 Ken Manheimer <ken.manheimer@gmail.com>
20 133
@@ -23,8 +136,8 @@
23 136
242006-03-03 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change) 1372006-03-03 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change)
25 138
26 * textmodes/flyspell.el (flyspell-external-point-words): Be 139 * textmodes/flyspell.el (flyspell-external-point-words):
27 case-sensitive. 140 Be case-sensitive.
28 141
292006-03-03 Ryan Yeske <rcyeske@gmail.com> 1422006-03-03 Ryan Yeske <rcyeske@gmail.com>
30 143
@@ -33,37 +146,32 @@
33 146
342006-03-03 Ken Manheimer <ken.manheimer@gmail.com> 1472006-03-03 Ken Manheimer <ken.manheimer@gmail.com>
35 148
36 allout.el: Restablished intermediate missing comment header to 149 * allout.el: Restablish intermediate missing comment header to
37 preserve outline structure. 150 preserve outline structure.
38 (allout-beginning-of-current-entry): Wasn't skipping invisible 151 (allout-beginning-of-current-entry): Skip invisible text.
39 text - fixed. 152 (allout-open-topic): Fix opening a topic at end-of-buffer.
40 (allout-open-topic): Was failing when opening a topic at 153 (allout-minor-mode): Move nearer to allout-mode function.
41 end-of-buffer - fixed.
42 (allout-minor-mode): Moved nearer to allout-mode function.
43 154
442006-03-02 Carsten Dominik <dominik@science.uva.nl> 1552006-03-02 Carsten Dominik <dominik@science.uva.nl>
45 156
46 * textmodes/org.el (org-paste-subtree): Removed forgotten (debug) 157 * textmodes/org.el (org-paste-subtree): Remove (debug) form.
47 form.
48 158
492006-03-02 Nick Roberts <nickrob@snap.net.nz> 1592006-03-02 Nick Roberts <nickrob@snap.net.nz>
50 160
51 * dframe.el (dframe-frame-mode): Don't burp when menu-bar-lines 161 * dframe.el (dframe-frame-mode): Don't burp when menu-bar-lines
52 is nil. 162 is nil.
53 163
54 * progmodes/gud.el (gud-speedbar-menu-items): Use 164 * progmodes/gud.el (gud-speedbar-menu-items):
55 buffer-local-value and add missing :visible keyword. 165 Use buffer-local-value and add missing :visible keyword.
56 166
57 * progmodes/gdb-ui.el (gdb-speedbar-refresh): Quieten 167 * progmodes/gdb-ui.el (gdb-speedbar-refresh): Quieten speedbar-refresh.
58 speedbar-refresh.
59 168
602006-03-01 Carsten Dominik <dominik@science.uva.nl> 1692006-03-01 Carsten Dominik <dominik@science.uva.nl>
61 170
62 * textmodes/reftex-index.el (reftex-index-map): `follow-mouse' 171 * textmodes/reftex-index.el (reftex-index-map): `follow-mouse'
63 must be `follow-link'. 172 must be `follow-link'.
64 173
65 * textmodes/reftex-toc.el (reftex-toc-map): `follow-mouse' must be 174 * textmodes/reftex-toc.el (reftex-toc-map): Likewise.
66 `follow-link'.
67 175
68 * textmodes/org.el (org-export-as-html): Fix bugs in HTML 176 * textmodes/org.el (org-export-as-html): Fix bugs in HTML
69 formatting: No nested anchors. 177 formatting: No nested anchors.
@@ -71,8 +179,7 @@
71 (org-read-date): Add (require 'parse-time). 179 (org-read-date): Add (require 'parse-time).
72 (org-set-tags): Fix bug with extra inserted space. 180 (org-set-tags): Fix bug with extra inserted space.
73 (org-export-html-style): Define a style class for targets. 181 (org-export-html-style): Define a style class for targets.
74 (org-agenda-keymap, org-mouse-map): Add a binding for 182 (org-agenda-keymap, org-mouse-map): Add a binding for `follow-link'.
75 `follow-link'.
76 (org-hide-leading-stars): New option. 183 (org-hide-leading-stars): New option.
77 (org-hide): New face. 184 (org-hide): New face.
78 (org-set-font-lock-defaults): Allow to hide leading stars. 185 (org-set-font-lock-defaults): Allow to hide leading stars.
@@ -88,12 +195,11 @@
88 preserve window-start. 195 preserve window-start.
89 (speedbar-update-directory-contents): Try to preserve window-start 196 (speedbar-update-directory-contents): Try to preserve window-start
90 and window-point. 197 and window-point.
91 (speedbar-update-special-contents): Don't move back to start of 198 (speedbar-update-special-contents): Don't move back to start of window.
92 window.
93 199
94 * progmodes/gdb-ui.el (gdb-speedbar-refresh): Rename from 200 * progmodes/gdb-ui.el (gdb-speedbar-refresh): Rename from
95 gdb-speedbar-timer-fn. Use speedbar-refresh instead of 201 gdb-speedbar-timer-fn. Use speedbar-refresh instead of
96 speedbar-timer-fn 202 speedbar-timer-fn.
97 (gdb-var-update-handler, gdb-var-update-handler-1): Use it. 203 (gdb-var-update-handler, gdb-var-update-handler-1): Use it.
98 (gdb-speedbar-expand-node): Use speedbar-delete-subblock 204 (gdb-speedbar-expand-node): Use speedbar-delete-subblock
99 instead of gdb-speedbar-timer-fn. 205 instead of gdb-speedbar-timer-fn.
@@ -180,17 +286,17 @@
180 * startup.el (command-line): 286 * startup.el (command-line):
181 * subr.el (locate-library): 287 * subr.el (locate-library):
182 * emacs-lisp/autoload.el (update-directory-autoloads): 288 * emacs-lisp/autoload.el (update-directory-autoloads):
183 * emacs-lisp/find-func.el (find-library-suffixes): Use 289 * emacs-lisp/find-func.el (find-library-suffixes):
184 `get-load-suffixes' instead of `load-suffixes'. 290 Use `get-load-suffixes' instead of `load-suffixes'.
185 291
186 * subr.el (locate-library): 292 * subr.el (locate-library):
187 * emacs-lisp/find-func.el (find-library-name): Use 293 * emacs-lisp/find-func.el (find-library-name):
188 `load-file-rep-suffixes' instead of '(""). 294 Use `load-file-rep-suffixes' instead of '("").
189 295
1902006-02-26 Kim F. Storm <storm@cua.dk> 2962006-02-26 Kim F. Storm <storm@cua.dk>
191 297
192 * ido.el (ido-save-history, ido-load-history): Simplify. Don't 298 * ido.el (ido-save-history, ido-load-history): Simplify.
193 use find-file-noselect to avoid interference from other modes. 299 Don't use find-file-noselect to avoid interference from other modes.
194 300
1952006-02-25 Thien-Thi Nguyen <ttn@gnu.org> 3012006-02-25 Thien-Thi Nguyen <ttn@gnu.org>
196 302
@@ -209,8 +315,8 @@
209 315
2102006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> 3162006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org>
211 317
212 * progmodes/cc-mode.el (c-postprocess-file-styles): Bind 318 * progmodes/cc-mode.el (c-postprocess-file-styles):
213 inhibit-read-only to t, around the call to 319 Bind inhibit-read-only to t, around the call to
214 c-remove-any-local-eval-or-mode-variables, so that it works on a 320 c-remove-any-local-eval-or-mode-variables, so that it works on a
215 RO file. 321 RO file.
216 322
@@ -251,13 +357,12 @@
251 357
252 * progmodes/cc-mode.el: 358 * progmodes/cc-mode.el:
253 [Supersedes patch to cc-engine.el 2005-12-16T20:07:49Z!monnier@iro.umontreal.ca] 359 [Supersedes patch to cc-engine.el 2005-12-16T20:07:49Z!monnier@iro.umontreal.ca]
254 (c-after-change): Protect the match data with save-match-data. It 360 (c-after-change): Protect the match data with save-match-data.
255 was getting corrupted by c-after-change-check-<>-operators. 361 It was getting corrupted by c-after-change-check-<>-operators.
256 362
257 * cc-defs.el: [Supersedes patch V1.38]: 363 * cc-defs.el: [Supersedes patch V1.38]:
258 (top level): Check for a buggy font-lock-compile-keywords ONLY in 364 (top level): Check for a buggy font-lock-compile-keywords ONLY in
259 XEmacs. GNU Emacs 22 now has a check which would throw an error 365 XEmacs. GNU Emacs 22 now has a check which would throw an error here.
260 here.
261 366
262 * progmodes/cc-awk.el (c-awk-after-change): Protect the match data 367 * progmodes/cc-awk.el (c-awk-after-change): Protect the match data
263 with save-match-data. It was being corrupted when Font Lock was 368 with save-match-data. It was being corrupted when Font Lock was
@@ -273,14 +378,12 @@
273 (c-forward-objc-directive): Replace c-forward-token-2 with crude 378 (c-forward-objc-directive): Replace c-forward-token-2 with crude
274 coding; c-f-t-2 doesn't move over a token at EOB. 379 coding; c-f-t-2 doesn't move over a token at EOB.
275 380
276 * progmodes/cc-defs.el (c-version): Update version number to 381 * progmodes/cc-defs.el (c-version): Update version number to 5.31.2.
277 5.31.2
278 382
279 * progmodes/cc-cmds.el, cc-mode.el, cc-engine.el 383 * progmodes/cc-cmds.el, cc-mode.el, cc-engine.el
280 (c-update-modeline): Concatenate the minor mode indicators 384 (c-update-modeline): Concatenate the minor mode indicators
281 directly onto mode-name, removing c-submode-indicators. 385 directly onto mode-name, removing c-submode-indicators.
282 Sometimes, c-s-i got separated from the mode name on the mode 386 Sometimes, c-s-i got separated from the mode name on the mode line.
283 line.
284 387
285 * progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma) 388 * progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma)
286 (c-electric-colon): Correct doc-strings: "/ln" -> "/la". 389 (c-electric-colon): Correct doc-strings: "/ln" -> "/la".
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 9799e3e0834..abf38994235 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -907,16 +907,18 @@ using `make-temp-file', and the generated name is returned."
907 (read-only-p (or archive-read-only 907 (read-only-p (or archive-read-only
908 view-p 908 view-p
909 (string-match file-name-invalid-regexp ename))) 909 (string-match file-name-invalid-regexp ename)))
910 (arcfilename (expand-file-name (concat arcname ":" iname)))
910 (buffer (get-buffer bufname)) 911 (buffer (get-buffer bufname))
911 (just-created nil)) 912 (just-created nil))
912 (if buffer 913 (if (and buffer
914 (string= (buffer-file-name buffer) arcfilename))
913 nil 915 nil
914 (setq archive (archive-maybe-copy archive)) 916 (setq archive (archive-maybe-copy archive))
917 (setq bufname (generate-new-buffer-name bufname))
915 (setq buffer (get-buffer-create bufname)) 918 (setq buffer (get-buffer-create bufname))
916 (setq just-created t) 919 (setq just-created t)
917 (with-current-buffer buffer 920 (with-current-buffer buffer
918 (setq buffer-file-name 921 (setq buffer-file-name arcfilename)
919 (expand-file-name (concat arcname ":" iname)))
920 (setq buffer-file-truename 922 (setq buffer-file-truename
921 (abbreviate-file-name buffer-file-name)) 923 (abbreviate-file-name buffer-file-name))
922 ;; Set the default-directory to the dir of the superior buffer. 924 ;; Set the default-directory to the dir of the superior buffer.
diff --git a/lisp/complete.el b/lisp/complete.el
index a48942d2df1..a50d02c41f0 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -94,7 +94,7 @@
94 :group 'convenience) 94 :group 'convenience)
95 95
96(defcustom PC-first-char 'find-file 96(defcustom PC-first-char 'find-file
97 "*Control how the first character of a string is to be interpreted. 97 "Control how the first character of a string is to be interpreted.
98If nil, the first character of a string is not taken literally if it is a word 98If nil, the first character of a string is not taken literally if it is a word
99delimiter, so that \".e\" matches \"*.e*\". 99delimiter, so that \".e\" matches \"*.e*\".
100If t, the first character of a string is always taken literally even if it is a 100If t, the first character of a string is always taken literally even if it is a
@@ -107,13 +107,13 @@ completion."
107 :group 'partial-completion) 107 :group 'partial-completion)
108 108
109(defcustom PC-meta-flag t 109(defcustom PC-meta-flag t
110 "*If non-nil, TAB means PC completion and M-TAB means normal completion. 110 "If non-nil, TAB means PC completion and M-TAB means normal completion.
111Otherwise, TAB means normal completion and M-TAB means Partial Completion." 111Otherwise, TAB means normal completion and M-TAB means Partial Completion."
112 :type 'boolean 112 :type 'boolean
113 :group 'partial-completion) 113 :group 'partial-completion)
114 114
115(defcustom PC-word-delimiters "-_. " 115(defcustom PC-word-delimiters "-_. "
116 "*A string of characters treated as word delimiters for completion. 116 "A string of characters treated as word delimiters for completion.
117Some arcane rules: 117Some arcane rules:
118If `]' is in this string, it must come first. 118If `]' is in this string, it must come first.
119If `^' is in this string, it must not come first. 119If `^' is in this string, it must not come first.
@@ -124,13 +124,13 @@ expression (not containing character ranges like `a-z')."
124 :group 'partial-completion) 124 :group 'partial-completion)
125 125
126(defcustom PC-include-file-path '("/usr/include" "/usr/local/include") 126(defcustom PC-include-file-path '("/usr/include" "/usr/local/include")
127 "*A list of directories in which to look for include files. 127 "A list of directories in which to look for include files.
128If nil, means use the colon-separated path in the variable $INCPATH instead." 128If nil, means use the colon-separated path in the variable $INCPATH instead."
129 :type '(repeat directory) 129 :type '(repeat directory)
130 :group 'partial-completion) 130 :group 'partial-completion)
131 131
132(defcustom PC-disable-includes nil 132(defcustom PC-disable-includes nil
133 "*If non-nil, include-file support in \\[find-file] is disabled." 133 "If non-nil, include-file support in \\[find-file] is disabled."
134 :type 'boolean 134 :type 'boolean
135 :group 'partial-completion) 135 :group 'partial-completion)
136 136
@@ -764,7 +764,13 @@ or properties are considered."
764 (erase-buffer) 764 (erase-buffer)
765 (shell-command (concat "echo " name) t) 765 (shell-command (concat "echo " name) t)
766 (goto-char (point-min)) 766 (goto-char (point-min))
767 (if (looking-at ".*No match") 767 ;; CSH-style shells were known to output "No match", whereas
768 ;; SH-style shells tend to simply output `name' when no match is found.
769 (if (looking-at (concat ".*No match\\|\\(^\\| \\)\\("
770 (regexp-quote name)
771 "\\|"
772 (regexp-quote (expand-file-name name))
773 "\\)\\( \\|$\\)"))
768 nil 774 nil
769 (insert "(\"") 775 (insert "(\"")
770 (while (search-forward " " nil t) 776 (while (search-forward " " nil t)
@@ -787,7 +793,14 @@ or properties are considered."
787 "\\)\\'"))) 793 "\\)\\'")))
788 (setq p nil) 794 (setq p nil)
789 (while files 795 (while files
790 (or (string-match PC-ignored-regexp (car files)) 796 ;; This whole process of going through to shell, to echo, and
797 ;; finally parsing the output is a hack. It breaks as soon as
798 ;; there are spaces in the file names or when the no-match
799 ;; message changes. To make up for it, we check that what we read
800 ;; indeed exists, so we may miss some files, but we at least won't
801 ;; list non-existent ones.
802 (or (not (file-exists-p (car files)))
803 (string-match PC-ignored-regexp (car files))
791 (setq p (cons (car files) p))) 804 (setq p (cons (car files) p)))
792 (setq files (cdr files))) 805 (setq files (cdr files)))
793 p)))) 806 p))))
diff --git a/lisp/files.el b/lisp/files.el
index edbe0c2d285..f70c264642e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2405,9 +2405,13 @@ n -- to ignore the local variables list.
2405 (when (and (= char ?!) unsafe-vars) 2405 (when (and (= char ?!) unsafe-vars)
2406 (dolist (elt unsafe-vars) 2406 (dolist (elt unsafe-vars)
2407 (add-to-list 'safe-local-variable-values elt)) 2407 (add-to-list 'safe-local-variable-values elt))
2408 (customize-save-variable 2408 ;; When this is called from desktop-restore-file-buffer,
2409 'safe-local-variable-values 2409 ;; coding-system-for-read may be non-nil. Reset it before
2410 safe-local-variable-values)) 2410 ;; writing to .emacs.
2411 (let ((coding-system-for-read nil))
2412 (customize-save-variable
2413 'safe-local-variable-values
2414 safe-local-variable-values)))
2411 (kill-buffer buf) 2415 (kill-buffer buf)
2412 (or (= char ?!) 2416 (or (= char ?!)
2413 (= char ?\s) 2417 (= char ?\s)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index dce2a5ae07f..374c3da2994 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,31 @@
12006-03-08 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * gnus-util.el (gnus-tool-bar-update): New function.
4
5 * gnus-group.el (gnus-group-update-tool-bar): New variable.
6 (gnus-group-insert-group-line): Add gnus-tool-bar-update.
7
8 * gnus-topic.el (gnus-topic-prepare-topic): Add gnus-tool-bar-update.
9
102006-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
11
12 * nnmail.el (nnmail-split-it): Invert match-partial-words behavior
13 if optional last element is specified in splits (FIELD VALUE...).
14
152006-03-06 Katsumi Yamaoka <yamaoka@jpl.org>
16
17 * mm-view.el (mm-w3m-cid-retrieve-1): Check carefully whether
18 handle is multipart when calling it recursively.
19 (mm-w3m-cid-retrieve): Display warning if retrieving fails.
20
212006-03-03 Reiner Steib <Reiner.Steib@gmx.de>
22
23 * mm-util.el (mm-with-unibyte-current-buffer): Change "Emacs 23"
24 to "Emacs 23 (unicode)" in doc string.
25
26 * gnus-sum.el (gnus-summary-set-display-table): Change "Emacs 23" to
27 "Emacs 23 (unicode)" in comment.
28
12006-03-03 Katsumi Yamaoka <yamaoka@jpl.org> 292006-03-03 Katsumi Yamaoka <yamaoka@jpl.org>
2 30
3 * mm-decode.el (mm-get-part): Don't use 31 * mm-decode.el (mm-get-part): Don't use
diff --git a/lisp/gnus/TODO b/lisp/gnus/TODO
deleted file mode 100644
index 02afb6dca05..00000000000
--- a/lisp/gnus/TODO
+++ /dev/null
@@ -1,193 +0,0 @@
12004-08-22 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * Disclaimer: This is *temporary* file to keep track of the changes
4 in the trunk, that have or have not made it into the Gnus branch.
5
6
7
82004--08-22 Reiner Steib <Reiner.Steib@gmx.de>
9
10 * Add `:version "21.4"' to all new defcustoms. Grep ChangeLog and
11 ChangeLog.1 for "new variable". Also check if the `:version
12 "21.1"' and `:version "21.3"' entries are correct.
13
14
15
162002-10-02 Karl Berry <karl@gnu.org>
17
18 * In directory ./man:
19
20 * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi,
21 pgg.texi, sieve.texi: Per rms, update all manuals to use @copying
22 instead of @ifinfo. Also use @ifnottex instead of @ifinfo around
23 the top node, where needed for the sake of the HTML output.
24 (The Gnus manual is not fixed since it's not clear to me how it
25 works; and the Tramp manual already uses @copying, although in an
26 unusual way. All others were changed.)
27
28==> Done. Not yet in Gnus repository.
29
30
31
322004-06-29 Kim F. Storm <storm@cua.dk>
33
34 * nntp.el (nntp-authinfo-file): Add :group 'nntp.
35
36 * nnimap.el (nnimap-authinfo-file, nnimap-prune-cache):
37 Add :group 'nnimap.
38
39==> applied, here and in Gnus repository.
40
412004-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
42
43 * mm-view.el (mm-insert-inline): Make it work in read-only buffer.
44
45 * gnus-win.el (gnus-all-windows-visible-p): Don't consider
46 non-visible windows.
47
482004-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
49
50 * rfc2047.el (rfc2047-encode-message-header): Don't encode non-address
51 headers as address headers (which breaks if subject has a single ").
52
53==> already in Gnus
54
552004-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
56
57 * nnimap.el (nnimap-demule): Avoid string-as-multibyte.
58
59==> applied, here and in Gnus repository.
60
612004-04-21 Richard M. Stallman <rms@gnu.org>
62
63 * mailcap.el (mailcap-mime-data): Mark as risky.
64
65==> applied, here and in Gnus repository.
66
672004-03-27 Juanma Barranquero <lektu@terra.es>
68
69 * gnus-srvr.el (gnus-server-prepare): Remove spurious call to `cdr'.
70
71==> already in Gnus
72
732004-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * gnus-art.el: Use inhibit-read-only instead of buffer-read-only.
76 (gnus-narrow-to-page): Don't assume point-min == 1.
77 (gnus-article-edit-mode): Derive from message-mode.
78 (gnus-button-alist): Add buttons to (info "(emacs)Keymaps").
79
80 * gnus-score.el (gnus-score-find-bnews): Simplify and don't assume
81 point-min == 1.
82
83 * imap.el (imap-parse-address-list, imap-parse-body-ext):
84 Disable incorrect use of `assert'.
85
86==> applied / modified
87
882004-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
89
90 * message.el (message-mode): Fix last change.
91
92==> applied
93
942004-03-04 Stefan Monnier <monnier@iro.umontreal.ca>
95
96 * message.el (message-mode): Set comment-start-skip.
97
98==> applied
99
1002004-02-08 Andreas Schwab <schwab@suse.de>
101
102 * nnlistserv.el (nnlistserv-kk-wash-article): Fix paren nesting.
103
104 * gnus-score.el (gnus-summary-increase-score): Fix format string.
105
106==> applied; here and in Gnus v5-10. Already fixed in No Gnus.
107
1082003-06-25 Sam Steingold <sds@gnu.org>
109
110 * gnus-group.el (gnus-group-suspend): Avoid some consing.
111
112==> hunk FAILED / not very important / skip
113
1142003-06-11 Sam Steingold <sds@gnu.org>
115
116 * pop3.el (pop3-leave-mail-on-server): New user variable.
117 (pop3-movemail): Delete mail only when it is nil.
118
119==> applied / Was not documented in the Gnus manual, added it.
120
1212003-05-10 Juanma Barranquero <lektu@terra.es>
122
123 * message.el (message-buffer-naming-style): Fix typo.
124
125==> variable has been removed.
126
1272003-05-07 Dave Love <fx@gnu.org>
128
129 [Partial sync with Gnus.]
130
131 * rfc2047.el (rfc2047-header-encoding-alist): Add Followup-To.
132 (rfc2047-encode-message-header): Fold when encoding not necessary.
133 (rfc2047-encode-region): Skip \n as whitespace.
134 (rfc2047-fold-region): Fix whitespace regexps. Don't break just
135 after the header name.
136 (rfc2047-unfold-region): Fix regexp and whitespace-skipping.
137
1382003-05-06 Jesper Harder <harder@ifa.au.dk>
139
140 * gnus-cus.el (gnus-group-customize, gnus-score-parameters):
141 Don't quote nil and t in docstrings.
142
143 * gnus-score.el (gnus-score-lower-thread): Likewise.
144
145 * gnus-art.el (gnus-article-mime-match-handle-function): Likewise.
146
147==> already in Gnus
148
1492003-02-28 ShengHuo ZHU <zsh@cs.rochester.edu>
150
151 * nnfolder.el (nnfolder-request-accept-article): Don't use
152 mail-header-unfold-field.
153
154 * imap.el (imap-ssl-open): Don't depend on ssl.el.
155 * nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el.
156
1572003-02-18 Juanma Barranquero <lektu@terra.es>
158
159 * ietf-drums.el (ietf-drums-remove-whitespace): Fix character constant.
160
1612003-02-14 Juanma Barranquero <lektu@terra.es>
162
163 * mm-uu.el (mm-uu-dissect): Fix use of character constant.
164
165==> already done. [2003-02-14 ShengHuo ZHU synced stuff to Gnus]
166
1672003-02-11 Stefan Monnier <monnier@cs.yale.edu>
168
169 * nntp.el (nntp-accept-process-output): Don't use point-max to get
170 the buffer's size.
171
172==> already done. [2003-02-14 ShengHuo ZHU synced stuff to Gnus]
173
1742003-01-31 Joe Buehler <jhpb@draco.hekimian.com>
175
176 * nnheader.el: Added cygwin to system-type comparisons.
177
178==> already done.
179
180
181
1822004-08-22 Reiner Steib <Reiner.Steib@gmx.de>
183
184 * It seems that the last few changes and all older changes have
185 already been applied in Gnus repository, e.g. by ShengHuo ZHU
186 <zsh@cs.rochester.edu>.
187
188# Local Variables:
189# coding: iso-2022-7bit
190# mode: change-log
191# End:
192
193# arch-tag: e6e5d695-4d00-46b1-a49d-508a2418a483
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 933c3762ed9..3d20af8b0df 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1379,6 +1379,18 @@ if it is a string, only list groups matching REGEXP."
1379 (gnus-range-difference (list active) (gnus-info-read info)) 1379 (gnus-range-difference (list active) (gnus-info-read info))
1380 seen)))))) 1380 seen))))))
1381 1381
1382(defcustom gnus-group-update-tool-bar
1383 (and (not (featurep 'xemacs))
1384 (boundp 'tool-bar-mode)
1385 tool-bar-mode
1386 ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs 21 might
1387 ;; be confusing, so maybe we shouldn't call it by default.
1388 (fboundp 'force-window-update))
1389 "Force updating the group buffer tool bar."
1390 :group 'gnus-group
1391 :version "22.1"
1392 :type 'boolean)
1393
1382(defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level 1394(defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
1383 gnus-tmp-marked number 1395 gnus-tmp-marked number
1384 gnus-tmp-method) 1396 gnus-tmp-method)
@@ -1447,8 +1459,10 @@ if it is a string, only list groups matching REGEXP."
1447 (bbb-grouplens-group-p gnus-tmp-group)) 1459 (bbb-grouplens-group-p gnus-tmp-group))
1448 "")) 1460 ""))
1449 (buffer-read-only nil) 1461 (buffer-read-only nil)
1462 beg end
1450 header gnus-tmp-header) ; passed as parameter to user-funcs. 1463 header gnus-tmp-header) ; passed as parameter to user-funcs.
1451 (beginning-of-line) 1464 (beginning-of-line)
1465 (setq beg (point))
1452 (gnus-add-text-properties 1466 (gnus-add-text-properties
1453 (point) 1467 (point)
1454 (prog1 (1+ (point)) 1468 (prog1 (1+ (point))
@@ -1463,6 +1477,12 @@ if it is a string, only list groups matching REGEXP."
1463 gnus-marked ,gnus-tmp-marked-mark 1477 gnus-marked ,gnus-tmp-marked-mark
1464 gnus-indentation ,gnus-group-indentation 1478 gnus-indentation ,gnus-group-indentation
1465 gnus-level ,gnus-tmp-level)) 1479 gnus-level ,gnus-tmp-level))
1480 (setq end (point))
1481 (when gnus-group-update-tool-bar
1482 (gnus-put-text-property beg end 'point-entered
1483 'gnus-tool-bar-update)
1484 (gnus-put-text-property beg end 'point-left
1485 'gnus-tool-bar-update))
1466 (forward-line -1) 1486 (forward-line -1)
1467 (when (inline (gnus-visual-p 'group-highlight 'highlight)) 1487 (when (inline (gnus-visual-p 'group-highlight 'highlight))
1468 (gnus-run-hooks 'gnus-group-update-hook)) 1488 (gnus-run-hooks 'gnus-group-update-hook))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 226a9bd50f1..e4ca47f1ea2 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3099,7 +3099,7 @@ display only a single character."
3099 ;; We keep TAB as well. 3099 ;; We keep TAB as well.
3100 (aset table ?\t nil) 3100 (aset table ?\t nil)
3101 ;; We nix out any glyphs 127 through 255, or 127 through 159 in 3101 ;; We nix out any glyphs 127 through 255, or 127 through 159 in
3102 ;; Emacs 23, that are not set already. 3102 ;; Emacs 23 (unicode), that are not set already.
3103 (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160)) 3103 (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160))
3104 160 3104 160
3105 256))) 3105 256)))
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index fc80a26f6b9..45585526bcf 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -585,6 +585,11 @@ articles in the topic and its subtopics."
585 (not (eq (nth 2 type) 'hidden)) 585 (not (eq (nth 2 type) 'hidden))
586 level all-entries unread)) 586 level all-entries unread))
587 (gnus-topic-update-unreads (car type) unread) 587 (gnus-topic-update-unreads (car type) unread)
588 (when gnus-group-update-tool-bar
589 (gnus-put-text-property beg end 'point-entered
590 'gnus-tool-bar-update)
591 (gnus-put-text-property beg end 'point-left
592 'gnus-tool-bar-update))
588 (goto-char end) 593 (goto-char end)
589 unread)) 594 unread))
590 595
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index c9a3f8c965a..686fe1cf837 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1459,6 +1459,23 @@ Return nil otherwise."
1459 display)) 1459 display))
1460 display))))) 1460 display)))))
1461 1461
1462(defun gnus-tool-bar-update (&rest ignore)
1463 "Update the tool bar."
1464 (when (and (boundp 'tool-bar-mode)
1465 tool-bar-mode)
1466 (let* ((args nil)
1467 (func (cond ((featurep 'xemacs)
1468 'ignore)
1469 ((fboundp 'tool-bar-update)
1470 'tool-bar-update)
1471 ((fboundp 'force-window-update)
1472 'force-window-update)
1473 ((fboundp 'redraw-frame)
1474 (setq args (list (selected-frame)))
1475 'redraw-frame)
1476 (t 'ignore))))
1477 (apply func args))))
1478
1462;; Fixme: This has only one use (in gnus-agent), which isn't worthwhile. 1479;; Fixme: This has only one use (in gnus-agent), which isn't worthwhile.
1463(defmacro gnus-mapcar (function seq1 &rest seqs2_n) 1480(defmacro gnus-mapcar (function seq1 &rest seqs2_n)
1464 "Apply FUNCTION to each element of the sequences, and make a list of the results. 1481 "Apply FUNCTION to each element of the sequences, and make a list of the results.
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index e4c87067872..a8c1f3a87a1 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -802,7 +802,8 @@ NOTE: Use this macro with caution in multibyte buffers (it is not
802worth using this macro in unibyte buffers of course). Use of 802worth using this macro in unibyte buffers of course). Use of
803`(set-buffer-multibyte t)', which is run finally, is generally 803`(set-buffer-multibyte t)', which is run finally, is generally
804harmful since it is likely to modify existing data in the buffer. 804harmful since it is likely to modify existing data in the buffer.
805For instance, it converts \"\\300\\255\" into \"\\255\" in Emacs 23." 805For instance, it converts \"\\300\\255\" into \"\\255\" in
806Emacs 23 (unicode)."
806 (let ((multibyte (make-symbol "multibyte")) 807 (let ((multibyte (make-symbol "multibyte"))
807 (buffer (make-symbol "buffer"))) 808 (buffer (make-symbol "buffer")))
808 `(if mm-emacs-mule 809 `(if mm-emacs-mule
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index c2b4e19f806..5972a0681a6 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -213,21 +213,25 @@
213 213
214(defun mm-w3m-cid-retrieve-1 (url handle) 214(defun mm-w3m-cid-retrieve-1 (url handle)
215 (dolist (elem handle) 215 (dolist (elem handle)
216 (when (listp elem) 216 (when (consp elem)
217 (if (equal url (mm-handle-id elem)) 217 (when (equal url (mm-handle-id elem))
218 (progn 218 (mm-insert-part elem)
219 (mm-insert-part elem) 219 (throw 'found-handle (mm-handle-media-type elem)))
220 (throw 'found-handle (mm-handle-media-type elem)))) 220 (when (and (stringp (car elem))
221 (if (equal "multipart" (mm-handle-media-supertype elem)) 221 (equal "multipart" (mm-handle-media-supertype elem)))
222 (mm-w3m-cid-retrieve-1 url elem))))) 222 (mm-w3m-cid-retrieve-1 url elem)))))
223 223
224(defun mm-w3m-cid-retrieve (url &rest args) 224(defun mm-w3m-cid-retrieve (url &rest args)
225 "Insert a content pointed by URL if it has the cid: scheme." 225 "Insert a content pointed by URL if it has the cid: scheme."
226 (when (string-match "\\`cid:" url) 226 (when (string-match "\\`cid:" url)
227 (catch 'found-handle 227 (or (catch 'found-handle
228 (mm-w3m-cid-retrieve-1 (concat "<" (substring url (match-end 0)) ">") 228 (mm-w3m-cid-retrieve-1
229 (with-current-buffer w3m-current-buffer 229 (setq url (concat "<" (substring url (match-end 0)) ">"))
230 gnus-article-mime-handles))))) 230 (with-current-buffer w3m-current-buffer
231 gnus-article-mime-handles)))
232 (prog1
233 nil
234 (message "Failed to find \"Content-ID: %s\"" url)))))
231 235
232(defun mm-inline-text-html-render-with-w3m (handle) 236(defun mm-inline-text-html-render-with-w3m (handle)
233 "Render a text/html part using emacs-w3m." 237 "Render a text/html part using emacs-w3m."
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index edffd6f709a..f4275fa8ed5 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1425,11 +1425,12 @@ See the documentation for the variable `nnmail-split-fancy' for details."
1425 1425
1426 ;; Not in cache, compute a regexp for the field/value pair. 1426 ;; Not in cache, compute a regexp for the field/value pair.
1427 (t 1427 (t
1428 (let* ((field (nth 0 split)) 1428 (let ((field (nth 0 split))
1429 (value (nth 1 split)) 1429 (value (nth 1 split))
1430 partial-front 1430 (split-rest (cddr split))
1431 partial-rear 1431 partial-front
1432 regexp) 1432 partial-rear
1433 regexp)
1433 (if (symbolp value) 1434 (if (symbolp value)
1434 (setq value (cdr (assq value nnmail-split-abbrev-alist)))) 1435 (setq value (cdr (assq value nnmail-split-abbrev-alist))))
1435 (if (and (>= (length value) 2) 1436 (if (and (>= (length value) 2)
@@ -1441,7 +1442,13 @@ See the documentation for the variable `nnmail-split-fancy' for details."
1441 (string= ".*" (substring value -2))) 1442 (string= ".*" (substring value -2)))
1442 (setq value (substring value 0 -2) 1443 (setq value (substring value 0 -2)
1443 partial-rear "")) 1444 partial-rear ""))
1444 (when nnmail-split-fancy-match-partial-words 1445 ;; Invert the match-partial-words behavior if the optional
1446 ;; last element is specified.
1447 (while (eq (car split-rest) '-)
1448 (setq split-rest (cddr split-rest)))
1449 (when (if (cadr split-rest)
1450 (not nnmail-split-fancy-match-partial-words)
1451 nnmail-split-fancy-match-partial-words)
1445 (setq partial-front "" 1452 (setq partial-front ""
1446 partial-rear "")) 1453 partial-rear ""))
1447 (setq regexp (concat "^\\(\\(" 1454 (setq regexp (concat "^\\(\\("
@@ -1456,7 +1463,7 @@ See the documentation for the variable `nnmail-split-fancy' for details."
1456 (or partial-rear "\\>"))) 1463 (or partial-rear "\\>")))
1457 (push (cons split regexp) nnmail-split-cache) 1464 (push (cons split regexp) nnmail-split-cache)
1458 ;; Now that it's in the cache, just call nnmail-split-it again 1465 ;; Now that it's in the cache, just call nnmail-split-it again
1459 ;; on the same split, which will find it immediately in the cache. 1466 ;; on the same split, which will find it immediately in the cache.
1460 (nnmail-split-it split)))))) 1467 (nnmail-split-it split))))))
1461 1468
1462(defun nnmail-expand-newtext (newtext) 1469(defun nnmail-expand-newtext (newtext)
diff --git a/lisp/help.el b/lisp/help.el
index bed25366aab..5eef13ff9c9 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -429,8 +429,9 @@ To record all your input on a file, use `open-dribble-file'."
429 (with-current-buffer standard-output 429 (with-current-buffer standard-output
430 (goto-char (point-min)) 430 (goto-char (point-min))
431 (while (progn (move-to-column 50) (not (eobp))) 431 (while (progn (move-to-column 50) (not (eobp)))
432 (search-forward " " nil t) 432 (when (search-forward " " nil t)
433 (insert "\n"))) 433 (delete-char -1))
434 (insert "\n")))
434 (print-help-return-message))) 435 (print-help-return-message)))
435 436
436 437
@@ -577,6 +578,12 @@ temporarily enables it to allow getting help on disabled items and buttons."
577 (setq saved-yank-menu (copy-sequence yank-menu)) 578 (setq saved-yank-menu (copy-sequence yank-menu))
578 (menu-bar-update-yank-menu "(any string)" nil)) 579 (menu-bar-update-yank-menu "(any string)" nil))
579 (setq key (read-key-sequence "Describe key (or click or menu item): ")) 580 (setq key (read-key-sequence "Describe key (or click or menu item): "))
581 ;; If KEY is a down-event, read and discard the
582 ;; corresponding up-event.
583 (if (and (vectorp key)
584 (eventp (elt key 0))
585 (memq 'down (event-modifiers (elt key 0))))
586 (read-event))
580 (list 587 (list
581 key 588 key
582 (if current-prefix-arg (prefix-numeric-value current-prefix-arg)) 589 (if current-prefix-arg (prefix-numeric-value current-prefix-arg))
@@ -658,8 +665,9 @@ temporarily enables it to allow getting help on disabled items and buttons."
658 (prefix-numeric-value current-prefix-arg) 665 (prefix-numeric-value current-prefix-arg)
659 ;; If KEY is a down-event, read the corresponding up-event 666 ;; If KEY is a down-event, read the corresponding up-event
660 ;; and use it as the third argument. 667 ;; and use it as the third argument.
661 (if (and (consp key) (symbolp (car key)) 668 (if (and (vectorp key)
662 (memq 'down (cdr (get (car key) 'event-symbol-elements)))) 669 (eventp (elt key 0))
670 (memq 'down (event-modifiers (elt key 0))))
663 (read-event)))) 671 (read-event))))
664 ;; Put yank-menu back as it was, if we changed it. 672 ;; Put yank-menu back as it was, if we changed it.
665 (when saved-yank-menu 673 (when saved-yank-menu
@@ -705,30 +713,34 @@ temporarily enables it to allow getting help on disabled items and buttons."
705 (princ "\n which is ") 713 (princ "\n which is ")
706 (describe-function-1 defn) 714 (describe-function-1 defn)
707 (when up-event 715 (when up-event
708 (let ((ev (aref up-event 0)) 716 (let ((type (event-basic-type up-event))
709 (descr (key-description up-event))
710 (hdr "\n\n-------------- up event ---------------\n\n") 717 (hdr "\n\n-------------- up event ---------------\n\n")
711 defn 718 defn sequence
712 mouse-1-tricky mouse-1-remapped) 719 mouse-1-tricky mouse-1-remapped)
713 (when (and (consp ev) 720 (setq sequence (vector up-event))
714 (eq (car ev) 'mouse-1) 721 (when (and (eq type 'mouse-1)
715 (windowp window) 722 (windowp window)
716 mouse-1-click-follows-link 723 mouse-1-click-follows-link
717 (not (eq mouse-1-click-follows-link 'double)) 724 (not (eq mouse-1-click-follows-link 'double))
718 (with-current-buffer (window-buffer window) 725 (setq mouse-1-remapped
719 (mouse-on-link-p (posn-point (event-start ev))))) 726 (with-current-buffer (window-buffer window)
720 (setq mouse-1-tricky (integerp mouse-1-click-follows-link) 727 (mouse-on-link-p (posn-point
721 mouse-1-remapped (or (not mouse-1-tricky) 728 (event-start up-event))))))
722 (> mouse-1-click-follows-link 0))) 729 (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
723 (if mouse-1-remapped 730 (> mouse-1-click-follows-link 0)))
724 (setcar ev 'mouse-2))) 731 (cond ((stringp mouse-1-remapped)
725 (setq defn (or (string-key-binding up-event) (key-binding up-event))) 732 (setq sequence mouse-1-remapped))
733 ((vectorp mouse-1-remapped)
734 (setcar up-event (elt mouse-1-remapped 0)))
735 (t (setcar up-event 'mouse-2))))
736 (setq defn (or (string-key-binding sequence)
737 (key-binding sequence)))
726 (unless (or (null defn) (integerp defn) (equal defn 'undefined)) 738 (unless (or (null defn) (integerp defn) (equal defn 'undefined))
727 (princ (if mouse-1-tricky 739 (princ (if mouse-1-tricky
728 "\n\n----------------- up-event (short click) ----------------\n\n" 740 "\n\n----------------- up-event (short click) ----------------\n\n"
729 hdr)) 741 hdr))
730 (setq hdr nil) 742 (setq hdr nil)
731 (princ descr) 743 (princ (symbol-name type))
732 (if (windowp window) 744 (if (windowp window)
733 (princ " at that spot")) 745 (princ " at that spot"))
734 (if mouse-1-remapped 746 (if mouse-1-remapped
@@ -738,26 +750,22 @@ temporarily enables it to allow getting help on disabled items and buttons."
738 (princ "\n which is ") 750 (princ "\n which is ")
739 (describe-function-1 defn)) 751 (describe-function-1 defn))
740 (when mouse-1-tricky 752 (when mouse-1-tricky
741 (setcar ev 753 (setcar up-event 'mouse-1)
742 (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2)) 754 (setq defn (or (string-key-binding (vector up-event))
743 (setq defn (or (string-key-binding up-event) (key-binding up-event))) 755 (key-binding (vector up-event))))
744 (unless (or (null defn) (integerp defn) (equal defn 'undefined)) 756 (unless (or (null defn) (integerp defn) (eq defn 'undefined))
745 (princ (or hdr 757 (princ (or hdr
746 "\n\n----------------- up-event (long click) ----------------\n\n")) 758 "\n\n----------------- up-event (long click) ----------------\n\n"))
747 (princ "Pressing ") 759 (princ "Pressing mouse-1")
748 (princ descr)
749 (if (windowp window) 760 (if (windowp window)
750 (princ " at that spot")) 761 (princ " at that spot"))
751 (princ (format " for longer than %d milli-seconds\n" 762 (princ (format " for longer than %d milli-seconds\n"
752 (abs mouse-1-click-follows-link))) 763 mouse-1-click-follows-link))
753 (if (not mouse-1-remapped)
754 (princ " remaps it to <mouse-2> which" ))
755 (princ " runs the command ") 764 (princ " runs the command ")
756 (prin1 defn) 765 (prin1 defn)
757 (princ "\n which is ") 766 (princ "\n which is ")
758 (describe-function-1 defn))))) 767 (describe-function-1 defn)))))
759 (print-help-return-message))))))) 768 (print-help-return-message)))))))
760
761 769
762(defun describe-mode (&optional buffer) 770(defun describe-mode (&optional buffer)
763 "Display documentation of current major mode and minor modes. 771 "Display documentation of current major mode and minor modes.
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 1e5c9508f4e..e42ab3e5ee9 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -542,7 +542,8 @@ It returns a name of the created fontset."
542 (error "Fontset \"%s\" not conforming to XLFD" name)) 542 (error "Fontset \"%s\" not conforming to XLFD" name))
543 543
544 ;; At first, extract pairs of charset and fontname from FONTSET-SPEC. 544 ;; At first, extract pairs of charset and fontname from FONTSET-SPEC.
545 (while (string-match "[, \t\n]*\\([^:]+\\):\\([^,]+\\)" fontset-spec idx) 545 (while (string-match "[, \t\n]*\\([^:]+\\):[ \t]*\\([^,]+\\)"
546 fontset-spec idx)
546 (setq idx (match-end 0)) 547 (setq idx (match-end 0))
547 (setq charset (intern (match-string 1 fontset-spec))) 548 (setq charset (intern (match-string 1 fontset-spec)))
548 (if (charsetp charset) 549 (if (charsetp charset)
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index bf6dfd95e6e..0a097cb2f02 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,46 @@
12006-03-06 Bill Wohler <wohler@newt.com>
2
3 * mh-e.el (Version, mh-version): Add +cvs to version.
4
52006-03-05 Satyaki Das <satyaki@theforce.stanford.edu>
6
7 * mh-search.el (mh-index-update-single-msg): Fix a bug in the
8 handling of duplicate messages. The test in cond was too strong
9 and wasn't catching the case where origin-map was nil.
10
112006-03-05 Bill Wohler <wohler@newt.com>
12
13 Release MH-E version 7.93.
14
15 * mh-e.el (Version, mh-version): Update for release 7.93.
16
172006-03-05 Bill Wohler <wohler@newt.com>
18
19 * mh-folder.el (mh-folder-mode): Drop 'load-path argument when
20 calling mh-image-load-path-for-library since this is the default.
21
22 * mh-letter.el (mh-letter-mode): Ditto.
23
24 * mh-utils.el (mh-logo-display): Ditto.
25
262006-03-04 Bill Wohler <wohler@newt.com>
27
28 * mh-compat.el (mh-image-load-path-for-library): Move here from
29 mh-utils.el and wrap with mh-defun-compat since this function will
30 be soon added to image.el.
31
32 * mh-utils.el (mh-image-load-path-for-library): Move to
33 mh-compat.el.
34 (mh-normalize-folder-name): Add return-nil-if-folder-empty
35 argument which is useful when calling mh-normalize-folder-name to
36 process the folder argument for the folders command.
37 (mh-sub-folders): Use new flag to mh-normalize-folder-name to make
38 this function more robust. It could too easily list the folders in
39 /.
40 (mh-folder-list): Fix a couple of problems pointed out by Thomas
41 Baumann. Set folder to nil if empty. Don't append "/" if folder
42 nil.
43
12006-03-03 Bill Wohler <wohler@newt.com> 442006-03-03 Bill Wohler <wohler@newt.com>
2 45
3 * mh-folder.el (mh-folder-mode): Rename mh-image-load-path to 46 * mh-folder.el (mh-folder-mode): Rename mh-image-load-path to
@@ -36,8 +79,8 @@
36 (mh-tool-bar-letter-buttons-init): Don't call mh-image-load-path. 79 (mh-tool-bar-letter-buttons-init): Don't call mh-image-load-path.
37 (mh-tool-bar-define call): Format. 80 (mh-tool-bar-define call): Format.
38 81
39 * mh-utils.el (mh-image-directory, 82 * mh-utils.el (mh-image-directory)
40 mh-image-load-path-called-flag): Delete. 83 (mh-image-load-path-called-flag): Delete.
41 (mh-image-load-path): Incorporate changes from Gnus team. Biggest 84 (mh-image-load-path): Incorporate changes from Gnus team. Biggest
42 changes are that it no longer uses/sets mh-image-directory or 85 changes are that it no longer uses/sets mh-image-directory or
43 mh-image-load-path-called-flag, and returns the updated path 86 mh-image-load-path-called-flag, and returns the updated path
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index faa91a3bca2..77e39de35f5 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -115,6 +115,84 @@ introduced in Emacs 22."
115 `(face-background ,face ,frame) 115 `(face-background ,face ,frame)
116 `(face-background ,face ,frame ,inherit))) 116 `(face-background ,face ,frame ,inherit)))
117 117
118(mh-defun-compat mh-image-load-path-for-library
119 image-load-path-for-library (library image &optional path)
120 "Return a suitable search path for images relative to LIBRARY.
121
122Images for LIBRARY are searched for in \"../../etc/images\" and
123\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as
124well as in `image-load-path' and `load-path'.
125
126This function returns the value of `load-path' augmented with the
127path to IMAGE. If PATH is given, it is used instead of
128`load-path'.
129
130Here is an example that uses a common idiom to provide
131compatibility with versions of Emacs that lack the variable
132`image-load-path':
133
134 (let ((load-path
135 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
136 (image-load-path
137 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path)))
138 (mh-tool-bar-folder-buttons-init))
139
140This function is used by Emacs versions that don't have
141`image-load-path-for-library'."
142 (unless library (error "No library specified"))
143 (unless image (error "No image specified"))
144 (let ((image-directory))
145 (cond
146 ;; Try relative setting.
147 ((let (library-name d1ei d2ei)
148 ;; First, find library in the load-path.
149 (setq library-name (locate-library library))
150 (if (not library-name)
151 (error "Cannot find library %s in load-path" library))
152 ;; And then set image-directory relative to that.
153 (setq
154 ;; Go down 2 levels.
155 d2ei (expand-file-name
156 (concat (file-name-directory library-name) "../../etc/images"))
157 ;; Go down 1 level.
158 d1ei (expand-file-name
159 (concat (file-name-directory library-name) "../etc/images")))
160 (setq image-directory
161 ;; Set it to nil if image is not found.
162 (cond ((file-exists-p (expand-file-name image d2ei)) d2ei)
163 ((file-exists-p (expand-file-name image d1ei)) d1ei)))))
164 ;; Check for images in image-load-path or load-path.
165 ((let ((img image)
166 (dir (or
167 ;; Images in image-load-path.
168 (mh-image-search-load-path image)
169 ;; Images in load-path.
170 (locate-library image)))
171 parent)
172 ;; Since the image might be in a nested directory (for
173 ;; example, mail/attach.pbm), adjust `image-directory'
174 ;; accordingly.
175 (and dir
176 (setq dir (file-name-directory dir))
177 (progn
178 (while (setq parent (file-name-directory img))
179 (setq img (directory-file-name parent)
180 dir (expand-file-name "../" dir)))
181 (setq image-directory dir)))))
182 (t
183 (error "Could not find image %s for library %s" image library)))
184
185 ;; Return augmented `image-load-path' or `load-path'.
186 (cond ((and path (symbolp path))
187 (nconc (list image-directory)
188 (delete image-directory
189 (if (boundp path)
190 (copy-sequence (symbol-value path))
191 nil))))
192 (t
193 (nconc (list image-directory)
194 (delete image-directory (copy-sequence load-path)))))))
195
118(mh-defun-compat mh-image-search-load-path 196(mh-defun-compat mh-image-search-load-path
119 image-search-load-path (file &optional path) 197 image-search-load-path (file &optional path)
120 "Emacs 21 and XEmacs don't have `image-search-load-path'. 198 "Emacs 21 and XEmacs don't have `image-search-load-path'.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index fa4df0873b1..64b625f3ab6 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -6,7 +6,7 @@
6 6
7;; Author: Bill Wohler <wohler@newt.com> 7;; Author: Bill Wohler <wohler@newt.com>
8;; Maintainer: Bill Wohler <wohler@newt.com> 8;; Maintainer: Bill Wohler <wohler@newt.com>
9;; Version: 7.92+cvs 9;; Version: 7.93+cvs
10;; Keywords: mail 10;; Keywords: mail
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -116,7 +116,7 @@
116;; Try to keep variables local to a single file. Provide accessors if 116;; Try to keep variables local to a single file. Provide accessors if
117;; variables are shared. Use this section as a last resort. 117;; variables are shared. Use this section as a last resort.
118 118
119(defconst mh-version "7.92+cvs" "Version number of MH-E.") 119(defconst mh-version "7.93+cvs" "Version number of MH-E.")
120 120
121;; Variants 121;; Variants
122 122
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index dcf88670f90..f8e37a93cf8 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -591,8 +591,7 @@ perform the operation on all messages in that region.
591\\{mh-folder-mode-map}" 591\\{mh-folder-mode-map}"
592 (mh-do-in-gnu-emacs 592 (mh-do-in-gnu-emacs
593 (unless mh-folder-buttons-init-flag 593 (unless mh-folder-buttons-init-flag
594 (let ((load-path (mh-image-load-path-for-library 594 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
595 "mh-e" "mh-logo.xpm" 'load-path))
596 (image-load-path (mh-image-load-path-for-library 595 (image-load-path (mh-image-load-path-for-library
597 "mh-e" "mh-logo.xpm" 'image-load-path))) 596 "mh-e" "mh-logo.xpm" 'image-load-path)))
598 (mh-tool-bar-folder-buttons-init) 597 (mh-tool-bar-folder-buttons-init)
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 11aef2b51df..9d28ee4ec95 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -313,8 +313,7 @@ order).
313 (make-local-variable 'mh-sent-from-msg) 313 (make-local-variable 'mh-sent-from-msg)
314 (mh-do-in-gnu-emacs 314 (mh-do-in-gnu-emacs
315 (unless mh-letter-buttons-init-flag 315 (unless mh-letter-buttons-init-flag
316 (let ((load-path (mh-image-load-path-for-library 316 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
317 "mh-e" "mh-logo.xpm" 'load-path))
318 (image-load-path (mh-image-load-path-for-library 317 (image-load-path (mh-image-load-path-for-library
319 "mh-e" "mh-logo.xpm" 'image-load-path))) 318 "mh-e" "mh-logo.xpm" 'image-load-path)))
320 (mh-tool-bar-letter-buttons-init) 319 (mh-tool-bar-letter-buttons-init)
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 9980b6a9b68..17b63c91000 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -1907,22 +1907,24 @@ copied from. The function updates the hash tables
1907 1907
1908This function should only be called in the appropriate index 1908This function should only be called in the appropriate index
1909folder buffer." 1909folder buffer."
1910 (cond ((and origin-map (gethash checksum mh-index-checksum-origin-map)) 1910 (cond ((gethash checksum mh-index-checksum-origin-map)
1911 (let* ((intermediate (gethash msg origin-map)) 1911 (when origin-map
1912 (ofolder (car intermediate)) 1912 (let* ((intermediate (gethash msg origin-map))
1913 (omsg (cdr intermediate))) 1913 (ofolder (car intermediate))
1914 ;; This is most probably a duplicate. So eliminate it. 1914 (omsg (cdr intermediate)))
1915 (call-process "rm" nil nil nil 1915 ;; This is most probably a duplicate. So eliminate it.
1916 (format "%s%s/%s" mh-user-path 1916 (call-process "rm" nil nil nil
1917 (substring mh-current-folder 1) msg)) 1917 (format "%s%s/%s" mh-user-path
1918 (when (gethash ofolder mh-index-data) 1918 (substring mh-current-folder 1) msg))
1919 (remhash omsg (gethash ofolder mh-index-data))))) 1919 (when (gethash ofolder mh-index-data)
1920 (remhash omsg (gethash ofolder mh-index-data))))))
1920 (t 1921 (t
1921 (setf (gethash msg mh-index-msg-checksum-map) checksum) 1922 (setf (gethash msg mh-index-msg-checksum-map) checksum)
1922 (when origin-map 1923 (when (and origin-map (gethash msg origin-map))
1923 (setf (gethash checksum mh-index-checksum-origin-map) 1924 (setf (gethash checksum mh-index-checksum-origin-map)
1924 (gethash msg origin-map)))))) 1925 (gethash msg origin-map))))))
1925 1926
1927
1926(provide 'mh-search) 1928(provide 'mh-search)
1927 1929
1928;; Local Variables: 1930;; Local Variables:
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index b23a8f3f613..c45c214e9f0 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -82,81 +82,6 @@ used in lieu of `search' in the CL package."
82 (delete-region (point) (progn (forward-line lines) (point)))) 82 (delete-region (point) (progn (forward-line lines) (point))))
83 83
84;;;###mh-autoload 84;;;###mh-autoload
85(defun mh-image-load-path-for-library (library image &optional path)
86 "Return a suitable search path for images of LIBRARY.
87
88Images for LIBRARY are searched for in \"../../etc/images\" and
89\"../etc/images\" relative to the files in \"lisp/LIBRARY\", in
90`image-load-path', or in `load-path'.
91
92This function returns value of `load-path' augmented with the
93path to IMAGE. If PATH is given, it is used instead of
94`load-path'.
95
96Here is an example that uses a common idiom to provide
97compatibility with versions of Emacs that lack the variable
98`image-load-path':
99
100 (let ((load-path
101 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'load-path))
102 (image-load-path
103 (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path)))
104 (mh-tool-bar-folder-buttons-init))"
105 (unless library (error "No library specified"))
106 (unless image (error "No image specified"))
107 (let ((image-directory))
108 (cond
109 ;; Try relative setting.
110 ((let (library-name d1ei d2ei)
111 ;; First, find library in the load-path.
112 (setq library-name (locate-library library))
113 (if (not library-name)
114 (error "Cannot find library %s in load-path" library))
115 ;; And then set image-directory relative to that.
116 (setq
117 ;; Go down 2 levels.
118 d2ei (expand-file-name
119 (concat (file-name-directory library-name) "../../etc/images"))
120 ;; Go down 1 level.
121 d1ei (expand-file-name
122 (concat (file-name-directory library-name) "../etc/images")))
123 (setq image-directory
124 ;; Set it to nil if image is not found.
125 (cond ((file-exists-p (expand-file-name image d2ei)) d2ei)
126 ((file-exists-p (expand-file-name image d1ei)) d1ei)))))
127 ;; Check for images in image-load-path or load-path.
128 ((let ((img image)
129 (dir (or
130 ;; Images in image-load-path.
131 (mh-image-search-load-path image)
132 ;; Images in load-path.
133 (locate-library image)))
134 parent)
135 ;; Since the image might be in a nested directory (for
136 ;; example, mail/attach.pbm), adjust `image-directory'
137 ;; accordingly.
138 (and dir
139 (setq dir (file-name-directory dir))
140 (progn
141 (while (setq parent (file-name-directory img))
142 (setq img (directory-file-name parent)
143 dir (expand-file-name "../" dir)))
144 (setq image-directory dir)))))
145 (t
146 (error "Could not find image %s for library %s" image library)))
147
148 ;; Return augmented `image-load-path' or `load-path'.
149 (cond ((and path (symbolp path))
150 (nconc (list image-directory)
151 (delete image-directory
152 (if (boundp path)
153 (copy-sequence (symbol-value path))
154 nil))))
155 (t
156 (nconc (list image-directory)
157 (delete image-directory (copy-sequence load-path)))))))
158
159;;;###mh-autoload
160(defun mh-make-local-vars (&rest pairs) 85(defun mh-make-local-vars (&rest pairs)
161 "Initialize local variables according to the variable-value PAIRS." 86 "Initialize local variables according to the variable-value PAIRS."
162 (while pairs 87 (while pairs
@@ -206,8 +131,7 @@ Ignores case when searching for OLD."
206(defun mh-logo-display () 131(defun mh-logo-display ()
207 "Modify mode line to display MH-E logo." 132 "Modify mode line to display MH-E logo."
208 (mh-do-in-gnu-emacs 133 (mh-do-in-gnu-emacs
209 (let ((load-path (mh-image-load-path-for-library 134 (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
210 "mh-e" "mh-logo.xpm" 'load-path))
211 (image-load-path (mh-image-load-path-for-library 135 (image-load-path (mh-image-load-path-for-library
212 "mh-e" "mh-logo.xpm" 'image-load-path))) 136 "mh-e" "mh-logo.xpm" 'image-load-path)))
213 (add-text-properties 137 (add-text-properties
@@ -490,7 +414,8 @@ names and the function is called when OUTPUT is available."
490 do (progn (setf (cdr x) t) (return))))))) 414 do (progn (setf (cdr x) t) (return)))))))
491 415
492(defun mh-normalize-folder-name (folder &optional empty-string-okay 416(defun mh-normalize-folder-name (folder &optional empty-string-okay
493 dont-remove-trailing-slash) 417 dont-remove-trailing-slash
418 return-nil-if-folder-empty)
494 "Normalizes FOLDER name. 419 "Normalizes FOLDER name.
495 420
496Makes sure that two '/' characters never occur next to each 421Makes sure that two '/' characters never occur next to each
@@ -503,8 +428,19 @@ empty string then nothing is added.
503 428
504If optional argument DONT-REMOVE-TRAILING-SLASH is non-nil then a 429If optional argument DONT-REMOVE-TRAILING-SLASH is non-nil then a
505trailing '/' if present is retained (if present), otherwise it is 430trailing '/' if present is retained (if present), otherwise it is
506removed." 431removed.
507 (when (stringp folder) 432
433If optional argument RETURN-NIL-IF-FOLDER-EMPTY is non-nil, then
434return nil if FOLDER is \"\" or \"+\". This is useful when
435normalizing the folder for the \"folders\" command which displays
436the directories in / if passed \"+\". This is usually not
437desired. If this argument is non-nil, then EMPTY-STRING-OKAY has
438no effect."
439 (cond
440 ((if (and (or (equal folder "+") (equal folder ""))
441 return-nil-if-folder-empty)
442 (setq folder nil)))
443 ((stringp folder)
508 ;; Replace two or more consecutive '/' characters with a single '/' 444 ;; Replace two or more consecutive '/' characters with a single '/'
509 (while (string-match "//" folder) 445 (while (string-match "//" folder)
510 (setq folder (replace-match "/" nil t folder))) 446 (setq folder (replace-match "/" nil t folder)))
@@ -517,10 +453,11 @@ removed."
517 (stringp mh-current-folder-name)) 453 (stringp mh-current-folder-name))
518 (setq folder (format "%s/%s/" mh-current-folder-name 454 (setq folder (format "%s/%s/" mh-current-folder-name
519 (substring folder 1)))) 455 (substring folder 1))))
520 ;; XXX: Purge empty strings from the list that split-string returns. In 456 ;; XXX: Purge empty strings from the list that split-string
521 ;; XEmacs, (split-string "+foo/" "/") returns ("+foo" "") while in GNU 457 ;; returns. In XEmacs, (split-string "+foo/" "/") returns
522 ;; Emacs it returns ("+foo"). In the code it is assumed that the 458 ;; ("+foo" "") while in GNU Emacs it returns ("+foo"). In the
523 ;; components list has no empty strings. 459 ;; code it is assumed that the components list has no empty
460 ;; strings.
524 (let ((components (delete "" (split-string folder "/"))) 461 (let ((components (delete "" (split-string folder "/")))
525 (result ())) 462 (result ()))
526 ;; Remove .. and . from the pathname. 463 ;; Remove .. and . from the pathname.
@@ -540,8 +477,10 @@ removed."
540 (when leading-slash-present 477 (when leading-slash-present
541 (setq folder (concat "/" folder))))) 478 (setq folder (concat "/" folder)))))
542 (cond ((and empty-string-okay (equal folder ""))) 479 (cond ((and empty-string-okay (equal folder "")))
543 ((equal folder "") (setq folder "+")) 480 ((equal folder "")
544 ((not (equal (aref folder 0) ?+)) (setq folder (concat "+" folder))))) 481 (setq folder "+"))
482 ((not (equal (aref folder 0) ?+))
483 (setq folder (concat "+" folder))))))
545 folder) 484 folder)
546 485
547(defmacro mh-children-p (folder) 486(defmacro mh-children-p (folder)
@@ -571,23 +510,25 @@ Respects the value of `mh-recursive-folders-flag'. If this flag
571is nil, and the sub-folders have not been explicitly viewed, then 510is nil, and the sub-folders have not been explicitly viewed, then
572they will not be returned." 511they will not be returned."
573 (let ((folder-list)) 512 (let ((folder-list))
574 ;; Normalize folder. Strip leading +. Add trailing slash (done in 513 ;; Normalize folder. Strip leading + and trailing slash(es). If no
575 ;; two steps to avoid infinite loops when replacing "/*$" with "/" 514 ;; folder is specified, ensure it is nil to avoid adding the
576 ;; in XEmacs). If no folder is specified, ensure it is nil to 515 ;; folder to the folder-list and adding a slash to it.
577 ;; ensure we get the top-level folders; otherwise mh-sub-folders
578 ;; returns all the files in / if given an empty string or +.
579 (when folder 516 (when folder
580 (setq folder (mh-replace-regexp-in-string "^\+" "" folder)) 517 (setq folder (mh-replace-regexp-in-string "^\+" "" folder))
581 (setq folder (mh-replace-regexp-in-string "/+$" "" folder))) 518 (setq folder (mh-replace-regexp-in-string "/+$" "" folder))
519 (if (equal folder "")
520 (setq folder nil)))
582 ;; Add provided folder to list, unless all folders are asked for. 521 ;; Add provided folder to list, unless all folders are asked for.
522 ;; Then append slash to separate sub-folders.
583 (unless (null folder) 523 (unless (null folder)
584 (setq folder-list (list folder))) 524 (setq folder-list (list folder))
525 (setq folder (concat folder "/")))
585 (loop for f in (mh-sub-folders folder) do 526 (loop for f in (mh-sub-folders folder) do
586 (setq folder-list 527 (setq folder-list
587 (append folder-list 528 (append folder-list
588 (if (mh-children-p f) 529 (if (mh-children-p f)
589 (mh-folder-list (concat folder "/" (car f))) 530 (mh-folder-list (concat folder (car f)))
590 (list (concat folder "/" (car f))))))) 531 (list (concat folder (car f)))))))
591 folder-list)) 532 folder-list))
592 533
593;;;###mh-autoload 534;;;###mh-autoload
@@ -599,7 +540,7 @@ results of the actual folders call.
599If optional argument ADD-TRAILING-SLASH-FLAG is non-nil then a 540If optional argument ADD-TRAILING-SLASH-FLAG is non-nil then a
600slash is added to each of the sub-folder names that may have 541slash is added to each of the sub-folder names that may have
601nested folders within them." 542nested folders within them."
602 (let* ((folder (mh-normalize-folder-name folder)) 543 (let* ((folder (mh-normalize-folder-name folder nil nil t))
603 (match (gethash folder mh-sub-folders-cache 'no-result)) 544 (match (gethash folder mh-sub-folders-cache 'no-result))
604 (sub-folders (cond ((eq match 'no-result) 545 (sub-folders (cond ((eq match 'no-result)
605 (setf (gethash folder mh-sub-folders-cache) 546 (setf (gethash folder mh-sub-folders-cache)
diff --git a/lisp/outline.el b/lisp/outline.el
index fdbad00ada3..92542bae7e3 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -46,7 +46,7 @@
46 :group 'editing) 46 :group 'editing)
47 47
48(defcustom outline-regexp "[*\^L]+" 48(defcustom outline-regexp "[*\^L]+"
49 "*Regular expression to match the beginning of a heading. 49 "Regular expression to match the beginning of a heading.
50Any line whose beginning matches this regexp is considered to start a heading. 50Any line whose beginning matches this regexp is considered to start a heading.
51Note that Outline mode only checks this regexp at the start of a line, 51Note that Outline mode only checks this regexp at the start of a line,
52so the regexp need not (and usually does not) start with `^'. 52so the regexp need not (and usually does not) start with `^'.
@@ -56,7 +56,7 @@ in the file it applies to. See also `outline-heading-end-regexp'."
56 :group 'outlines) 56 :group 'outlines)
57 57
58(defcustom outline-heading-end-regexp "\n" 58(defcustom outline-heading-end-regexp "\n"
59 "*Regular expression to match the end of a heading line. 59 "Regular expression to match the end of a heading line.
60You can assume that point is at the beginning of a heading when this 60You can assume that point is at the beginning of a heading when this
61regexp is searched for. The heading ends at the end of the match. 61regexp is searched for. The heading ends at the end of the match.
62The recommended way to set this is with a `Local Variables:' list 62The recommended way to set this is with a `Local Variables:' list
@@ -828,7 +828,13 @@ Show the heading too, if it is currently invisible."
828 828
829(defun hide-sublevels (levels) 829(defun hide-sublevels (levels)
830 "Hide everything but the top LEVELS levels of headers, in whole buffer." 830 "Hide everything but the top LEVELS levels of headers, in whole buffer."
831 (interactive "p") 831 (interactive (list
832 (cond
833 (current-prefix-arg (prefix-numeric-value current-prefix-arg))
834 ((save-excursion (beginning-of-line)
835 (looking-at outline-regexp))
836 (funcall outline-level))
837 (t 1))))
832 (if (< levels 1) 838 (if (< levels 1)
833 (error "Must keep at least one level of headers")) 839 (error "Must keep at least one level of headers"))
834 (let (outline-view-change-hook) 840 (let (outline-view-change-hook)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index cbff1835ca6..4340892a9cc 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -796,7 +796,12 @@ type=\"\\(.*?\\)\"")
796 (concat "server interpreter mi \"-var-assign " 796 (concat "server interpreter mi \"-var-assign "
797 varnum " " value "\"\n") 797 varnum " " value "\"\n")
798 (concat "-var-assign " varnum " " value "\n")) 798 (concat "-var-assign " varnum " " value "\n"))
799 'ignore)))) 799 `(lambda () (gdb-edit-value-handler ,value))))))
800
801(defun gdb-edit-value-handler (value)
802 (goto-char (point-min))
803 (if (re-search-forward gdb-error-regexp nil t)
804 (message-box "Invalid number or expression (%s)" value)))
800 805
801(defcustom gdb-show-changed-values t 806(defcustom gdb-show-changed-values t
802 "If non-nil change the face of out of scope variables and changed values. 807 "If non-nil change the face of out of scope variables and changed values.
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 31c8fe0e8a2..41bb24f9e61 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -399,7 +399,7 @@ t means that there is no stack, and we are in display-file mode.")
399 gud-speedbar-key-map 399 gud-speedbar-key-map
400 gud-expansion-speedbar-buttons)) 400 gud-expansion-speedbar-buttons))
401 401
402 (add-to-list 402 (add-to-list
403 'speedbar-mode-functions-list 403 'speedbar-mode-functions-list
404 '("GUD" (speedbar-item-info . gud-speedbar-item-info) 404 '("GUD" (speedbar-item-info . gud-speedbar-item-info)
405 (speedbar-line-directory . ignore)))) 405 (speedbar-line-directory . ignore))))
@@ -493,11 +493,15 @@ required by the caller."
493 'bracket char 493 'bracket char
494 'gdb-speedbar-expand-node varnum 494 'gdb-speedbar-expand-node varnum
495 (concat expr "\t" type "\t" value) 495 (concat expr "\t" type "\t" value)
496 (if (or parent status) 496 (if (or parent (eq status 'out-of-scope))
497 nil 'gdb-edit-value) 497 nil 'gdb-edit-value)
498 nil 498 nil
499 (if (and (or parent (eq status 'out-of-scope)) 499 (if gdb-show-changed-values
500 gdb-show-changed-values) 'shadow t) 500 (or parent (case status
501 (changed 'font-lock-warning-face)
502 (out-of-scope 'shadow)
503 (t t)))
504 t)
501 depth) 505 depth)
502 (speedbar-make-tag-line 506 (speedbar-make-tag-line
503 'bracket char 507 'bracket char
@@ -684,7 +688,7 @@ To run GDB in text command mode, set `gud-gdb-command-name' to
684 (buffer-name gud-comint-buffer) 688 (buffer-name gud-comint-buffer)
685 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))) 689 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
686 (error "Multiple debugging is only supported with \"gdb --fullname\"")) 690 (error "Multiple debugging is only supported with \"gdb --fullname\""))
687 691
688 (gud-common-init command-line nil 'gud-gdb-marker-filter) 692 (gud-common-init command-line nil 'gud-gdb-marker-filter)
689 (set (make-local-variable 'gud-minor-mode) 'gdb) 693 (set (make-local-variable 'gud-minor-mode) 'gdb)
690 694
@@ -2152,7 +2156,7 @@ nil)
2152 ;; print line numbers using LOCALE, inserting a comma or a 2156 ;; print line numbers using LOCALE, inserting a comma or a
2153 ;; period at the thousands positions (how ingenious!). 2157 ;; period at the thousands positions (how ingenious!).
2154 2158
2155 "\\(\[[0-9]+\] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \ 2159 "\\(\\[[0-9]+] \\)*\\([a-zA-Z0-9.$_]+\\)\\.[a-zA-Z0-9$_<>(),]+ \
2156\\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)" 2160\\(([a-zA-Z0-9.$_]+:\\|line=\\)\\([0-9.,]+\\)"
2157 gud-marker-acc) 2161 gud-marker-acc)
2158 2162
@@ -3372,7 +3376,7 @@ For C this would dereference a pointer expression.")
3372 "The mouse movement event that led to a tooltip display. 3376 "The mouse movement event that led to a tooltip display.
3373This event can be examined by forms in GUD-TOOLTIP-DISPLAY.") 3377This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
3374 3378
3375(defun gud-tooltip-dereference () 3379(defun gud-tooltip-dereference (&optional arg)
3376 "Toggle whether tooltips should show `* expr' or `expr'. 3380 "Toggle whether tooltips should show `* expr' or `expr'.
3377With arg, dereference expr iff arg is positive." 3381With arg, dereference expr iff arg is positive."
3378 (interactive "P") 3382 (interactive "P")
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index 2dae9d1f977..17d486749b3 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -6,7 +6,7 @@
6 6
7;; Copyright (C) 1994,1995 Alessandro Rubini <rubini@linux.it> 7;; Copyright (C) 1994,1995 Alessandro Rubini <rubini@linux.it>
8;; parts are by Ian T Zimmermann <itz@rahul.net>, 1995,1998 8;; parts are by Ian T Zimmermann <itz@rahul.net>, 1995,1998
9;; Copyright (C) 2006 9;; Copyright (C) 2006
10;; Free Software Foundation, Inc. 10;; Free Software Foundation, Inc.
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -29,15 +29,15 @@
29;;; Commentary: 29;;; Commentary:
30 30
31;; This package provides access to mouse event as reported by the 31;; This package provides access to mouse event as reported by the
32;; gpm-Linux package. It uses the program "mev" to get mouse events. 32;; gpm-Linux package. It uses the program "mev" to get mouse events.
33;; It tries to reproduce the functionality offered by emacs under X. 33;; It tries to reproduce the functionality offered by Emacs under X.
34;; The "gpm" server runs under Linux, so this package is rather 34;; The "gpm" server runs under Linux, so this package is rather
35;; Linux-dependent. 35;; Linux-dependent.
36 36
37;; Modified by Nick Roberts for Emacs 22. In particular, the mode-line is 37;; Modified by Nick Roberts for Emacs 22. In particular, the mode-line is
38;; now position sensitive. 38;; now position sensitive.
39 39
40(defvar t-mouse-process nil 40(defvar t-mouse-process nil
41 "Embeds the process which passes mouse events to emacs. 41 "Embeds the process which passes mouse events to emacs.
42It is used by the program t-mouse.") 42It is used by the program t-mouse.")
43 43
@@ -53,7 +53,7 @@ See `t-mouse-start-debug'.")
53 53
54(defvar t-mouse-drag-start nil 54(defvar t-mouse-drag-start nil
55 "Whenever a drag starts in a special part of a window 55 "Whenever a drag starts in a special part of a window
56(not the text), the `translated' starting coordinates including the 56\(not the text), the `translated' starting coordinates including the
57window and part involved are saved here. This is necessary lest they 57window and part involved are saved here. This is necessary lest they
58get re-translated when the button goes up, at which time window 58get re-translated when the button goes up, at which time window
59configuration may have changed.") 59configuration may have changed.")
@@ -63,10 +63,10 @@ configuration may have changed.")
63 63
64(defvar t-mouse-swap-alt-keys nil 64(defvar t-mouse-swap-alt-keys nil
65 "When set, Emacs will handle mouse events with the right Alt 65 "When set, Emacs will handle mouse events with the right Alt
66(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. 66\(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier.
67Useful for people who play strange games with their keyboard tables.") 67Useful for people who play strange games with their keyboard tables.")
68 68
69(defvar t-mouse-fix-21 nil 69(defvar t-mouse-fix-21 nil
70 "Enable brain-dead chords for 2 button mice.") 70 "Enable brain-dead chords for 2 button mice.")
71 71
72 72
@@ -75,7 +75,7 @@ Useful for people who play strange games with their keyboard tables.")
75;; get the number of the current virtual console 75;; get the number of the current virtual console
76 76
77(defun t-mouse-tty () 77(defun t-mouse-tty ()
78 "Returns number of virtual terminal Emacs is running on, as a string. 78 "Return number of virtual terminal Emacs is running on, as a string.
79For example, \"2\" for /dev/tty2." 79For example, \"2\" for /dev/tty2."
80 (with-temp-buffer 80 (with-temp-buffer
81 (call-process "ps" nil t nil "h" (format "%s" (emacs-pid))) 81 (call-process "ps" nil t nil "h" (format "%s" (emacs-pid)))
@@ -148,8 +148,8 @@ For example, \"2\" for /dev/tty2."
148 148
149;;; This fun is partly Copyright (C) 1994 Per Abrahamsen <abraham@iesd.auc.dk> 149;;; This fun is partly Copyright (C) 1994 Per Abrahamsen <abraham@iesd.auc.dk>
150(defun t-mouse-make-event () 150(defun t-mouse-make-event ()
151 "Makes a Lisp style event from the contents of mouse input accumulator. 151 "Make a Lisp style event from the contents of mouse input accumulator.
152Also trims the accumulator by all the data used to build the event." 152Also trim the accumulator by all the data used to build the event."
153 (let (ob (ob-pos (condition-case nil 153 (let (ob (ob-pos (condition-case nil
154 (progn 154 (progn
155 ;; this test is just needed for Fedora Core 3 155 ;; this test is just needed for Fedora Core 3
@@ -185,13 +185,13 @@ Also trims the accumulator by all the data used to build the event."
185 (progn 185 (progn
186 (setq end-of-root-event-name (match-beginning 0)) 186 (setq end-of-root-event-name (match-beginning 0))
187 (setq new-event-name-string 187 (setq new-event-name-string
188 (concat (substring 188 (concat (substring
189 event-name-string 0 189 event-name-string 0
190 end-of-root-event-name) "-3")) 190 end-of-root-event-name) "-3"))
191 191
192 ;;Change the event to the symbol that corresponds to the 192 ;;Change the event to the symbol that corresponds to the
193 ;;name we made. The proper symbol already exists. 193 ;;name we made. The proper symbol already exists.
194 (setq event-type 194 (setq event-type
195 (intern new-event-name-string)))))) 195 (intern new-event-name-string))))))
196 196
197 ;;store current position for mouse-position 197 ;;store current position for mouse-position
@@ -231,7 +231,7 @@ Also trims the accumulator by all the data used to build the event."
231 (concat t-mouse-filter-accumulator string)) 231 (concat t-mouse-filter-accumulator string))
232 (let ((event (t-mouse-make-event))) 232 (let ((event (t-mouse-make-event)))
233 (while event 233 (while event
234 (if (or track-mouse 234 (if (or track-mouse
235 (not (eq 'mouse-movement (event-basic-type event)))) 235 (not (eq 'mouse-movement (event-basic-type event))))
236 (setq unread-command-events 236 (setq unread-command-events
237 (nconc unread-command-events (list event)))) 237 (nconc unread-command-events (list event))))
@@ -249,7 +249,7 @@ The (secret) scrollbar interface is not implemented yet."
249;; stop-process. That doesn't work; mev receives the signal fine but 249;; stop-process. That doesn't work; mev receives the signal fine but
250;; is not really stopped: instead it returns from 250;; is not really stopped: instead it returns from
251;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up 251;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up
252;; itz Tue Mar 24 14:27:38 PST 1998. 252;; itz Tue Mar 24 14:27:38 PST 1998.
253 253
254(add-hook 'suspend-hook 254(add-hook 'suspend-hook
255 (function (lambda () 255 (function (lambda ()
@@ -281,8 +281,8 @@ Turn it on to use emacs mouse commands, and off to use t-mouse commands."
281 (let ((tty (t-mouse-tty)) 281 (let ((tty (t-mouse-tty))
282 (process-connection-type t)) 282 (process-connection-type t))
283 (if (not (stringp tty)) 283 (if (not (stringp tty))
284 (error "Cannot find a virtual terminal.")) 284 (error "Cannot find a virtual terminal"))
285 (setq t-mouse-process 285 (setq t-mouse-process
286 (start-process "t-mouse" nil 286 (start-process "t-mouse" nil
287 "mev" "-i" "-E" "-C" tty 287 "mev" "-i" "-E" "-C" tty
288 (if t-mouse-swap-alt-keys 288 (if t-mouse-swap-alt-keys
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index cc822ddb436..717455edc61 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 4.07 8;; Version: 4.08
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -81,6 +81,9 @@
81;; 81;;
82;; Changes since version 4.00: 82;; Changes since version 4.00:
83;; --------------------------- 83;; ---------------------------
84;; Version 4.08
85;;
86;;
84;; Version 4.07 87;; Version 4.07
85;; - Bug fixes. 88;; - Bug fixes.
86;; - Leading stars in headlines can be hidden, so make the outline look 89;; - Leading stars in headlines can be hidden, so make the outline look
@@ -136,7 +139,7 @@
136 139
137;;; Customization variables 140;;; Customization variables
138 141
139(defvar org-version "4.07" 142(defvar org-version "4.08"
140 "The version number of the file org.el.") 143 "The version number of the file org.el.")
141(defun org-version () 144(defun org-version ()
142 (interactive) 145 (interactive)
@@ -796,7 +799,7 @@ as possible."
796(defcustom org-level-color-stars-only nil 799(defcustom org-level-color-stars-only nil
797 "Non-nil means fontify only the stars in each headline. 800 "Non-nil means fontify only the stars in each headline.
798When nil, the entire headline is fontified. 801When nil, the entire headline is fontified.
799Changing it requires restart of Emacs to become effective." 802Changing it requires restart of `font-lock-mode' to become effective."
800 :group 'org-structure 803 :group 'org-structure
801 :type 'boolean) 804 :type 'boolean)
802 805
@@ -806,7 +809,7 @@ This works by using the face `org-hide' for these stars. This
806face is white for a light background, and black for a dark 809face is white for a light background, and black for a dark
807background. You may have to customize the face `org-hide' to 810background. You may have to customize the face `org-hide' to
808make this work. 811make this work.
809Changing the variable requires restart of Emacs to become effective." 812Changing it requires restart of `font-lock-mode' to become effective."
810 :group 'org-structure 813 :group 'org-structure
811 :type 'boolean) 814 :type 'boolean)
812 815
@@ -814,7 +817,9 @@ Changing the variable requires restart of Emacs to become effective."
814 "Non-nil means, skip even levels and only use odd levels for the outline. 817 "Non-nil means, skip even levels and only use odd levels for the outline.
815This has the effect that two stars are being added/taken away in 818This has the effect that two stars are being added/taken away in
816promotion/demotion commands. It also influences how levels are 819promotion/demotion commands. It also influences how levels are
817handled by the exporters." 820handled by the exporters.
821Changing it requires restart of `font-lock-mode' to become effective
822for fontification."
818 :group 'org-structure 823 :group 'org-structure
819 :type 'boolean) 824 :type 'boolean)
820 825
@@ -1157,6 +1162,14 @@ For more examples, see the system specific constants
1157 (string :tag "Command") 1162 (string :tag "Command")
1158 (sexp :tag "Lisp form"))))) 1163 (sexp :tag "Lisp form")))))
1159 1164
1165(defcustom org-mhe-search-all-folders nil
1166 "Non-nil means, that the search for the mh-message will be extended to
1167all folders if the message cannot be found in the folder given in the link.
1168Searching all folders is very effective with one of the search engines
1169supported by MH-E, but will be slow with pick."
1170 :group 'org-link
1171 :type 'boolean)
1172
1160(defgroup org-remember nil 1173(defgroup org-remember nil
1161 "Options concerning interaction with remember.el." 1174 "Options concerning interaction with remember.el."
1162 :tag "Org Remember" 1175 :tag "Org Remember"
@@ -1855,6 +1868,14 @@ When this is non-nil, the headline after the keyword is set to the
1855 "Face for links." 1868 "Face for links."
1856 :group 'org-faces) 1869 :group 'org-faces)
1857 1870
1871(defface org-tag
1872 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1873 (((class color) (background light)) (:foreground "Purple" :weight bold))
1874 (((class color) (background dark)) (:foreground "Cyan" :weight bold))
1875 (t (:bold t)))
1876 "Face for links."
1877 :group 'org-faces)
1878
1858(defface org-done ;; font-lock-type-face 1879(defface org-done ;; font-lock-type-face
1859 '((((type tty) (class color)) (:foreground "green")) 1880 '((((type tty) (class color)) (:foreground "green"))
1860 (((class color) (background light)) (:foreground "ForestGreen" :bold t)) 1881 (((class color) (background light)) (:foreground "ForestGreen" :bold t))
@@ -1879,25 +1900,10 @@ When this is non-nil, the headline after the keyword is set to the
1879 "Face used for time grids." 1900 "Face used for time grids."
1880 :group 'org-faces) 1901 :group 'org-faces)
1881 1902
1882(defvar org-level-faces nil) 1903(defvar org-level-faces
1883 1904 '(org-level-1 org-level-2 org-level-3 org-level-4
1884(when (not org-level-faces) 1905 org-level-5 org-level-6 org-level-7 org-level-8
1885 (setq org-level-faces 1906 ))
1886 '(
1887 org-level-1
1888 org-level-2
1889 org-level-3
1890 org-level-4
1891 org-level-5
1892 org-level-6
1893 org-level-7
1894 org-level-8
1895 ))
1896 (when org-odd-levels-only
1897 (setq org-level-faces (apply 'append (mapcar (lambda (x) (list x x))
1898 org-level-faces)))
1899 (setq org-level-faces (append (cdr org-level-faces) (list 'org-level-1)))))
1900
1901(defvar org-n-levels (length org-level-faces)) 1907(defvar org-n-levels (length org-level-faces))
1902 1908
1903(defun org-set-regexps-and-options () 1909(defun org-set-regexps-and-options ()
@@ -1985,48 +1991,48 @@ When this is non-nil, the headline after the keyword is set to the
1985 1991
1986;; Tell the compiler about dynamically scoped variables, 1992;; Tell the compiler about dynamically scoped variables,
1987;; and variables from other packages 1993;; and variables from other packages
1988(eval-when-compile 1994(defvar zmacs-regions)
1989 (defvar zmacs-regions) 1995(defvar original-date)
1990 (defvar original-date) 1996(defvar org-transient-mark-mode)
1991 (defvar org-transient-mark-mode) 1997(defvar org-old-auto-fill-inhibit-regexp)
1992 (defvar org-old-auto-fill-inhibit-regexp) 1998(defvar orgtbl-mode-menu)
1993 (defvar orgtbl-mode-menu) 1999(defvar org-html-entities)
1994 (defvar org-html-entities) 2000(defvar org-goto-start-pos)
1995 (defvar org-goto-start-pos) 2001(defvar org-cursor-color)
1996 (defvar org-cursor-color) 2002(defvar org-time-was-given)
1997 (defvar org-time-was-given) 2003(defvar org-ts-what)
1998 (defvar org-ts-what) 2004(defvar mark-active)
1999 (defvar mark-active) 2005(defvar timecnt)
2000 (defvar timecnt) 2006(defvar levels-open)
2001 (defvar levels-open) 2007(defvar title)
2002 (defvar title) 2008(defvar author)
2003 (defvar author) 2009(defvar email)
2004 (defvar email) 2010(defvar text)
2005 (defvar text) 2011(defvar entry)
2006 (defvar entry) 2012(defvar date)
2007 (defvar date) 2013(defvar language)
2008 (defvar language) 2014(defvar options)
2009 (defvar options) 2015(defvar ans1)
2010 (defvar ans1) 2016(defvar ans2)
2011 (defvar ans2) 2017(defvar starting-day)
2012 (defvar starting-day) 2018(defvar include-all-loc)
2013 (defvar include-all-loc) 2019(defvar vm-message-pointer)
2014 (defvar vm-message-pointer) 2020(defvar vm-folder-directory)
2015 (defvar vm-folder-directory) 2021(defvar wl-summary-buffer-elmo-folder)
2016 (defvar wl-summary-buffer-elmo-folder) 2022(defvar wl-summary-buffer-folder-name)
2017 (defvar wl-summary-buffer-folder-name) 2023(defvar gnus-group-name)
2018 (defvar gnus-group-name) 2024(defvar gnus-article-current)
2019 (defvar gnus-article-current) 2025(defvar w3m-current-url)
2020 (defvar w3m-current-url) 2026(defvar mh-progs)
2021 (defvar mh-progs) 2027(defvar mh-current-folder)
2022 (defvar mh-current-folder) 2028(defvar mh-show-folder-buffer)
2023 (defvar mh-show-folder-buffer) 2029(defvar mh-index-folder)
2024 (defvar mh-index-folder) 2030(defvar mh-searcher)
2025 (defvar org-selected-point) 2031(defvar org-selected-point)
2026 (defvar calendar-mode-map) 2032(defvar calendar-mode-map)
2027 (defvar remember-save-after-remembering) 2033(defvar remember-save-after-remembering)
2028 (defvar remember-data-file) 2034(defvar remember-data-file)
2029 (defvar last-arg)) 2035(defvar last-arg)
2030 2036
2031;;; Define the mode 2037;;; Define the mode
2032 2038
@@ -2216,7 +2222,7 @@ The following commands are available:
2216 2222
2217(defun org-activate-target-links (limit) 2223(defun org-activate-target-links (limit)
2218 "Run through the buffer and add overlays to target matches." 2224 "Run through the buffer and add overlays to target matches."
2219 (when org-radio-targets 2225 (when (and org-radio-targets org-target-link-regexp)
2220 (let ((case-fold-search t)) 2226 (let ((case-fold-search t))
2221 (if (re-search-forward org-target-link-regexp limit t) 2227 (if (re-search-forward org-target-link-regexp limit t)
2222 (progn 2228 (progn
@@ -2253,16 +2259,17 @@ With optional argument RADIO, only find radio targets."
2253 "Make regular expression matching all strings in TARGETS. 2259 "Make regular expression matching all strings in TARGETS.
2254The regular expression finds the targets also if there is a line break 2260The regular expression finds the targets also if there is a line break
2255between words." 2261between words."
2256 (concat 2262 (and targets
2257 "\\<\\(" 2263 (concat
2258 (mapconcat 2264 "\\<\\("
2259 (lambda (x) 2265 (mapconcat
2260 (while (string-match " +" x) 2266 (lambda (x)
2261 (setq x (replace-match "\\s-+" t t x))) 2267 (while (string-match " +" x)
2262 x) 2268 (setq x (replace-match "\\s-+" t t x)))
2263 targets 2269 x)
2264 "\\|") 2270 targets
2265 "\\)\\>")) 2271 "\\|")
2272 "\\)\\>")))
2266 2273
2267(defvar org-camel-regexp "\\*?\\<[A-Z]+[a-z]+[A-Z][a-zA-Z]*\\>" 2274(defvar org-camel-regexp "\\*?\\<[A-Z]+[a-z]+[A-Z][a-zA-Z]*\\>"
2268 "Matches CamelCase words, possibly with a star before it.") 2275 "Matches CamelCase words, possibly with a star before it.")
@@ -2302,12 +2309,14 @@ between words."
2302(defun org-set-font-lock-defaults () 2309(defun org-set-font-lock-defaults ()
2303 (let ((org-font-lock-extra-keywords 2310 (let ((org-font-lock-extra-keywords
2304 (list 2311 (list
2312 '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
2313 (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
2305 '(org-activate-links (0 'org-link t)) 2314 '(org-activate-links (0 'org-link t))
2306 '(org-activate-links2 (0 'org-link t)) 2315 '(org-activate-links2 (0 'org-link t))
2307 '(org-activate-target-links (0 'org-link t)) 2316 '(org-activate-target-links (0 'org-link t))
2308 '(org-activate-dates (0 'org-link t)) 2317 '(org-activate-dates (0 'org-link t))
2309 '(org-activate-camels (0 'org-link t)) 2318 '(org-activate-camels (0 'org-link t))
2310 '(org-activate-tags (1 'org-link t)) 2319 '(org-activate-tags (1 'org-tag t))
2311 (list (concat "^\\*+[ \t]*" org-not-done-regexp) 2320 (list (concat "^\\*+[ \t]*" org-not-done-regexp)
2312 '(1 'org-warning t)) 2321 '(1 'org-warning t))
2313 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t)) 2322 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
@@ -2334,30 +2343,28 @@ between words."
2334 '("^[ \t]*\\(:.*\\)" (1 'org-table t)) 2343 '("^[ \t]*\\(:.*\\)" (1 'org-table t))
2335 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t)) 2344 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
2336 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t)) 2345 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
2337 )) 2346 )))
2338 (exp 2347
2339 ;; The font-lock expression for headlines is complicated. It depends
2340 ;; on two user options, and it needs to determine the level in
2341 ;; order to compute the level.
2342 (cond
2343 ((and org-level-color-stars-only (not org-hide-leading-stars))
2344 '("^\\(\\*+\\).*" 1 (nth (% (- (match-end 1) (match-beginning 1) 1) org-n-levels) org-level-faces) nil t))
2345 ((and (not org-level-color-stars-only) org-hide-leading-stars)
2346 '("^\\(\\**\\)\\(\\*.*\\)" (1 'org-hide) (2 (nth (% (- (match-end 1) (match-beginning 1)) org-n-levels) org-level-faces) nil t)))
2347 ((and org-level-color-stars-only org-hide-leading-stars)
2348 '("^\\(\\**\\)\\(\\*\\).*" (1 'org-hide) (2 (nth (% (- (match-end 1) (match-beginning 1)) org-n-levels) org-level-faces) nil t)))
2349 (t
2350 '("^\\(\\*+\\).*" 0 (nth (% (- (match-end 1) (match-beginning 1) 1) org-n-levels) org-level-faces) nil t)))))
2351
2352 ;; Now set the full font-lock-keywords 2348 ;; Now set the full font-lock-keywords
2353 (set (make-local-variable 'org-font-lock-keywords) 2349 (set (make-local-variable 'org-font-lock-keywords)
2354 (append 2350 org-font-lock-extra-keywords)
2355 (if org-xemacs-p (list exp) (list (cons 'eval (list 'quote exp))))
2356 org-font-lock-extra-keywords))
2357 (set (make-local-variable 'font-lock-defaults) 2351 (set (make-local-variable 'font-lock-defaults)
2358 '(org-font-lock-keywords t nil nil backward-paragraph)) 2352 '(org-font-lock-keywords t nil nil backward-paragraph))
2359 (kill-local-variable 'font-lock-keywords) nil)) 2353 (kill-local-variable 'font-lock-keywords) nil))
2360 2354
2355(defvar org-m nil)
2356(defvar org-l nil)
2357(defvar org-f nil)
2358(defun org-get-level-face (n)
2359 "Get the right face for match N in font-lock matching of healdines."
2360 (setq org-l (- (match-end 2) (match-beginning 1)))
2361 (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
2362 (setq org-f (nth (1- (% org-l org-n-levels)) org-level-faces))
2363 (cond
2364 ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
2365 ((eq n 2) org-f)
2366 (t (if org-level-color-stars-only nil org-f))))
2367
2361(defun org-unfontify-region (beg end &optional maybe_loudly) 2368(defun org-unfontify-region (beg end &optional maybe_loudly)
2362 "Remove fontification and activation overlays from links." 2369 "Remove fontification and activation overlays from links."
2363 (font-lock-default-unfontify-region beg end) 2370 (font-lock-default-unfontify-region beg end)
@@ -2463,7 +2470,7 @@ between words."
2463 (save-excursion 2470 (save-excursion
2464 (org-back-to-heading) 2471 (org-back-to-heading)
2465 (outline-up-heading (if (< arg 0) (- arg) 2472 (outline-up-heading (if (< arg 0) (- arg)
2466 (- (outline-level) arg))) 2473 (- (funcall outline-level) arg)))
2467 (org-show-subtree))) 2474 (org-show-subtree)))
2468 2475
2469 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp)) 2476 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp))
@@ -2820,7 +2827,7 @@ in the region."
2820(defun org-map-tree (fun) 2827(defun org-map-tree (fun)
2821 "Call FUN for every heading underneath the current one." 2828 "Call FUN for every heading underneath the current one."
2822 (org-back-to-heading) 2829 (org-back-to-heading)
2823 (let ((level (outline-level))) 2830 (let ((level (funcall outline-level)))
2824 (save-excursion 2831 (save-excursion
2825 (funcall fun) 2832 (funcall fun)
2826 (while (and (progn 2833 (while (and (progn
@@ -3301,7 +3308,7 @@ heading be marked DONE, and the current time will be added."
3301 (if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location) 3308 (if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
3302 (progn 3309 (progn
3303 (setq file (format (match-string 1 org-archive-location) 3310 (setq file (format (match-string 1 org-archive-location)
3304 (file-name-nondirectory (buffer-file-name))) 3311 (file-name-nondirectory buffer-file-name))
3305 heading (match-string 2 org-archive-location))) 3312 heading (match-string 2 org-archive-location)))
3306 (error "Invalid `org-archive-location'")) 3313 (error "Invalid `org-archive-location'"))
3307 (if (> (length file) 0) 3314 (if (> (length file) 0)
@@ -3468,7 +3475,10 @@ At all other locations, this simply calls `ispell-complete-word'."
3468 (message "Making completion list...") 3475 (message "Making completion list...")
3469 (let ((list (sort (all-completions pattern table) 'string<))) 3476 (let ((list (sort (all-completions pattern table) 'string<)))
3470 (with-output-to-temp-buffer "*Completions*" 3477 (with-output-to-temp-buffer "*Completions*"
3471 (display-completion-list list))) 3478 (condition-case nil
3479 ;; Protection needed for XEmacs and emacs 21
3480 (display-completion-list list pattern)
3481 (error (display-completion-list list)))))
3472 (message "Making completion list...%s" "done")))))) 3482 (message "Making completion list...%s" "done"))))))
3473 3483
3474;;; Comments, TODO and DEADLINE 3484;;; Comments, TODO and DEADLINE
@@ -4491,7 +4501,7 @@ first press `1' to indicate that the agenda should be temporarily (until the
4491next use of \\[org-agenda]) restricted to the current file." 4501next use of \\[org-agenda]) restricted to the current file."
4492 (interactive "P") 4502 (interactive "P")
4493 (catch 'exit 4503 (catch 'exit
4494 (let ((restrict-ok (and (buffer-file-name) (eq major-mode 'org-mode))) 4504 (let ((restrict-ok (and buffer-file-name (eq major-mode 'org-mode)))
4495 (custom org-agenda-custom-commands) 4505 (custom org-agenda-custom-commands)
4496 c entry key type string) 4506 c entry key type string)
4497 (put 'org-agenda-files 'org-restrict nil) 4507 (put 'org-agenda-files 'org-restrict nil)
@@ -4526,7 +4536,7 @@ C Configure your own agenda commands")
4526 (message "") 4536 (message "")
4527 (when (equal c ?1) 4537 (when (equal c ?1)
4528 (if restrict-ok 4538 (if restrict-ok
4529 (put 'org-agenda-files 'org-restrict (list (buffer-file-name))) 4539 (put 'org-agenda-files 'org-restrict (list buffer-file-name))
4530 (error "Cannot restrict agenda to current buffer")) 4540 (error "Cannot restrict agenda to current buffer"))
4531 (message "Press key for agenda command%s" 4541 (message "Press key for agenda command%s"
4532 (if restrict-ok " (restricted to current file)" "")) 4542 (if restrict-ok " (restricted to current file)" ""))
@@ -4650,8 +4660,8 @@ dates."
4650 (dotodo include-all) 4660 (dotodo include-all)
4651 (doclosed org-agenda-show-log) 4661 (doclosed org-agenda-show-log)
4652 (org-agenda-keep-modes keep-modes) 4662 (org-agenda-keep-modes keep-modes)
4653 (entry (buffer-file-name)) 4663 (entry buffer-file-name)
4654 (org-agenda-files (list (buffer-file-name))) 4664 (org-agenda-files (list buffer-file-name))
4655 (date (calendar-current-date)) 4665 (date (calendar-current-date))
4656 (win (selected-window)) 4666 (win (selected-window))
4657 (pos1 (point)) 4667 (pos1 (point))
@@ -5178,7 +5188,7 @@ date. It also removes lines that contain only whitespace."
5178 "Make the position visible." 5188 "Make the position visible."
5179 (if (and org-disable-agenda-to-diary ;; called from org-agenda 5189 (if (and org-disable-agenda-to-diary ;; called from org-agenda
5180 (stringp string) 5190 (stringp string)
5181 (buffer-file-name)) 5191 buffer-file-name)
5182 (setq string (org-modify-diary-entry-string string)))))) 5192 (setq string (org-modify-diary-entry-string string))))))
5183 5193
5184(defun org-modify-diary-entry-string (string) 5194(defun org-modify-diary-entry-string (string)
@@ -5190,7 +5200,7 @@ date. It also removes lines that contain only whitespace."
5190 'help-echo 5200 'help-echo
5191 (format 5201 (format
5192 "mouse-2 or RET jump to diary file %s" 5202 "mouse-2 or RET jump to diary file %s"
5193 (abbreviate-file-name (buffer-file-name))) 5203 (abbreviate-file-name buffer-file-name))
5194 'org-agenda-diary-link t 5204 'org-agenda-diary-link t
5195 'org-marker (org-agenda-new-marker (point-at-bol))) 5205 'org-marker (org-agenda-new-marker (point-at-bol)))
5196 string) 5206 string)
@@ -5212,7 +5222,7 @@ If the current buffer visits an agenda file, find the next one in the list.
5212If the current buffer does not, find the first agenda file." 5222If the current buffer does not, find the first agenda file."
5213 (interactive) 5223 (interactive)
5214 (let ((files (append org-agenda-files (list (car org-agenda-files)))) 5224 (let ((files (append org-agenda-files (list (car org-agenda-files))))
5215 (tcf (if (buffer-file-name) (file-truename (buffer-file-name)))) 5225 (tcf (if buffer-file-name (file-truename buffer-file-name)))
5216 file) 5226 file)
5217 (unless files (error "No agenda files")) 5227 (unless files (error "No agenda files"))
5218 (catch 'exit 5228 (catch 'exit
@@ -5223,14 +5233,14 @@ If the current buffer does not, find the first agenda file."
5223 (throw 'exit t)))) 5233 (throw 'exit t))))
5224 (find-file (car org-agenda-files))))) 5234 (find-file (car org-agenda-files)))))
5225 5235
5226(defun org-agenda-file-to-end (&optional file) 5236(defun org-agenda-file-to-end ()
5227 "Move/add the current file to the end of the agenda file list. 5237 "Move/add the current file to the end of the agenda file list.
5228If the file is not present in the list, it is appended to the list. If it is 5238If the file is not present in the list, it is appended to the list. If it is
5229present, it is moved there." 5239present, it is moved there."
5230 (interactive) 5240 (interactive)
5231 (org-agenda-file-to-front 'to-end file)) 5241 (org-agenda-file-to-front 'to-end))
5232 5242
5233(defun org-agenda-file-to-front (&optional to-end file) 5243(defun org-agenda-file-to-front (&optional to-end)
5234 "Move/add the current file to the top of the agenda file list. 5244 "Move/add the current file to the top of the agenda file list.
5235If the file is not present in the list, it is added to the front. If it is 5245If the file is not present in the list, it is added to the front. If it is
5236present, it is moved there. With optional argument TO-END, add/move to the 5246present, it is moved there. With optional argument TO-END, add/move to the
@@ -5239,11 +5249,11 @@ end of the list."
5239 (let ((file-alist (mapcar (lambda (x) 5249 (let ((file-alist (mapcar (lambda (x)
5240 (cons (file-truename x) x)) 5250 (cons (file-truename x) x))
5241 org-agenda-files)) 5251 org-agenda-files))
5242 (ctf (file-truename (buffer-file-name))) 5252 (ctf (file-truename buffer-file-name))
5243 x had) 5253 x had)
5244 (setq x (assoc ctf file-alist) had x) 5254 (setq x (assoc ctf file-alist) had x)
5245 5255
5246 (if (not x) (setq x (cons ctf (abbreviate-file-name (buffer-file-name))))) 5256 (if (not x) (setq x (cons ctf (abbreviate-file-name buffer-file-name))))
5247 (if to-end 5257 (if to-end
5248 (setq file-alist (append (delq x file-alist) (list x))) 5258 (setq file-alist (append (delq x file-alist) (list x)))
5249 (setq file-alist (cons x (delq x file-alist)))) 5259 (setq file-alist (cons x (delq x file-alist))))
@@ -5259,7 +5269,7 @@ end of the list."
5259These are the files which are being checked for agenda entries. 5269These are the files which are being checked for agenda entries.
5260Optional argument FILE means, use this file instead of the current." 5270Optional argument FILE means, use this file instead of the current."
5261 (interactive) 5271 (interactive)
5262 (let* ((file (or file (buffer-file-name))) 5272 (let* ((file (or file buffer-file-name))
5263 (true-file (file-truename file)) 5273 (true-file (file-truename file))
5264 (afile (abbreviate-file-name file)) 5274 (afile (abbreviate-file-name file))
5265 (files (delq nil (mapcar 5275 (files (delq nil (mapcar
@@ -5383,9 +5393,9 @@ function from a program - use `org-agenda-get-day-entries' instead."
5383 (cond 5393 (cond
5384 ((null org-category) 5394 ((null org-category)
5385 (setq org-category 5395 (setq org-category
5386 (if (buffer-file-name) 5396 (if buffer-file-name
5387 (file-name-sans-extension 5397 (file-name-sans-extension
5388 (file-name-nondirectory (buffer-file-name))) 5398 (file-name-nondirectory buffer-file-name))
5389 "???"))) 5399 "???")))
5390 ((symbolp org-category) (symbol-name org-category)) 5400 ((symbolp org-category) (symbol-name org-category))
5391 (t org-category)) 5401 (t org-category))
@@ -5482,7 +5492,7 @@ the documentation of `org-diary'."
5482 'keymap org-agenda-keymap 5492 'keymap org-agenda-keymap
5483 'help-echo 5493 'help-echo
5484 (format "mouse-2 or RET jump to org file %s" 5494 (format "mouse-2 or RET jump to org file %s"
5485 (abbreviate-file-name (buffer-file-name))))) 5495 (abbreviate-file-name buffer-file-name))))
5486 (regexp (concat "[\n\r]\\*+ *\\(" 5496 (regexp (concat "[\n\r]\\*+ *\\("
5487 (if org-select-this-todo-keyword 5497 (if org-select-this-todo-keyword
5488 (concat "\\<\\(" org-select-this-todo-keyword 5498 (concat "\\<\\(" org-select-this-todo-keyword
@@ -5524,7 +5534,7 @@ the documentation of `org-diary'."
5524 'keymap org-agenda-keymap 5534 'keymap org-agenda-keymap
5525 'help-echo 5535 'help-echo
5526 (format "mouse-2 or RET jump to org file %s" 5536 (format "mouse-2 or RET jump to org file %s"
5527 (abbreviate-file-name (buffer-file-name))))) 5537 (abbreviate-file-name buffer-file-name))))
5528 (regexp (regexp-quote 5538 (regexp (regexp-quote
5529 (substring 5539 (substring
5530 (format-time-string 5540 (format-time-string
@@ -5601,7 +5611,7 @@ the documentation of `org-diary'."
5601 'keymap org-agenda-keymap 5611 'keymap org-agenda-keymap
5602 'help-echo 5612 'help-echo
5603 (format "mouse-2 or RET jump to org file %s" 5613 (format "mouse-2 or RET jump to org file %s"
5604 (abbreviate-file-name (buffer-file-name))))) 5614 (abbreviate-file-name buffer-file-name))))
5605 (regexp (concat 5615 (regexp (concat
5606 "\\<" org-closed-string " *\\[" 5616 "\\<" org-closed-string " *\\["
5607 (regexp-quote 5617 (regexp-quote
@@ -5657,7 +5667,7 @@ the documentation of `org-diary'."
5657 'keymap org-agenda-keymap 5667 'keymap org-agenda-keymap
5658 'help-echo 5668 'help-echo
5659 (format "mouse-2 or RET jump to org file %s" 5669 (format "mouse-2 or RET jump to org file %s"
5660 (abbreviate-file-name (buffer-file-name))))) 5670 (abbreviate-file-name buffer-file-name))))
5661 (regexp org-deadline-time-regexp) 5671 (regexp org-deadline-time-regexp)
5662 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 5672 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
5663 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 5673 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
@@ -5719,7 +5729,7 @@ the documentation of `org-diary'."
5719 'keymap org-agenda-keymap 5729 'keymap org-agenda-keymap
5720 'help-echo 5730 'help-echo
5721 (format "mouse-2 or RET jump to org file %s" 5731 (format "mouse-2 or RET jump to org file %s"
5722 (abbreviate-file-name (buffer-file-name))))) 5732 (abbreviate-file-name buffer-file-name))))
5723 (regexp org-scheduled-time-regexp) 5733 (regexp org-scheduled-time-regexp)
5724 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 5734 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
5725 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 5735 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
@@ -5768,7 +5778,7 @@ the documentation of `org-diary'."
5768 'keymap org-agenda-keymap 5778 'keymap org-agenda-keymap
5769 'help-echo 5779 'help-echo
5770 (format "mouse-2 or RET jump to org file %s" 5780 (format "mouse-2 or RET jump to org file %s"
5771 (abbreviate-file-name (buffer-file-name))))) 5781 (abbreviate-file-name buffer-file-name))))
5772 (regexp org-tr-regexp) 5782 (regexp org-tr-regexp)
5773 (d0 (calendar-absolute-from-gregorian date)) 5783 (d0 (calendar-absolute-from-gregorian date))
5774 marker hdmarker ee txt d1 d2 s1 s2 timestr category tags) 5784 marker hdmarker ee txt d1 d2 s1 s2 timestr category tags)
@@ -5861,11 +5871,11 @@ only the correctly processes TXT should be returned - this is used by
5861 (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt))) 5871 (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt)))
5862 (let* ((category (or category 5872 (let* ((category (or category
5863 org-category 5873 org-category
5864 (if (buffer-file-name) 5874 (if buffer-file-name
5865 (file-name-sans-extension 5875 (file-name-sans-extension
5866 (file-name-nondirectory (buffer-file-name))) 5876 (file-name-nondirectory buffer-file-name))
5867 ""))) 5877 "")))
5868 (tag (or (nth (1- (length tags)) tags) "")) 5878 (tag (or (nth (1- (or (length tags) 0)) tags) ""))
5869 time ;; needed for the eval of the prefix format 5879 time ;; needed for the eval of the prefix format
5870 (ts (if dotime (concat (if (stringp dotime) dotime "") txt))) 5880 (ts (if dotime (concat (if (stringp dotime) dotime "") txt)))
5871 (time-of-day (and dotime (org-get-time-of-day ts))) 5881 (time-of-day (and dotime (org-get-time-of-day ts)))
@@ -6495,7 +6505,7 @@ are included in the output."
6495 'keymap org-agenda-keymap 6505 'keymap org-agenda-keymap
6496 'help-echo 6506 'help-echo
6497 (format "mouse-2 or RET jump to org file %s" 6507 (format "mouse-2 or RET jump to org file %s"
6498 (abbreviate-file-name (buffer-file-name))))) 6508 (abbreviate-file-name buffer-file-name))))
6499 lspos 6509 lspos
6500 tags tags-list tags-alist (llast 0) rtn level category i txt 6510 tags tags-list tags-alist (llast 0) rtn level category i txt
6501 todo marker) 6511 todo marker)
@@ -6507,7 +6517,7 @@ are included in the output."
6507 (setq todo (if (match-end 1) (match-string 2)) 6517 (setq todo (if (match-end 1) (match-string 2))
6508 tags (if (match-end 4) (match-string 4))) 6518 tags (if (match-end 4) (match-string 4)))
6509 (goto-char (setq lspos (1+ (match-beginning 0)))) 6519 (goto-char (setq lspos (1+ (match-beginning 0))))
6510 (setq level (outline-level) 6520 (setq level (funcall outline-level)
6511 category (org-get-category)) 6521 category (org-get-category))
6512 (setq i llast llast level) 6522 (setq i llast llast level)
6513 ;; remove tag lists from same and sublevels 6523 ;; remove tag lists from same and sublevels
@@ -7232,9 +7242,8 @@ sequences, it will now work."
7232 "Returns the name of the message folder in a index folder buffer." 7242 "Returns the name of the message folder in a index folder buffer."
7233 (save-excursion 7243 (save-excursion
7234 (mh-index-previous-folder) 7244 (mh-index-previous-folder)
7235 (if (not (re-search-forward "^\\(+.*\\)$" nil t)) 7245 (re-search-forward "^\\(+.*\\)$" nil t)
7236 (message "Problem getting folder from index.") 7246 (message (match-string 1))))
7237 (message (match-string 1)))))
7238 7247
7239(defun org-mhe-get-message-folder () 7248(defun org-mhe-get-message-folder ()
7240 "Return the name of the current message folder. Be careful if you 7249 "Return the name of the current message folder. Be careful if you
@@ -7278,23 +7287,21 @@ idea..."
7278 "Follow an MHE link to FOLDER and ARTICLE." 7287 "Follow an MHE link to FOLDER and ARTICLE."
7279 (setq article (org-add-angle-brackets article)) 7288 (setq article (org-add-angle-brackets article))
7280 (require 'mh-e) 7289 (require 'mh-e)
7290 (require 'mh-search)
7281 (mh-find-path) 7291 (mh-find-path)
7282 (let* ((show-buf (concat "show-" folder))) 7292 (mh-search-choose)
7283 (mh-visit-folder folder) 7293 (if (equal mh-searcher 'pick)
7284 (get-buffer-create show-buf) 7294 (progn
7285 (mh-show-msg 7295 (mh-search folder (list "--message-id" article))
7286 (string-to-number 7296 (when (and org-mhe-search-all-folders
7287 (car (split-string 7297 (not (org-mhe-get-message-real-folder)))
7288 (with-temp-buffer 7298 (kill-this-buffer)
7289 (call-process 7299 (mh-search "+" (list "--message-id" article))))
7290 (expand-file-name "pick" mh-progs) 7300 (mh-search "+" article))
7291 nil t nil 7301 (if (org-mhe-get-message-real-folder)
7292 folder 7302 (mh-show-msg 1)
7293 "--message-id" 7303 (kill-this-buffer)
7294 article) 7304 (error "Message not found")))
7295 (buffer-string))
7296 "\n"))))
7297 (pop-to-buffer show-buf)))
7298 7305
7299(defun org-open-file (path &optional in-emacs line search) 7306(defun org-open-file (path &optional in-emacs line search)
7300 "Open the file at PATH. 7307 "Open the file at PATH.
@@ -7309,7 +7316,7 @@ opened in Emacs.
7309If the file does not exist, an error is thrown." 7316If the file does not exist, an error is thrown."
7310 (setq in-emacs (or in-emacs line search)) 7317 (setq in-emacs (or in-emacs line search))
7311 (let* ((file (if (equal path "") 7318 (let* ((file (if (equal path "")
7312 (buffer-file-name) 7319 buffer-file-name
7313 (convert-standard-filename (org-expand-file-name path)))) 7320 (convert-standard-filename (org-expand-file-name path))))
7314 (dirp (file-directory-p file)) 7321 (dirp (file-directory-p file))
7315 (dfile (downcase file)) 7322 (dfile (downcase file))
@@ -7345,7 +7352,7 @@ If the file does not exist, an error is thrown."
7345 (shell-command (concat cmd " &")))) 7352 (shell-command (concat cmd " &"))))
7346 ((or (stringp cmd) 7353 ((or (stringp cmd)
7347 (eq cmd 'emacs)) 7354 (eq cmd 'emacs))
7348 (unless (equal (file-truename file) (file-truename (buffer-file-name))) 7355 (unless (equal (file-truename file) (file-truename buffer-file-name))
7349 (funcall (cdr (assq 'file org-link-frame-setup)) file)) 7356 (funcall (cdr (assq 'file org-link-frame-setup)) file))
7350 (if line (goto-line line) 7357 (if line (goto-line line)
7351 (if search (org-link-search search)))) 7358 (if search (org-link-search search))))
@@ -7412,7 +7419,7 @@ For file links, arg negates `org-context-in-file-links'."
7412 (save-excursion 7419 (save-excursion
7413 (vm-select-folder-buffer) 7420 (vm-select-folder-buffer)
7414 (let* ((message (car vm-message-pointer)) 7421 (let* ((message (car vm-message-pointer))
7415 (folder (buffer-file-name)) 7422 (folder buffer-file-name)
7416 (subject (vm-su-subject message)) 7423 (subject (vm-su-subject message))
7417 (author (vm-su-full-name message)) 7424 (author (vm-su-full-name message))
7418 (message-id (vm-su-message-id message))) 7425 (message-id (vm-su-message-id message)))
@@ -7457,7 +7464,7 @@ For file links, arg negates `org-context-in-file-links'."
7457 (save-excursion 7464 (save-excursion
7458 (save-restriction 7465 (save-restriction
7459 (rmail-narrow-to-non-pruned-header) 7466 (rmail-narrow-to-non-pruned-header)
7460 (let ((folder (buffer-file-name)) 7467 (let ((folder buffer-file-name)
7461 (message-id (mail-fetch-field "message-id")) 7468 (message-id (mail-fetch-field "message-id"))
7462 (author (mail-fetch-field "from")) 7469 (author (mail-fetch-field "from"))
7463 (subject (mail-fetch-field "subject"))) 7470 (subject (mail-fetch-field "subject")))
@@ -7512,7 +7519,7 @@ For file links, arg negates `org-context-in-file-links'."
7512 ((eq major-mode 'org-mode) 7519 ((eq major-mode 'org-mode)
7513 ;; Just link to current headline 7520 ;; Just link to current headline
7514 (setq cpltxt (concat "file:" 7521 (setq cpltxt (concat "file:"
7515 (abbreviate-file-name (buffer-file-name)))) 7522 (abbreviate-file-name buffer-file-name)))
7516 ;; Add a context search string 7523 ;; Add a context search string
7517 (when (org-xor org-context-in-file-links arg) 7524 (when (org-xor org-context-in-file-links arg)
7518 ;; Check if we are on a target 7525 ;; Check if we are on a target
@@ -7537,10 +7544,10 @@ For file links, arg negates `org-context-in-file-links'."
7537 (setq cpltxt (substring cpltxt 0 -2))) 7544 (setq cpltxt (substring cpltxt 0 -2)))
7538 (setq link (org-make-link cpltxt))) 7545 (setq link (org-make-link cpltxt)))
7539 7546
7540 ((buffer-file-name) 7547 (buffer-file-name
7541 ;; Just link to this file here. 7548 ;; Just link to this file here.
7542 (setq cpltxt (concat "file:" 7549 (setq cpltxt (concat "file:"
7543 (abbreviate-file-name (buffer-file-name)))) 7550 (abbreviate-file-name buffer-file-name)))
7544 ;; Add a context string 7551 ;; Add a context string
7545 (when (org-xor org-context-in-file-links arg) 7552 (when (org-xor org-context-in-file-links arg)
7546 (setq txt (if (org-region-active-p) 7553 (setq txt (if (org-region-active-p)
@@ -7706,7 +7713,7 @@ is in the current directory or below."
7706 (case-fold-search nil) 7713 (case-fold-search nil)
7707 (search (match-string 2 link))) 7714 (search (match-string 2 link)))
7708 (when (save-match-data 7715 (when (save-match-data
7709 (equal (file-truename (buffer-file-name)) 7716 (equal (file-truename buffer-file-name)
7710 (file-truename path))) 7717 (file-truename path)))
7711 ;; We are linking to this same file 7718 ;; We are linking to this same file
7712 (if (and org-file-link-context-use-camel-case 7719 (if (and org-file-link-context-use-camel-case
@@ -7835,7 +7842,7 @@ See also the variable `org-reverse-note-order'."
7835 ((and (org-on-heading-p nil) (not current-prefix-arg)) 7842 ((and (org-on-heading-p nil) (not current-prefix-arg))
7836 ;; Put it below this entry, at the beg/end of the subtree 7843 ;; Put it below this entry, at the beg/end of the subtree
7837 (org-back-to-heading) 7844 (org-back-to-heading)
7838 (setq level (outline-level)) 7845 (setq level (funcall outline-level))
7839 (if reversed 7846 (if reversed
7840 (outline-end-of-heading) 7847 (outline-end-of-heading)
7841 (outline-end-of-subtree)) 7848 (outline-end-of-subtree))
@@ -7868,7 +7875,7 @@ See also the variable `org-reverse-note-order'."
7868 (let ((all org-reverse-note-order) 7875 (let ((all org-reverse-note-order)
7869 entry) 7876 entry)
7870 (while (setq entry (pop all)) 7877 (while (setq entry (pop all))
7871 (if (string-match (car entry) (buffer-file-name)) 7878 (if (string-match (car entry) buffer-file-name)
7872 (throw 'exit (cdr entry)))) 7879 (throw 'exit (cdr entry))))
7873 nil))))) 7880 nil)))))
7874 7881
@@ -10510,7 +10517,8 @@ translations. There is currently no way for users to extend this.")
10510 "Cleanup a buffer substring so that links can be created safely." 10517 "Cleanup a buffer substring so that links can be created safely."
10511 (interactive) 10518 (interactive)
10512 (let* ((cb (current-buffer)) 10519 (let* ((cb (current-buffer))
10513 (re-radio (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)")) 10520 (re-radio (and org-target-link-regexp
10521 (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)")))
10514 rtn) 10522 rtn)
10515 (save-excursion 10523 (save-excursion
10516 (set-buffer (get-buffer-create " org-mode-tmp")) 10524 (set-buffer (get-buffer-create " org-mode-tmp"))
@@ -10524,8 +10532,9 @@ translations. There is currently no way for users to extend this.")
10524 (replace-match "\\1(INVISIBLE)")) 10532 (replace-match "\\1(INVISIBLE)"))
10525 ;; Find matches for radio targets and turn them into links 10533 ;; Find matches for radio targets and turn them into links
10526 (goto-char (point-min)) 10534 (goto-char (point-min))
10527 (while (re-search-forward re-radio nil t) 10535 (when re-radio
10528 (replace-match "\\1[[\\2]]")) 10536 (while (re-search-forward re-radio nil t)
10537 (replace-match "\\1[[\\2]]")))
10529 ;; Find all links that contain a newline and put them into a single line 10538 ;; Find all links that contain a newline and put them into a single line
10530 (goto-char (point-min)) 10539 (goto-char (point-min))
10531 (while (re-search-forward "\\(\\[\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\]\\)" nil t) 10540 (while (re-search-forward "\\(\\[\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\]\\)" nil t)
@@ -10590,7 +10599,7 @@ underlined headlines. The default is 3."
10590 (level 0) line txt 10599 (level 0) line txt
10591 (umax nil) 10600 (umax nil)
10592 (case-fold-search nil) 10601 (case-fold-search nil)
10593 (filename (concat (file-name-sans-extension (buffer-file-name)) 10602 (filename (concat (file-name-sans-extension buffer-file-name)
10594 ".txt")) 10603 ".txt"))
10595 (buffer (find-file-noselect filename)) 10604 (buffer (find-file-noselect filename))
10596 (levels-open (make-vector org-level-max nil)) 10605 (levels-open (make-vector org-level-max nil))
@@ -10748,7 +10757,7 @@ underlined headlines. The default is 3."
10748Also removes the first line of the buffer if it specifies a mode, 10757Also removes the first line of the buffer if it specifies a mode,
10749and all options lines." 10758and all options lines."
10750 (interactive) 10759 (interactive)
10751 (let* ((filename (concat (file-name-sans-extension (buffer-file-name)) 10760 (let* ((filename (concat (file-name-sans-extension buffer-file-name)
10752 ".txt")) 10761 ".txt"))
10753 (buffer (find-file-noselect filename)) 10762 (buffer (find-file-noselect filename))
10754 (ore (concat 10763 (ore (concat
@@ -10822,7 +10831,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
10822 org-export-with-sub-superscripts 10831 org-export-with-sub-superscripts
10823 org-export-with-emphasize 10832 org-export-with-emphasize
10824 org-export-with-TeX-macros 10833 org-export-with-TeX-macros
10825 (file-name-nondirectory (buffer-file-name)) 10834 (file-name-nondirectory buffer-file-name)
10826 (if (equal org-todo-interpretation 'sequence) 10835 (if (equal org-todo-interpretation 'sequence)
10827 (mapconcat 'identity org-todo-keywords " ") 10836 (mapconcat 'identity org-todo-keywords " ")
10828 "TODO FEEDBACK VERIFY DONE") 10837 "TODO FEEDBACK VERIFY DONE")
@@ -10895,7 +10904,7 @@ The prefix ARG specifies how many levels of the outline should become
10895headlines. The default is 3. Lower levels will become bulleted lists." 10904headlines. The default is 3. Lower levels will become bulleted lists."
10896 (interactive "P") 10905 (interactive "P")
10897 (org-export-as-html arg 'hidden) 10906 (org-export-as-html arg 'hidden)
10898 (org-open-file (buffer-file-name))) 10907 (org-open-file buffer-file-name))
10899 10908
10900(defun org-export-as-html-batch () 10909(defun org-export-as-html-batch ()
10901 "Call `org-export-as-html', may be used in batch processing as 10910 "Call `org-export-as-html', may be used in batch processing as
@@ -10927,7 +10936,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10927 (lines (org-export-find-first-heading-line all_lines)) 10936 (lines (org-export-find-first-heading-line all_lines))
10928 (level 0) (line "") (origline "") txt todo 10937 (level 0) (line "") (origline "") txt todo
10929 (umax nil) 10938 (umax nil)
10930 (filename (concat (file-name-sans-extension (buffer-file-name)) 10939 (filename (concat (file-name-sans-extension buffer-file-name)
10931 ".html")) 10940 ".html"))
10932 (buffer (find-file-noselect filename)) 10941 (buffer (find-file-noselect filename))
10933 (levels-open (make-vector org-level-max nil)) 10942 (levels-open (make-vector org-level-max nil))
@@ -11661,7 +11670,7 @@ When LEVEL is non-nil, increase section numbers on that level."
11661The iCalendar file will be located in the same directory as the Org-mode 11670The iCalendar file will be located in the same directory as the Org-mode
11662file, but with extension `.ics'." 11671file, but with extension `.ics'."
11663 (interactive) 11672 (interactive)
11664 (org-export-icalendar nil (buffer-file-name))) 11673 (org-export-icalendar nil buffer-file-name))
11665 11674
11666;;;###autoload 11675;;;###autoload
11667(defun org-export-icalendar-all-agenda-files () 11676(defun org-export-icalendar-all-agenda-files ()
@@ -11698,7 +11707,7 @@ file and store it under the name `org-combined-agenda-icalendar-file'."
11698 (set-buffer (org-get-agenda-file-buffer file)) 11707 (set-buffer (org-get-agenda-file-buffer file))
11699 (setq category (or org-category 11708 (setq category (or org-category
11700 (file-name-sans-extension 11709 (file-name-sans-extension
11701 (file-name-nondirectory (buffer-file-name))))) 11710 (file-name-nondirectory buffer-file-name))))
11702 (if (symbolp category) (setq category (symbol-name category))) 11711 (if (symbolp category) (setq category (symbol-name category)))
11703 (let ((standard-output ical-buffer)) 11712 (let ((standard-output ical-buffer))
11704 (if combine 11713 (if combine
@@ -12842,4 +12851,3 @@ Show the heading too, if it is currently invisible."
12842 12851
12843;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 12852;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
12844;;; org.el ends here 12853;;; org.el ends here
12845
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index 55385d42e95..b868369fc4a 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -50,14 +50,16 @@
50;; Specify a function to be called to dynamically provide the 50;; Specify a function to be called to dynamically provide the
51;; tree's children in response to an expand request. This function 51;; tree's children in response to an expand request. This function
52;; will be passed the tree widget and must return a list of child 52;; will be passed the tree widget and must return a list of child
53;; widgets. 53;; widgets. Child widgets returned by the :expander function are
54;; stored in the :args property of the tree widget.
54;; 55;;
55;; *Please note:* Child widgets returned by the :expander function 56;; :expander-p
56;; are stored in the :args property of the tree widget. To speed 57;; Specify a predicate which must return non-nil to indicate that
57;; up successive expand requests, the :expander function is not 58;; the :expander function above has to be called. By default, to
58;; called again when the :args value is non-nil. To refresh child 59;; speed up successive expand requests, the :expander-p predicate
59;; values, it is necessary to set the :args property to nil, then 60;; return non-nil when the :args value is nil. So, by default, to
60;; redraw the tree. 61;; refresh child values, it is necessary to set the :args property
62;; to nil, then redraw the tree.
61;; 63;;
62;; :open-icon (default `tree-widget-open-icon') 64;; :open-icon (default `tree-widget-open-icon')
63;; :close-icon (default `tree-widget-close-icon') 65;; :close-icon (default `tree-widget-close-icon')
@@ -265,19 +267,42 @@ See also the option `widget-image-conversion'."
265 267
266(defsubst tree-widget-theme-name () 268(defsubst tree-widget-theme-name ()
267 "Return the current theme name, or nil if no theme is active." 269 "Return the current theme name, or nil if no theme is active."
268 (and tree-widget--theme (aref tree-widget--theme 0))) 270 (and tree-widget--theme (car (aref tree-widget--theme 0))))
269 271
270(defsubst tree-widget-set-theme (&optional name) 272(defsubst tree-widget-set-parent-theme (name)
273 "Set to NAME the parent theme of the current theme.
274The default parent theme is the \"default\" theme."
275 (unless (member name (aref tree-widget--theme 0))
276 (aset tree-widget--theme 0
277 (append (aref tree-widget--theme 0) (list name)))
278 ;; Load the theme setup
279 (let ((default-directory (tree-widget-themes-directory)))
280 (when default-directory
281 (load (expand-file-name "tree-widget-theme-setup" name) t)))))
282
283(defun tree-widget-set-theme (&optional name)
271 "In the current buffer, set the theme to use for images. 284 "In the current buffer, set the theme to use for images.
272The current buffer must be where the tree widget is drawn. 285The current buffer must be where the tree widget is drawn.
273Optional argument NAME is the name of the theme to use. It defaults 286Optional argument NAME is the name of the theme to use. It defaults
274to the value of the variable `tree-widget-theme'. 287to the value of the variable `tree-widget-theme'.
275Does nothing if NAME is already the current theme." 288Does nothing if NAME is already the current theme.
289
290If there is a \"tree-widget-theme-setup\" library in the theme
291directory, load it to setup a parent theme or the images properties.
292Typically it should contain something like this:
293
294 (tree-widget-set-parent-theme \"my-parent-theme\")
295 (tree-widget-set-image-properties
296 (if (featurep 'xemacs)
297 '(:ascent center)
298 '(:ascent center :mask (heuristic t))
299 ))"
276 (or name (setq name (or tree-widget-theme "default"))) 300 (or name (setq name (or tree-widget-theme "default")))
277 (unless (string-equal name (tree-widget-theme-name)) 301 (unless (string-equal name (tree-widget-theme-name))
278 (set (make-local-variable 'tree-widget--theme) 302 (set (make-local-variable 'tree-widget--theme)
279 (make-vector 4 nil)) 303 (make-vector 4 nil))
280 (aset tree-widget--theme 0 name))) 304 (tree-widget-set-parent-theme name)
305 (tree-widget-set-parent-theme "default")))
281 306
282(defun tree-widget--locate-sub-directory (name path) 307(defun tree-widget--locate-sub-directory (name path)
283 "Locate the sub-directory NAME in PATH. 308 "Locate the sub-directory NAME in PATH.
@@ -328,50 +353,6 @@ specified directory is not accessible."
328 (aset tree-widget--theme 1 (or found 'void)) 353 (aset tree-widget--theme 1 (or found 'void))
329 found)) 354 found))
330 355
331(defsubst tree-widget-set-image-properties (props)
332 "In current theme, set images properties to PROPS."
333 (aset tree-widget--theme 2 props))
334
335(defun tree-widget-image-properties (file)
336 "Return the properties of an image in current theme.
337FILE is the absolute file name of an image.
338
339If there is a \"tree-widget-theme-setup\" library in the theme
340directory, where is located FILE, load it to setup theme images
341properties. Typically it should contain something like this:
342
343 (tree-widget-set-image-properties
344 (if (featurep 'xemacs)
345 '(:ascent center)
346 '(:ascent center :mask (heuristic t))
347 ))
348
349When there is no \"tree-widget-theme-setup\" library in the current
350theme directory, load the one from the default theme, if available.
351Default global properties are provided for respectively Emacs and
352XEmacs in the variables `tree-widget-image-properties-emacs', and
353`tree-widget-image-properties-xemacs'."
354 ;; If properties are in the cache, use them.
355 (let ((plist (aref tree-widget--theme 2)))
356 (unless plist
357 ;; Load tree-widget-theme-setup if available.
358 (load (expand-file-name "tree-widget-theme-setup"
359 (file-name-directory file)) t t)
360 ;; If properties have been setup, use them.
361 (unless (setq plist (aref tree-widget--theme 2))
362 ;; Try from the default theme.
363 (load (expand-file-name "../default/tree-widget-theme-setup"
364 (file-name-directory file)) t t)
365 ;; If properties have been setup, use them.
366 (unless (setq plist (aref tree-widget--theme 2))
367 ;; By default, use supplied global properties.
368 (setq plist (if (featurep 'xemacs)
369 tree-widget-image-properties-xemacs
370 tree-widget-image-properties-emacs))
371 ;; Setup the cache.
372 (tree-widget-set-image-properties plist))))
373 plist))
374
375(defconst tree-widget--cursors 356(defconst tree-widget--cursors
376 ;; Pointer shapes when the mouse pointer is over inactive 357 ;; Pointer shapes when the mouse pointer is over inactive
377 ;; tree-widget images. This feature works since Emacs 22, and 358 ;; tree-widget images. This feature works since Emacs 22, and
@@ -384,35 +365,46 @@ XEmacs in the variables `tree-widget-image-properties-emacs', and
384 ("no-handle" . arrow) 365 ("no-handle" . arrow)
385 )) 366 ))
386 367
368(defsubst tree-widget-set-image-properties (props)
369 "In current theme, set images properties to PROPS.
370Does nothing if images properties have already been set for that
371theme."
372 (or (aref tree-widget--theme 2)
373 (aset tree-widget--theme 2 props)))
374
375(defsubst tree-widget-image-properties (name)
376 "Return the properties of image NAME in current theme.
377Default global properties are provided for respectively Emacs and
378XEmacs in the variables `tree-widget-image-properties-emacs', and
379`tree-widget-image-properties-xemacs'."
380 ;; Add the pointer shape
381 (cons :pointer
382 (cons (or (cdr (assoc name tree-widget--cursors)) 'hand)
383 (tree-widget-set-image-properties
384 (if (featurep 'xemacs)
385 tree-widget-image-properties-xemacs
386 tree-widget-image-properties-emacs)))))
387
387(defun tree-widget-lookup-image (name) 388(defun tree-widget-lookup-image (name)
388 "Look up in current theme for an image with NAME. 389 "Look up in current theme for an image with NAME.
389Search first in current theme, then in default theme (see also the 390Search first in current theme, then in parent themes (see also the
390variable `tree-widget-theme'). 391function `tree-widget-set-parent-theme').
391Return the first image found having a supported format, or nil if not 392Return the first image found having a supported format, or nil if not
392found." 393found."
393 (let ((default-directory (tree-widget-themes-directory))) 394 (let ((default-directory (tree-widget-themes-directory)) file)
394 (when default-directory 395 (when default-directory
395 (let (file (theme (tree-widget-theme-name))) 396 (catch 'found
396 (catch 'found 397 (dolist (dir (aref tree-widget--theme 0))
397 (dolist (dir (if (string-equal theme "default") 398 (dolist (fmt (tree-widget-image-formats))
398 '("default") (list theme "default"))) 399 (dolist (ext (cdr fmt))
399 (dolist (fmt (tree-widget-image-formats)) 400 (setq file (expand-file-name (concat name ext) dir))
400 (dolist (ext (cdr fmt)) 401 (and (file-readable-p file)
401 (setq file (expand-file-name (concat name ext) dir)) 402 (file-regular-p file)
402 (and 403 (throw 'found
403 (file-readable-p file) 404 (tree-widget-create-image
404 (file-regular-p file) 405 (car fmt) file
405 (throw 406 (tree-widget-image-properties name)))))))
406 'found 407 nil))))
407 (tree-widget-create-image
408 (car fmt) file
409 ;; Add the pointer shape
410 (cons :pointer
411 (cons
412 (or (cdr (assoc name tree-widget--cursors))
413 'hand)
414 (tree-widget-image-properties file)))))))))
415 nil)))))
416 408
417(defun tree-widget-find-image (name) 409(defun tree-widget-find-image (name)
418 "Find the image with NAME in current theme. 410 "Find the image with NAME in current theme.
@@ -530,12 +522,13 @@ Handle mouse button 1 click on buttons.")
530(define-widget 'tree-widget 'default 522(define-widget 'tree-widget 'default
531 "Tree widget." 523 "Tree widget."
532 :format "%v" 524 :format "%v"
533 :convert-widget 'widget-types-convert-widget 525 :convert-widget 'tree-widget-convert-widget
534 :value-get 'widget-value-value-get 526 :value-get 'widget-value-value-get
535 :value-delete 'widget-children-value-delete 527 :value-delete 'widget-children-value-delete
536 :value-create 'tree-widget-value-create 528 :value-create 'tree-widget-value-create
537 :action 'tree-widget-action 529 :action 'tree-widget-action
538 :help-echo 'tree-widget-help-echo 530 :help-echo 'tree-widget-help-echo
531 :expander-p 'tree-widget-expander-p
539 :open-icon 'tree-widget-open-icon 532 :open-icon 'tree-widget-open-icon
540 :close-icon 'tree-widget-close-icon 533 :close-icon 'tree-widget-close-icon
541 :empty-icon 'tree-widget-empty-icon 534 :empty-icon 'tree-widget-empty-icon
@@ -646,6 +639,14 @@ This hook should be local in the buffer setup to display widgets.")
646 (1- (point)) (point) 639 (1- (point)) (point)
647 'display (list 'space :width tree-widget-space-width))) 640 'display (list 'space :width tree-widget-space-width)))
648 641
642(defun tree-widget-convert-widget (widget)
643 "Convert :args as widget types in WIDGET."
644 (let ((tree (widget-types-convert-widget widget)))
645 ;; Compatibility
646 (widget-put tree :expander (or (widget-get tree :expander)
647 (widget-get tree :dynargs)))
648 tree))
649
649(defun tree-widget-value-create (tree) 650(defun tree-widget-value-create (tree)
650 "Create the TREE tree-widget." 651 "Create the TREE tree-widget."
651 (let* ((node (tree-widget-node tree)) 652 (let* ((node (tree-widget-node tree))
@@ -662,8 +663,6 @@ This hook should be local in the buffer setup to display widgets.")
662 (if (widget-get tree :open) 663 (if (widget-get tree :open)
663;;;; Expanded node. 664;;;; Expanded node.
664 (let ((args (widget-get tree :args)) 665 (let ((args (widget-get tree :args))
665 (xpandr (or (widget-get tree :expander)
666 (widget-get tree :dynargs)))
667 (guide (widget-get tree :guide)) 666 (guide (widget-get tree :guide))
668 (noguide (widget-get tree :no-guide)) 667 (noguide (widget-get tree :no-guide))
669 (endguide (widget-get tree :end-guide)) 668 (endguide (widget-get tree :end-guide))
@@ -674,9 +673,11 @@ This hook should be local in the buffer setup to display widgets.")
674 (endguidi (tree-widget-find-image "end-guide")) 673 (endguidi (tree-widget-find-image "end-guide"))
675 (handli (tree-widget-find-image "handle")) 674 (handli (tree-widget-find-image "handle"))
676 (nohandli (tree-widget-find-image "no-handle"))) 675 (nohandli (tree-widget-find-image "no-handle")))
677 ;; Request children at run time, when not already done. 676 ;; Request children at run time, when requested.
678 (when (and (not args) xpandr) 677 (when (and (widget-get tree :expander)
679 (setq args (mapcar 'widget-convert (funcall xpandr tree))) 678 (widget-apply tree :expander-p))
679 (setq args (mapcar 'widget-convert
680 (widget-apply tree :expander)))
680 (widget-put tree :args args)) 681 (widget-put tree :args args))
681 ;; Defer the node widget creation after icon creation. 682 ;; Defer the node widget creation after icon creation.
682 (widget-put tree :node (widget-convert node)) 683 (widget-put tree :node (widget-convert node))
@@ -800,6 +801,11 @@ Ignore the EVENT argument."
800 "Collapse node" 801 "Collapse node"
801 "Expand node")) 802 "Expand node"))
802 803
804(defun tree-widget-expander-p (tree)
805 "Return non-nil if the TREE tree-widget :expander has to be called.
806That is, if TREE :args is nil."
807 (null (widget-get tree :args)))
808
803(provide 'tree-widget) 809(provide 'tree-widget)
804 810
805;; arch-tag: c3a1ada2-1663-41dc-9d16-2479ed8320e8 811;; arch-tag: c3a1ada2-1663-41dc-9d16-2479ed8320e8
diff --git a/lisp/tumme.el b/lisp/tumme.el
index 6cec3e73a16..6a53ed16948 100644
--- a/lisp/tumme.el
+++ b/lisp/tumme.el
@@ -169,13 +169,13 @@
169;; probably needs rewriting `tumme-display-thumbs' to be more general. 169;; probably needs rewriting `tumme-display-thumbs' to be more general.
170;; 170;;
171;; * Find some way of toggling on and off really nice keybindings in 171;; * Find some way of toggling on and off really nice keybindings in
172;; dired (for example, using C-n or <down> instead of C-S-n). Richard 172;; dired (for example, using C-n or <down> instead of C-S-n). Richard
173;; suggested that we could keep C-t as prefix for tumme commands as it 173;; suggested that we could keep C-t as prefix for tumme commands as it
174;; is currently not used in dired. He also suggested that 174;; is currently not used in dired. He also suggested that
175;; `dired-next-line' and `dired-previous-line' figure out if tumme is 175;; `dired-next-line' and `dired-previous-line' figure out if tumme is
176;; enabled in the current buffer and, if it is, call 176;; enabled in the current buffer and, if it is, call
177;; `tumme-dired-next-line' and `tumme-dired-previous-line', 177;; `tumme-dired-next-line' and `tumme-dired-previous-line',
178;; respectively. Update: This is partly done; some bindings have now 178;; respectively. Update: This is partly done; some bindings have now
179;; been added to dired. 179;; been added to dired.
180;; 180;;
181;; * Enhanced gallery creation with basic CSS-support and pagination 181;; * Enhanced gallery creation with basic CSS-support and pagination
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index cb002731eec..60a279356b8 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,14 @@
12006-03-07 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * url-http.el (url-http-find-free-connection): Fix braino in last fix.
4
52006-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * url-http.el (url-http-find-free-connection): Don't kill the process
8 when killing the temp buffer.
9 (url-http-symbol-value-in-buffer): Massage to make it clear to the
10 byte-compiler that the function is defined.
11
12006-02-20 Stefan Monnier <monnier@iro.umontreal.ca> 122006-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 13
3 * url.el (url-redirect-buffer): New var. 14 * url.el (url-redirect-buffer): New var.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 22ca6010ef9..c401094593e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -121,7 +121,11 @@ request.")
121 (let ((buf (generate-new-buffer " *url-http-temp*"))) 121 (let ((buf (generate-new-buffer " *url-http-temp*")))
122 ;; `url-open-stream' needs a buffer in which to do things 122 ;; `url-open-stream' needs a buffer in which to do things
123 ;; like authentication. But we use another buffer afterwards. 123 ;; like authentication. But we use another buffer afterwards.
124 (unwind-protect (url-open-stream host buf host port) 124 (unwind-protect
125 (let ((proc (url-open-stream host buf host port)))
126 ;; Drop the temp buffer link before killing the buffer.
127 (set-process-buffer proc nil)
128 proc)
125 (kill-buffer buf))))))) 129 (kill-buffer buf)))))))
126 130
127;; Building an HTTP request 131;; Building an HTTP request
@@ -1109,15 +1113,15 @@ CBARGS as the arguments."
1109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1110;;; file-name-handler stuff from here on out 1114;;; file-name-handler stuff from here on out
1111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1112(if (not (fboundp 'symbol-value-in-buffer)) 1116(defalias 'url-http-symbol-value-in-buffer
1113 (defun url-http-symbol-value-in-buffer (symbol buffer 1117 (if (fboundp 'symbol-value-in-buffer)
1114 &optional unbound-value) 1118 'symbol-value-in-buffer
1119 (lambda (symbol buffer &optional unbound-value)
1115 "Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound." 1120 "Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound."
1116 (with-current-buffer buffer 1121 (with-current-buffer buffer
1117 (if (not (boundp symbol)) 1122 (if (not (boundp symbol))
1118 unbound-value 1123 unbound-value
1119 (symbol-value symbol)))) 1124 (symbol-value symbol))))))
1120 (defalias 'url-http-symbol-value-in-buffer 'symbol-value-in-buffer))
1121 1125
1122(defun url-http-head (url) 1126(defun url-http-head (url)
1123 (let ((url-request-method "HEAD") 1127 (let ((url-request-method "HEAD")
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 2471ab909c6..1363181524c 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -103,6 +103,7 @@
103 103
104(defvar dired-backup-overwrite) ; Only in Emacs 20.x this is a custom var 104(defvar dired-backup-overwrite) ; Only in Emacs 20.x this is a custom var
105 105
106(eval-when-compile (require 'cl))
106(require 'dired) 107(require 'dired)
107(autoload 'dired-do-create-files-regexp "dired-aux") 108(autoload 'dired-do-create-files-regexp "dired-aux")
108(autoload 'dired-call-process "dired-aux") 109(autoload 'dired-call-process "dired-aux")
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index a56517535f1..253c858f608 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,17 @@
12006-03-08 Luc Teirlinck <teirllm@auburn.edu>
2
3 * searching.texi (Regexp Special): Put remark between parentheses
4 to avoid misreading.
5
62006-03-07 Luc Teirlinck <teirllm@auburn.edu>
7
8 * searching.texi (Syntax of Regexps): More accurately describe
9 which characters are special in which situations.
10 (Regexp Special): Recommend _not_ to quote `]' or `-' when they
11 are not special. Describe in detail when `[' and `]' are special.
12 (Regexp Backslash): Plenty of regexps with unbalanced square
13 brackets are valid, so reword that statement.
14
12006-03-02 Kim F. Storm <storm@cua.dk> 152006-03-02 Kim F. Storm <storm@cua.dk>
2 16
3 * keymaps.texi (Tool Bar): Add tool-bar-border. 17 * keymaps.texi (Tool Bar): Add tool-bar-border.
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 7c10ed6881b..88009152cc0 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -235,12 +235,15 @@ it easier to verify even very complex regexps.
235 235
236 Regular expressions have a syntax in which a few characters are 236 Regular expressions have a syntax in which a few characters are
237special constructs and the rest are @dfn{ordinary}. An ordinary 237special constructs and the rest are @dfn{ordinary}. An ordinary
238character is a simple regular expression that matches that character and 238character is a simple regular expression that matches that character
239nothing else. The special characters are @samp{.}, @samp{*}, @samp{+}, 239and nothing else. The special characters are @samp{.}, @samp{*},
240@samp{?}, @samp{[}, @samp{]}, @samp{^}, @samp{$}, and @samp{\}; no new 240@samp{+}, @samp{?}, @samp{[}, @samp{^}, @samp{$}, and @samp{\}; no new
241special characters will be defined in the future. Any other character 241special characters will be defined in the future. The character
242appearing in a regular expression is ordinary, unless a @samp{\} 242@samp{]} is special if it ends a character alternative (see later).
243precedes it. 243The character @samp{-} is special inside a character alternative. A
244@samp{[:} and balancing @samp{:]} enclose a character class inside a
245character alternative. Any other character appearing in a regular
246expression is ordinary, unless a @samp{\} precedes it.
244 247
245 For example, @samp{f} is not a special character, so it is ordinary, and 248 For example, @samp{f} is not a special character, so it is ordinary, and
246therefore @samp{f} is a regular expression that matches the string 249therefore @samp{f} is a regular expression that matches the string
@@ -468,6 +471,34 @@ ordinary since there is no preceding expression on which the @samp{*}
468can act. It is poor practice to depend on this behavior; quote the 471can act. It is poor practice to depend on this behavior; quote the
469special character anyway, regardless of where it appears.@refill 472special character anyway, regardless of where it appears.@refill
470 473
474As a @samp{\} is not special inside a character alternative, it can
475never remove the special meaning of @samp{-} or @samp{]}. So you
476should not quote these characters when they have no special meaning
477either. This would not clarify anything, since backslashes can
478legitimately precede these characters where they @emph{have} special
479meaning, as in @code{[^\]} (@code{"[^\\]"} for Lisp string syntax),
480which matches any single character except a backslash.
481
482In practice, most @samp{]} that occur in regular expressions close a
483character alternative and hence are special. However, occasionally a
484regular expression may try to match a complex pattern of literal
485@samp{[} and @samp{]}. In such situations, it sometimes may be
486necessary to carefully parse the regexp from the start to determine
487which square brackets enclose a character alternative. For example,
488@code{[^][]]} consists of the complemented character alternative
489@code{[^][]} (which matches any single character that is not a square
490bracket), followed by a literal @samp{]}.
491
492The exact rules are that at the beginning of a regexp, @samp{[} is
493special and @samp{]} not. This lasts until the first unquoted
494@samp{[}, after which we are in a character alternative; @samp{[} is
495no longer special (except when it starts a character class) but @samp{]}
496is special, unless it immediately follows the special @samp{[} or that
497@samp{[} followed by a @samp{^}. This lasts until the next special
498@samp{]} that does not end a character class. This ends the character
499alternative and restores the ordinary syntax of regular expressions;
500an unquoted @samp{[} is special again and a @samp{]} not.
501
471@node Char Classes 502@node Char Classes
472@subsubsection Character Classes 503@subsubsection Character Classes
473@cindex character classes in regexp 504@cindex character classes in regexp
@@ -740,8 +771,8 @@ with a symbol-constituent character.
740 771
741@kindex invalid-regexp 772@kindex invalid-regexp
742 Not every string is a valid regular expression. For example, a string 773 Not every string is a valid regular expression. For example, a string
743with unbalanced square brackets is invalid (with a few exceptions, such 774that ends inside a character alternative without terminating @samp{]}
744as @samp{[]]}), and so is a string that ends with a single @samp{\}. If 775is invalid, and so is a string that ends with a single @samp{\}. If
745an invalid regular expression is passed to any of the search functions, 776an invalid regular expression is passed to any of the search functions,
746an @code{invalid-regexp} error is signaled. 777an @code{invalid-regexp} error is signaled.
747 778
diff --git a/man/ChangeLog b/man/ChangeLog
index 6b4127e35d7..c0060317a5c 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,40 @@
12006-03-09 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus.texi: Markup fix.
4 (Fancy Mail Splitting): Specify new feature.
5
62006-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
7
8 * gnus.texi (Fancy Mail Splitting): Improve descriptions about
9 partial-words matching.
10
112006-03-07 Reiner Steib <Reiner.Steib@gmx.de>
12
13 * emacs-mime.texi (Display Customization): Reword image/.* stuff.
14
15 * gnus.texi (Oort Gnus): Add note about `gnus-load'.
16 (MIME Commands): Fix mm-discouraged-alternatives.
17
182006-03-08 Luc Teirlinck <teirllm@auburn.edu>
19
20 * search.texi (Regexps): More accurately describe which characters
21 are special in which situations. Recommend _not_ to quote `]' or
22 `-' when they are not special.
23
242006-03-07 Carsten Dominik <dominik@science.uva.nl>
25
26 * org.texi: Version number change only.
27
282006-03-06 Bill Wohler <wohler@newt.com>
29
30 * mh-e.texi: Move from SourceForge repository to Savannah. This is
31 version 7.93, which is a total rewrite from the previous edition
32 1.3 for MH-E version 5.0.2, and corresponds to MH-E version 7.93.
33
342006-03-03 Reiner Steib <Reiner.Steib@gmx.de>
35
36 * gnus.texi (Oort Gnus): Add `mm-fill-flowed'.
37
12006-03-01 Carsten Dominik <dominik@science.uva.nl> 382006-03-01 Carsten Dominik <dominik@science.uva.nl>
2 39
3 * org.texi: (Interaction): Added item about `org-mouse.el' by 40 * org.texi: (Interaction): Added item about `org-mouse.el' by
diff --git a/man/dired.texi b/man/dired.texi
index 195a77e0fd3..13bd5115f1f 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -1219,12 +1219,12 @@ prompted for a comment. Comments can also be added from Dired, and
1219then also to multiple files at once, by typing @kbd{C-t c} 1219then also to multiple files at once, by typing @kbd{C-t c}
1220(@code{tumme-dired-comment-files}). 1220(@code{tumme-dired-comment-files}).
1221 1221
1222 Tumme also provide simple image manipulation commands, like rotating 1222 Tumme also provides simple image manipulation commands, like
1223thumbnails and original image files. In the thumbnail buffer, type 1223rotating thumbnails and original image files. In the thumbnail
1224@kbd{L} to rotate the original image 90 degrees anti clockwise, and 1224buffer, type @kbd{L} to rotate the original image 90 degrees anti
1225@kbd{R} to rotate it 90 degrees clockwise. This rotation will be done 1225clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This
1226lossless (the image quality will not be reduced) and needs an external 1226rotation will be done lossless (the image quality will not be reduced)
1227utility called JpegTRAN to work. 1227and needs an external utility called JpegTRAN to work.
1228 1228
1229@node Misc Dired Features 1229@node Misc Dired Features
1230@section Other Dired Features 1230@section Other Dired Features
diff --git a/man/emacs-mime.texi b/man/emacs-mime.texi
index 69c1c21b5aa..1049f95b0fd 100644
--- a/man/emacs-mime.texi
+++ b/man/emacs-mime.texi
@@ -322,13 +322,14 @@ you could say something like:
322 (remove "text/html" mm-automatic-display)) 322 (remove "text/html" mm-automatic-display))
323@end lisp 323@end lisp
324 324
325Adding @code{"image/.*"} might also be useful. Spammers use it as the 325Adding @code{"image/.*"} might also be useful. Spammers use images as
326prefered part of @samp{multipart/alternative} messages, and you might 326the prefered part of @samp{multipart/alternative} messages, so you might
327not notice there are other parts. See also 327not notice there are other parts. See also
328@code{gnus-buttonized-mime-types} (@pxref{MIME Commands, ,MIME Commands, 328@code{gnus-buttonized-mime-types}, @ref{MIME Commands, ,MIME Commands,
329gnus, Gnus Manual}), to which adding @code{"multipart/alternative"} 329gnus, Gnus Manual}. After adding @code{"multipart/alternative"} to
330enables you to choose manually one of two types those mails include. 330@code{gnus-buttonized-mime-types} you can choose manually which
331For example, you can set those variables like: 331alternative you'd like to view. For example, you can set those
332variables like:
332 333
333@lisp 334@lisp
334(setq gnus-buttonized-mime-types 335(setq gnus-buttonized-mime-types
diff --git a/man/gnus.texi b/man/gnus.texi
index bdfe5ab2194..72596ed26ce 100644
--- a/man/gnus.texi
+++ b/man/gnus.texi
@@ -9369,10 +9369,10 @@ Display "multipart/alternative" parts as "multipart/mixed".
9369Display "multipart/related" parts as "multipart/mixed". 9369Display "multipart/related" parts as "multipart/mixed".
9370 9370
9371If displaying "text/html" is discouraged, see 9371If displaying "text/html" is discouraged, see
9372@code{mm-discouraged-alternatives} in @ref{Display Customization, 9372@code{mm-discouraged-alternatives}, images or other material inside a
9373Display Customization, , emacs-mime, Emacs-Mime Manual}. Images or 9373"multipart/related" part might be overlooked when this variable is
9374other material inside a "multipart/related" part might be overlooked 9374@code{nil}. @ref{Display Customization, Display Customization, ,
9375when this variable is @code{nil}. 9375emacs-mime, Emacs-Mime Manual}.
9376 9376
9377@vindex gnus-mime-display-multipart-as-mixed 9377@vindex gnus-mime-display-multipart-as-mixed
9378@item gnus-mime-display-multipart-as-mixed 9378@item gnus-mime-display-multipart-as-mixed
@@ -14006,7 +14006,8 @@ splits. Here are the possible split syntaxes:
14006If the split is a string, that will be taken as a group name. Normal 14006If the split is a string, that will be taken as a group name. Normal
14007regexp match expansion will be done. See below for examples. 14007regexp match expansion will be done. See below for examples.
14008 14008
14009@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split}) 14009@c Don't fold this line.
14010@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split} [@var{invert-match-partial-words}])
14010If the split is a list, the first element of which is a string, then 14011If the split is a list, the first element of which is a string, then
14011store the message as specified by @var{split}, if header @var{field} 14012store the message as specified by @var{split}, if header @var{field}
14012(a regexp) contains @var{value} (also a regexp). If @var{restrict} 14013(a regexp) contains @var{value} (also a regexp). If @var{restrict}
@@ -14014,6 +14015,11 @@ store the message as specified by @var{split}, if header @var{field}
14014the end of the matched @var{value}, the @var{split} is ignored. If 14015the end of the matched @var{value}, the @var{split} is ignored. If
14015none of the @var{restrict} clauses match, @var{split} is processed. 14016none of the @var{restrict} clauses match, @var{split} is processed.
14016 14017
14018The last element @var{invert-match-partial-words} is optional. If it is
14019not omitted and the value is non-@code{nil}, the match-partial-words
14020behavior controlled by the @code{nnmail-split-fancy-match-partial-words}
14021variable (see below) will be inverted. (New in Gnus 5.10.7)
14022
14017@item (| @var{split} @dots{}) 14023@item (| @var{split} @dots{})
14018If the split is a list, and the first element is @code{|} (vertical 14024If the split is a list, and the first element is @code{|} (vertical
14019bar), then process each @var{split} until one of them matches. A 14025bar), then process each @var{split} until one of them matches. A
@@ -14067,10 +14073,50 @@ If the split is @code{nil}, it is ignored.
14067@end table 14073@end table
14068 14074
14069In these splits, @var{field} must match a complete field name. 14075In these splits, @var{field} must match a complete field name.
14070@var{value} must match a complete word according to the fundamental mode 14076
14071syntax table. You can use @code{.*} in the regexps to match partial 14077Normally, @var{value} in these splits must match a complete @emph{word}
14072field names or words. In other words, all @var{value}'s are wrapped in 14078according to the fundamental mode syntax table. In other words, all
14073@samp{\<} and @samp{\>} pairs. 14079@var{value}'s will be implicitly surrounded by @code{\<...\>} markers,
14080which are word delimiters. Therefore, if you use the following split,
14081for example,
14082
14083@example
14084(any "joe" "joemail")
14085@end example
14086
14087@noindent
14088messages sent from @samp{joedavis@@foo.org} will normally not be filed
14089in @samp{joemail}. If you want to alter this behavior, you can use any
14090of the following three ways:
14091
14092@enumerate
14093@item
14094@vindex nnmail-split-fancy-match-partial-words
14095You can set the @code{nnmail-split-fancy-match-partial-words} variable
14096to non-@code{nil} in order to ignore word boundaries and instead the
14097match becomes more like a grep. This variable controls whether partial
14098words are matched during fancy splitting. The default value is
14099@code{nil}.
14100
14101Note that it influences all @var{value}'s in your split rules.
14102
14103@item
14104@var{value} beginning with @code{.*} ignores word boundaries in front of
14105a word. Similarly, if @var{value} ends with @code{.*}, word boundaries
14106in the rear of a word will be ignored. For example, the @var{value}
14107@code{"@@example\\.com"} does not match @samp{foo@@example.com} but
14108@code{".*@@example\\.com"} does.
14109
14110@item
14111You can set the @var{invert-match-partial-words} flag in your split
14112rules of the @samp{(@var{field} @var{value} @dots{})} types,
14113aforementioned in this section. If the flag is set, word boundaries on
14114both sides of a word are ignored even if
14115@code{nnmail-split-fancy-match-partial-words} is @code{nil}.
14116Contrarily, if the flag is set, word boundaries are not ignored even if
14117@code{nnmail-split-fancy-match-partial-words} is non-@code{nil}. (New
14118in Gnus 5.10.7)
14119@end enumerate
14074 14120
14075@vindex nnmail-split-abbrev-alist 14121@vindex nnmail-split-abbrev-alist
14076@var{field} and @var{value} can also be Lisp symbols, in that case 14122@var{field} and @var{value} can also be Lisp symbols, in that case
@@ -14118,25 +14164,6 @@ groups when users send to an address using different case
14118(i.e. mailing-list@@domain vs Mailing-List@@Domain). The default value 14164(i.e. mailing-list@@domain vs Mailing-List@@Domain). The default value
14119is @code{t}. 14165is @code{t}.
14120 14166
14121@vindex nnmail-split-fancy-match-partial-words
14122@code{nnmail-split-fancy-match-partial-words} controls whether partial
14123words are matched during fancy splitting.
14124
14125Normally, regular expressions given in @code{nnmail-split-fancy} are
14126implicitly surrounded by @code{\<...\>} markers, which are word
14127delimiters. If this variable is true, they are not implicitly
14128surrounded by anything.
14129
14130@example
14131(any "joe" "joemail")
14132@end example
14133
14134In this example, messages sent from @samp{joedavis@@foo.org} will
14135normally not be filed in @samp{joemail}. With
14136@code{nnmail-split-fancy-match-partial-words} set to @code{t},
14137however, the match will happen. In effect, the requirement of a word
14138boundary is removed and instead the match becomes more like a grep.
14139
14140@findex nnmail-split-fancy-with-parent 14167@findex nnmail-split-fancy-with-parent
14141@code{nnmail-split-fancy-with-parent} is a function which allows you to 14168@code{nnmail-split-fancy-with-parent} is a function which allows you to
14142split followups into the same groups their parents are in. Sometimes 14169split followups into the same groups their parents are in. Sometimes
@@ -22295,11 +22322,11 @@ default.
22295@item gnus-use-toolbar 22322@item gnus-use-toolbar
22296@vindex gnus-use-toolbar 22323@vindex gnus-use-toolbar
22297This variable specifies the position to display the toolbar. If 22324This variable specifies the position to display the toolbar. If
22298@code{nil}, don't display toolbars. If it is non-nil, it should be one 22325@code{nil}, don't display toolbars. If it is non-@code{nil}, it should
22299of the symbols @code{default}, @code{top}, @code{bottom}, @code{right}, 22326be one of the symbols @code{default}, @code{top}, @code{bottom},
22300and @code{left}. @code{default} means to use the default toolbar, the 22327@code{right}, and @code{left}. @code{default} means to use the default
22301rest mean to display the toolbar on the place which those names show. 22328toolbar, the rest mean to display the toolbar on the place which those
22302The default is @code{default}. 22329names show. The default is @code{default}.
22303 22330
22304@item gnus-toolbar-thickness 22331@item gnus-toolbar-thickness
22305@vindex gnus-toolbar-thickness 22332@vindex gnus-toolbar-thickness
@@ -26221,6 +26248,8 @@ groups.
26221A new file from Raymond Scholz @email{rscholz@@zonix.de} for deuglifying 26248A new file from Raymond Scholz @email{rscholz@@zonix.de} for deuglifying
26222broken Outlook (Express) articles. 26249broken Outlook (Express) articles.
26223 26250
26251@c FIXME: `gnus-load' is mentioned in README, which is not included in
26252@c CVS. We should find a better place for this item.
26224@item 26253@item
26225@code{(require 'gnus-load)} 26254@code{(require 'gnus-load)}
26226 26255
@@ -26309,6 +26338,11 @@ Decoding format=flowed was present but not documented in earlier
26309versions. 26338versions.
26310 26339
26311@item 26340@item
26341The option @code{mm-fill-flowed} can be used to disable treatment of
26342``format=flowed'' messages. Also, flowed text is disabled when sending
26343inline PGP signed messages. (New in Gnus 5.10.7)
26344
26345@item
26312Gnus supports the generation of RFC 2298 Disposition Notification requests. 26346Gnus supports the generation of RFC 2298 Disposition Notification requests.
26313 26347
26314This is invoked with the @kbd{C-c M-n} key binding from message mode. 26348This is invoked with the @kbd{C-c M-n} key binding from message mode.
diff --git a/man/mh-e.texi b/man/mh-e.texi
index 36dfd9fd939..df0595a5c70 100644
--- a/man/mh-e.texi
+++ b/man/mh-e.texi
@@ -1,3553 +1,8681 @@
1\input texinfo @c -*-texinfo-*- 1\input texinfo @c -*-texinfo-*-
2@c
3@c Note: This document requires makeinfo version 4.6 or greater to build.
4@c
2@c %**start of header 5@c %**start of header
3@setfilename ../info/mh-e 6@setfilename ../info/mh-e
4@settitle mh-e 7@settitle The MH-E Manual
5@c %**end of header 8@c %**end of header
6 9
7@c Version variables. 10@c Version of the software and manual.
8@set EDITION 1.3 11@set VERSION 7.93
9@set VERSION 5.0.2 12@c EDITION of the manual. It is either empty for the first edition or
10@set UPDATED 18 February 2001 13@c has the form ", nth Edition" (without the quotes).
11@set UPDATE-MONTH February 2001 14@set EDITION
15@set UPDATED 2006-03-05
16@set UPDATE-MONTH March, 2006
12 17
18@c Other variables.
19@set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh
20@set MH-E-HOME http://mh-e.sourceforge.net/
21
22@c Copyright
13@copying 23@copying
14This is Edition @value{EDITION}, last updated @value{UPDATED}, of 24This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
15@cite{mh-e, The Emacs Interface to MH}, for mh-e, Version 25Manual}, last updated @value{UPDATED}
16@value{VERSION}.
17 26
18Copyright (C) 1995, 2001, 2002, 2003, 2004, 27Copyright @copyright{} 1995,
19 2005, 2006 Free Software Foundation, Inc. 28 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
20 29
21@quotation 30@quotation
22Permission is granted to copy, distribute and/or modify this document 31The MH-E manual is free documentation; you can redistribute it and/or
23under the terms of the GNU Free Documentation License, Version 1.2 or 32modify it under the terms of either:
24any later version published by the Free Software Foundation; with no 33
25Invariant Sections, with the Front-Cover texts being ``A GNU 34@enumerate a
26Manual'', and with the Back-Cover Texts as in (a) below. A copy of the 35@item
27license is included in the section entitled ``GNU Free Documentation 36the GNU Free Documentation License, Version 1.2 or any later version
28License'' in the Emacs manual. 37published by the Free Software Foundation; with no Invariant Sections,
29 38no Front-Cover Texts, and no Back-Cover Texts.
30(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify 39
31this GNU Manual, like GNU software. Copies published by the Free 40@item
32Software Foundation raise funds for GNU development.'' 41the GNU General Public License as published by the Free Software
33 42Foundation; either version 2, or (at your option) any later version.
34This document is part of a collection distributed under the GNU Free 43@end enumerate
35Documentation License. If you want to distribute this document 44
36separately from the collection, you can do so by adding a copy of the 45The MH-E manual is distributed in the hope that it will be useful, but
37license to the document, as described in section 6 of the license. 46WITHOUT ANY WARRANTY; without even the implied warranty of
47MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
48General Public License or GNU Free Documentation License for more
49details.
50
51The GNU General Public License and the GNU Free Documentation License
52appear as appendices to this document. You may also request copies by
53writing to the Free Software Foundation, Inc., 51 Franklin Street,
54Fifth Floor, Boston, MA 02110-1301, USA.
38@end quotation 55@end quotation
39@end copying 56@end copying
40 57
41@setchapternewpage odd 58@c Info Directory Entry
42
43@dircategory Emacs 59@dircategory Emacs
44@direntry 60@direntry
45* MH-E: (mh-e). Emacs interface to the MH mail system. 61* MH-E: (mh-e). Emacs interface to the MH mail system.
46@end direntry 62@end direntry
47 63
64@c Title Page
65@setchapternewpage odd
48@titlepage 66@titlepage
49@sp 10 67@title The MH-E Manual
50@center @titlefont{mh-e} 68@subtitle Version @value{VERSION}@value{EDITION}
51@sp 2 69@subtitle @value{UPDATE-MONTH}
52@center The Emacs Interface to MH 70@author Bill Wohler
53@sp 2
54@center by Bill Wohler
55@sp 2
56@center Edition @value{EDITION} for mh-e Version @value{VERSION}
57@sp 2
58@center @value{UPDATE-MONTH}
59 71
72@c Copyright Page
60@page 73@page
61@vskip 0pt plus 1filll 74@vskip 0pt plus 1filll
62Copyright @copyright{} 1995, 2001, 2002, 2006 Free Software Foundation, Inc.
63@insertcopying 75@insertcopying
64@end titlepage 76@end titlepage
65 77
66@ifnottex 78@ifnottex
79@html
80<!--
81@end html
67@node Top, Preface, (dir), (dir) 82@node Top, Preface, (dir), (dir)
68@top MH and Emacs 83@top The MH-E Manual
69This is Edition @value{EDITION} of @cite{mh-e, The Emacs Interface to 84@html
70MH}, last updated @value{UPDATED} for mh-e Version @value{VERSION}. 85-->
86@end html
87@insertcopying
88@end ifnottex
89
90@c Table of Contents
91@contents
92
93@html
94<!--
95@end html
71 96
72@menu 97@menu
73* Preface:: Introduction to mh-e. 98* Preface:: Preface
74* Tour Through mh-e:: Use mh-e quickly! 99* Conventions:: GNU Emacs Terms and Conventions
75* Using mh-e:: Documentation for all commands. 100* Getting Started:: Getting Started
76* Customizing mh-e:: Documentation for all variables. 101* Tour Through MH-E:: Tour Through MH-E
77* Odds and Ends:: Getting mh-e, reporting bugs, mailing 102* Using This Manual:: Using This Manual
78 list and FAQ. 103* Incorporating Mail:: Incorporating Mail
79* History:: The authors speak up! 104* Reading Mail:: Reading Mail
80* Copying:: The GNU General Public License 105* Folders:: Organizing Your Mail with Folders
81* Command Index:: 106* Sending Mail:: Sending Mail
82* Variable Index:: 107* Editing Drafts:: Editing a Draft
83* Concept Index:: 108* Aliases:: Aliases
109* Identities:: Identities
110* Speedbar:: The Speedbar
111* Menu Bar:: The Menu Bar
112* Tool Bar:: The Tool Bar
113* Searching:: Searching Through Messages
114* Threading:: Viewing Message Threads
115* Limits:: Limiting Display
116* Sequences:: Using Sequences
117* Junk:: Dealing With Junk Mail
118* Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
119* Scan Line Formats:: Scan Line Formats
120* Procmail:: Reading Mailing Lists Effectively
121* Odds and Ends:: Odds and Ends
122* History:: History of MH-E
123* GFDL:: GNU Free Documentation License
124* GPL:: GNU Public License
125* Key Index:: Key (Character) Index
126* Command Index:: Command Index
127* Option Index:: Option (Variable) Index
128* Concept Index:: Concept Index
129
130@detailmenu
131 --- The Detailed Node Listing ---
132
133Tour Through MH-E
134
135* Sending Mail Tour::
136* Reading Mail Tour::
137* Processing Mail Tour::
138* Leaving MH-E::
139* More About MH-E::
140
141Using This Manual
142
143* Options::
144* Ranges::
145* Folder Selection::
146
147Reading Your Mail
148
149* Viewing::
150* Viewing Attachments::
151* HTML::
152* Digests::
153* Reading PGP::
154* Printing::
155* Files and Pipes::
156* Navigating::
157* Miscellaneous Commands and Options::
158
159Sending Mail
160
161* Composing::
162* Replying::
163* Forwarding::
164* Redistributing::
165* Editing Again::
166
167Editing a Draft
168
169* Editing Message::
170* Inserting Letter::
171* Inserting Messages::
172* Signature::
173* Picture::
174* Adding Attachments::
175* Sending PGP::
176* Checking Recipients::
177* Sending Message::
178* Killing Draft::
179
180Odds and Ends
181
182* Bug Reports::
183* Mailing Lists::
184* MH FAQ and Support::
185* Getting MH-E::
186
187History of MH-E
188
189* From Brian Reid::
190* From Jim Larus::
191* From Stephen Gildea::
192* From Bill Wohler::
193
194@end detailmenu
84@end menu 195@end menu
85@end ifnottex
86 196
87@node Preface, Tour Through mh-e, Top, Top 197@html
198-->
199@end html
200
201@node Preface, Conventions, Top, Top
88@unnumbered Preface 202@unnumbered Preface
89 203
90@cindex Emacs 204@cindex Emacs
91@cindex Unix commands, Emacs 205@cindex Unix commands, Emacs
92 206
93These chapters introduce another interface to MH that is accessible 207This manual introduces another interface to the MH mail system that is
94through the GNU Emacs editor, namely, @emph{mh-e}. mh-e is easy to use. 208accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
95I don't assume that you know GNU Emacs or even MH at this point, since I 209easy to use. I don't assume that you know GNU Emacs or even MH at this
96didn't know either of them when I discovered mh-e. However, mh-e was 210point, since I didn't know either of them when I discovered MH-E.
97the tip of the iceberg, and I discovered more and more niceties about 211However, MH-E was the tip of the iceberg, and I discovered more and
98GNU Emacs and MH@. Now I'm fully hooked on both of them. 212more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
99 213them.
100@cindex history 214
101 215The MH-E package is distributed with GNU Emacs@footnote{Version
102The mh-e package is distributed with GNU Emacs, @footnote{Note that 216@value{VERSION} of MH-E will appear in GNU Emacs 22.1. It is supported
103mh-e is supported with MH 6 and @w{Emacs 18} and up. 217in GNU Emacs 21, as well as XEmacs 21 (except for versions
104Reportedly, large parts of it work with @w{MH 5} and also with 21821.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
105Lucid/XEmacs and Epoch, but there are no guarantees. It is also 219all versions of nmh, and GNU mailutils 0.4 and higher.}, so you
106distributed with Lucid/XEmacs, as well as with MH itself.} so you 220shouldn't have to do anything special to use it. This manual covers
107shouldn't have to do anything special to use it. But it's important to 221MH-E version @value{VERSION}. @ref{Getting Started} will help you
108note a brief history of mh-e. @w{Version 3} was prevalent through the 222decide which version you have.
109@w{Emacs 18} and early @w{Emacs 19} years. Then @w{Version 4} came out 223
110(@w{Emacs 19.23}), which introduced several new and changed commands. 224If you don't already use GNU Emacs but want to learn more, you can
111Finally, @w{Version 5.0} was released, which fixed some bugs and 225read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
112incompatibilities, and was incorporated into @w{Emacs 19.29}. This is 226(@code{help-with-tutorial}). (To learn about this notation, see
113the version covered by this manual. @ref{Getting Started} will help 227@ref{Conventions}.) If you want to take the plunge, consult the
114you decide which version you have.
115
116If you don't already use GNU Emacs but want to learn more, you can read
117an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
118(@code{help-with-tutorial}). (This notation is described in
119@ref{Conventions}.) If you want to take the plunge, consult the
120@iftex 228@iftex
121@cite{GNU Emacs Manual}, 229@cite{GNU Emacs Manual},
122@end iftex 230@end iftex
123@ifinfo 231@ifinfo
124@ref{top, , GNU Emacs Manual, emacs, The GNU Emacs Manual}, 232@ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
125@end ifinfo 233@end ifinfo
234@ifhtml
235@uref{http://www.gnu.org/software/emacs/manual/html_node/,
236@cite{GNU Emacs Manual}},
237@end ifhtml
126from the Free Software Foundation. 238from the Free Software Foundation.
127 239
128If more information is needed, you can go to the Unix manual pages of 240If more information is needed, you can go to the Unix manual pages of
129the individual MH commands. When the name is not obvious, I'll guide 241the individual MH commands. When the name is not obvious, I'll guide
130you to a relevant MH manual page that describes the action more fully. 242you to a relevant MH manual page that describes the action more fully.
131 243
132I hope you enjoy these chapters! If you have any comments, or 244This manual is available in both Info and online formats. The Info
133suggestions for this document, please let me know. 245version is distributed with Emacs and can be accessed with the
134 246@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{M-x
135@noindent 247info @key{RET} m mh-e @key{RET}}). The online version is available at
136Bill Wohler <@i{wohler@@newt.com}>@* 248@uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
1378 February 1995 249online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
138 250@cite{MH & nmh: Email for Users & Programmers}} (also known as
139@node Tour Through mh-e, Using mh-e, Preface, Top 251@dfn{the MH book}).
140@chapter Tour Through mh-e
141 252
142This chapter introduces some of the terms you'll need to know and then 253I hope you enjoy this manual! If you have any comments, or suggestions
143takes you on a tour of mh-e. @footnote{The keys mentioned in these 254for this document, please let me know.
144chapters refer to the default key bindings. If you've changed the
145bindings, refer to the command summaries at the beginning of each major
146section in @ref{Using mh-e}, for a mapping between default key bindings
147and function names.} When you're done, you'll be able to send, read,
148and file mail, which is all that a lot of people ever do. But if you're
149the curious type, you'll read @ref{Using mh-e} to be able to use all
150the features of mh-e. If you're the adventurous type, you'll read
151@ref{Customizing mh-e} to make mh-e do what you want. I suggest you
152read this chapter first to get the big picture, and then you can read
153the other two as you wish.
154 255
155@menu 256@cindex Bill Wohler
156* Conventions:: GNU Emacs Terms and Conventions 257@cindex Wohler, Bill
157* Getting Started::
158* Sending Mail Tour::
159* Reading Mail Tour::
160* Processing Mail Tour::
161* Leaving mh-e::
162* More About mh-e::
163@end menu
164 258
165@node Conventions, Getting Started, Tour Through mh-e, Tour Through mh-e 259@noindent
166@section GNU Emacs Terms and Conventions 260Bill Wohler <@i{wohler at newt.com}>@*
2618 February 1995@*
26224 February 2006
167 263
168@cindex Emacs, terms and conventions 264@node Conventions, Getting Started, Preface, Top
265@chapter GNU Emacs Terms and Conventions
169 266
170@cindex Emacs 267@cindex Emacs
268@cindex Emacs, terms and conventions
171@cindex Unix commands, Emacs 269@cindex Unix commands, Emacs
172 270
173If you're an experienced Emacs user, you can skip the following 271If you're an experienced Emacs user, you can skip the following
174conventions and definition of terms and go directly to @ref{Getting 272conventions and definition of terms and go directly to the next
175Started} below. The conventions are as follows: 273section (@pxref{Getting Started}).
274
275@cindex Emacs commands
276@cindex MH commands
277@cindex Unix commands
278@cindex commands
279@cindex commands, MH
280@cindex commands, Unix
281@cindex commands, shell
282@cindex functions
283@cindex shell commands
284
285In general, @dfn{functions} in this text refer to Emacs Lisp functions
286that one would call from within Emacs Lisp programs (for example,
287@code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
288things that are run by the user, such as @kbd{i} or @kbd{M-x
289mh-inc-folder}. Programs outside of Emacs are specifically called MH
290commands, shell commands, or Unix commands.
291
292@cindex conventions, key names
293@cindex key names
294
295The conventions for key names are as follows:
176 296
177@table @kbd 297@table @kbd
178@item C-x 298@item C-x
179Hold down the @key{CTRL} (Control) key and press the @kbd{x} key. 299Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
300@c -------------------------
180@item M-x 301@item M-x
181Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key. 302Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
182 303
183Since some keyboards don't have a @key{META} key, you can generate 304Since some keyboards don't have a @key{META} key, you can generate
184@kbd{M-x}, for example, by pressing @key{ESC} (Escape), @emph{releasing 305@kbd{M-x}, for example, by pressing @key{ESC} (Escape),
185it}, @footnote{This is emphasized because pressing ESC twice or holding 306@emph{releasing it}, and then pressing the @kbd{x} key.
186it down a second too long so that it repeats gives you an error message.} 307@c -------------------------
187and then pressing the @kbd{x} key. 308@item @key{RET}
188@item RET 309Press the @key{RETURN} or @key{ENTER} key. This is normally used to
189Press the @key{RETURN} or @key{ENTER} key. This is normally used to
190complete a command. 310complete a command.
191@item SPC 311@c -------------------------
312@item @key{SPC}
192Press the space bar. 313Press the space bar.
193@item TAB 314@c -------------------------
315@item @key{TAB}
194Press the @key{TAB} key. 316Press the @key{TAB} key.
195@item DEL 317@c -------------------------
318@item @key{DEL}
196Press the @key{DELETE} key. 319Press the @key{DELETE} key.
197@item BS 320@c -------------------------
198Press the @key{BACKSPACE} key. @footnote{If you are using Version 20 321@item @key{BS}
199or earlier of Emacs, you will need to use the @key{DEL} key.} 322Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
323earlier of Emacs, you will need to use the @key{DEL} key.}.
200@end table 324@end table
201 325
202@cindex Emacs, prefix argument 326@cindex Emacs, prefix argument
203@cindex prefix argument 327@cindex prefix argument
204 328
205A @dfn{prefix argument} allows you to pass an argument to any Emacs 329A @dfn{prefix argument} allows you to pass an argument to any Emacs
206function. To pass an argument, type @kbd{C-u} before the Emacs command 330function. To pass an argument, type @kbd{C-u} before the Emacs command
207or keystroke. Numeric arguments can be passed as well. For example, to 331or keystroke. Numeric arguments can be passed as well. For example, to
208insert five f's, use @kbd{C-u 5 f}. There is a default of four when 332insert five f's, use @kbd{C-u 5 f}. There is a default of four when
209using @kbd{C-u}, and you can use multiple prefix arguments to provide 333using @kbd{C-u}, and you can use multiple prefix arguments to provide
210arguments of powers of four. To continue our example, you could insert 334arguments of powers of four. To continue our example, you could insert
211four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with 335four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
212@kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative 336@kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
213arguments can also be inserted with the @key{META} key. Examples 337arguments can also be inserted with the @key{META} key. Examples
214include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which 338include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
215specifies a negative argument with no particular value. 339specifies a negative argument with no particular value.
216 340
217@sp 2 341@sp 1
218@need 1000
219@center @strong{NOTE} 342@center @strong{NOTE}
220 343
221@quotation 344@quotation
222The prefix @kbd{C-u} or @kbd{M-} is not necessary in mh-e's MH-Folder 345The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
223modes (@pxref{Reading Mail Tour}). In these modes, simply enter the 346mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
224numerical argument before entering the command. 347numerical argument before entering the command.
225@end quotation 348@end quotation
349@sp 1
350
351@cindex Emacs, variables
352@cindex variables
353
354Emacs uses @dfn{variables} to hold values. These can be changed via
355calls to the function @code{setq} in @file{~/.emacs}.
356
357@cindex Emacs, options
358@cindex options
359@findex customize-group
360@findex customize-option
361
362Variables in MH-E that are normally modified by the user are called
363@dfn{options} and are modified through the customize functions (such
364as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
365@ifnothtml
366@xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
367GNU Emacs Manual}.
368@end ifnothtml
369@ifhtml
370See section
371@uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html,
372Easy Customization} in @cite{The GNU Emacs Manual}.
373@end ifhtml
374@xref{Options}.
375
376@cindex Emacs, faces
377@cindex faces
378@cindex highlighting
379@findex customize-face
380
381You can specify various styles for displaying text using @dfn{faces}.
382MH-E provides a set of faces that you can use to personalize the look
383of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
384this.
385@ifnothtml
386@xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
387GNU Emacs Manual}.
388@end ifnothtml
389@ifhtml
390See section
391@uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html,
392Face Customization} in @cite{The GNU Emacs Manual}.
393@end ifhtml
394
395@cindex hooks
396@cindex normal hooks
397@cindex abnormal hooks
398
399Commands often offer @dfn{hooks} which enable you to extend or modify
400the way a command works.
401@ifnothtml
402@ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
403Emacs Manual}
404@end ifnothtml
405@ifhtml
406See section
407@uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html,
408Hooks} in @cite{The GNU Emacs Manual}
409@end ifhtml
410for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
411MH-E uses normal hooks in nearly all cases, so you can assume that we
412are talking about normal hooks unless we explicitly mention that a hook
413is abnormal. We also follow the conventions described in that section:
414the name of the abnormal hooks end in @code{-hooks} and all the rest
415of the MH-E hooks end in @code{-hook}.
226 416
227@cindex point 417@cindex Emacs, mark
228@cindex Emacs, point 418@cindex Emacs, point
419@cindex Emacs, region
229@cindex mark 420@cindex mark
230@cindex Emacs, mark 421@cindex point
231@cindex region 422@cindex region
232@cindex Emacs, region
233 423
234There are several other terms that are used in Emacs that you should 424There are several other terms that are used in Emacs that you should
235know. The @dfn{point} is where the cursor currently is. You can save 425know. The @dfn{point} is where the cursor currently is. You can save
236your current place in the file by setting a @dfn{mark}. This operation 426your current place in the file by setting a @dfn{mark}. This operation
237is useful in several ways. The mark can be later used when defining a 427is useful in several ways. The mark can be later used when defining a
238@dfn{region}, which is the text between the point and mark. Many 428@dfn{region}, which is the text between the point and mark. Many
239commands operate on regions, such as those for deleting text or filling 429commands operate on regions, such as those for deleting text or
240paragraphs. A mark can be set with @kbd{C-@@} (or @kbd{C-SPC}). 430filling paragraphs. A mark can be set with @kbd{C-@@} (or
241 431@kbd{C-@key{SPC}}).
242@cindex minibuffer 432
433@cindex Emacs, completion
434@cindex Emacs, file completion
435@cindex Emacs, folder completion
243@cindex Emacs, minibuffer 436@cindex Emacs, minibuffer
437@cindex completion
244@cindex file completion 438@cindex file completion
245@cindex Emacs, file completion 439@cindex folder completion
440@cindex minibuffer
246 441
247The @dfn{minibuffer} is the bottom line of the Emacs window, where all 442The @dfn{minibuffer} is the bottom line of the Emacs window, where all
248prompting and multiple-character input is directed. If you are prompted 443prompting and multiple-character input is directed. You can use
249for information in the minibuffer, such as a filename, Emacs can help 444@dfn{completion} to enter values such as folders. Completion means
250you complete your answer if you type @key{SPC} or @key{TAB}. A second 445that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
251@key{SPC} or @key{TAB} will list all possibilities at that point. The 446A second @key{SPC} or @key{TAB} will list all possibilities at that
252minibuffer is also where you enter Emacs function names after typing 447point.
253@kbd{M-x}. For example, in the first paragraph, I mentioned that you 448@ifnothtml
254could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What 449@xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
450@end ifnothtml
451@ifhtml
452See the section
453@uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
454Completion} in @cite{The GNU Emacs Manual}.
455@end ifhtml
456Note that @key{SPC} cannot be used for completing filenames and
457folders.
458
459The minibuffer is also where you enter Emacs function names after
460typing @kbd{M-x}. For example, in the preface, I mentioned that you
461could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
255this means is that you can get a tutorial by typing either @kbd{C-h t} 462this means is that you can get a tutorial by typing either @kbd{C-h t}
256or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted 463or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
257for @samp{help-with-tutorial} in the minibuffer after typing @kbd{M-x}. 464for @samp{help-with-tutorial} in the minibuffer after typing
465@kbd{M-x}.
466
467@cindex ~
468
469The @samp{~} notation in filenames represents your home directory.
470This notation is used by many shells including @command{bash},
471@code{tcsh}, and @command{csh}. It is analogous to the environment
472variable @samp{$HOME}. For example, @file{~/.emacs} can be written
473@file{$HOME/.emacs} or using the absolute path as in
474@file{/home/wohler/.emacs} instead.
258 475
259@cindex interrupting
260@cindex Emacs, interrupting 476@cindex Emacs, interrupting
261@cindex quitting
262@cindex Emacs, quitting 477@cindex Emacs, quitting
478@cindex interrupting
479@cindex quitting
263 480
264@i{In case of trouble:} Emacs can be interrupted at any time with 481@i{In case of trouble:} Emacs can be interrupted at any time with
265@kbd{C-g}. For example, if you've started a command that requests that 482@kbd{C-g}. For example, if you've started a command that requests that
266you enter something in the minibuffer, but then you change your mind, 483you enter something in the minibuffer, but then you change your mind,
267type @kbd{C-g} and you'll be back where you started. If you want to 484type @kbd{C-g} and you'll be back where you started. If you want to
268exit Emacs entirely, use @kbd{C-x C-c}. 485exit Emacs entirely, use @kbd{C-x C-c}.
269 486
270@node Getting Started, Sending Mail Tour, Conventions, Tour Through mh-e 487@node Getting Started, Tour Through MH-E, Conventions, Top
271@section Getting Started 488@chapter Getting Started
272
273Because there are many old versions of mh-e out there, it is important to
274know which version you have. I'll be talking about @w{Version 5} which
275is similar to @w{Version 4} and vastly different from @w{Version 3}.
276
277First, enter @kbd{M-x load-library @key{RET} mh-e
278@key{RET}}. @footnote{You wouldn't ordinarily do this.} The message,
279@samp{Loading mh-e...done}, should be displayed in the minibuffer. If
280you get @samp{Cannot open load file: mh-e}, then your Emacs is very
281badly configured, or mh-e is missing. You may wish to have your system
282administrator install a new Emacs or at least the latest mh-e files.
283
284Having loaded mh-e successfully, enter @kbd{M-x mh-version @key{RET}}.
285The version of mh-e should be displayed. Hopefully it says that you're
286running @w{Version @value{VERSION}} which is the latest version as of
287this printing. If instead Emacs beeps and says @samp{[No match]}, then
288you're running an old version of mh-e.
289
290If these tests reveal a non-existent or old version of mh-e, please
291consider obtaining a new version. You can have your system
292administrator upgrade the system-wide version, or you can install your
293own personal version. It's really quite easy; instructions for getting
294and installing mh-e are in @ref{Getting mh-e}.
295
296@cindex @code{install-mh}
297@cindex MH commands, @code{install-mh}
298
299Also, older versions of mh-e assumed that you had already set up your MH
300environment. Newer versions set up a new MH environment for you by
301running @code{install-mh} and notifying you of this fact with the
302message in a temporary buffer:
303
304@example
305I'm going to create the standard MH path for you.
306@end example
307
308Therefore, if you've never run MH before and you're using an old version
309of mh-e, you need to run @code{install-mh} from the shell before you
310continue the tour. If you don't, you'll be greeted with the error
311message: @samp{Can't find MH profile}.
312
313@cindex @file{.emacs}
314@cindex files, @file{.emacs}
315 489
316If, during the tour described in this chapter, you see a message like: 490@cindex MH-E, versions
317@samp{Searching for program: no such file or directory, 491@cindex history
318/usr/local/bin/mhpath}, it means that the MH programs and files are kept 492@cindex versions of MH-E
319in a nonstandard directory. In this case, simply add the following to 493
320@file{~/.emacs} and restart @code{emacs}. 494Because there are many old versions of MH-E out there, it is important
321 495to know which version you have. I'll be talking about @w{Version 8}
322@vindex @code{mh-progs}, example 496which is pretty close to @w{Version 6} and @w{Version 7}. It differs
323@vindex @code{mh-lib}, example 497from @w{Version 4} and @w{Version 5} and is vastly different from
324 498@w{Version 3}. @xref{History}.
325@c XXX Real example for really naive user? 499
326@example 500@findex mh-version
327@group 501
328(setq mh-progs "@var{/path/to/MH/binary/directory/}") 502To determine which version of MH-E that you have, enter @kbd{M-x
329(setq mh-lib "@var{/path/to/MH/library/directory/}") 503mh-version @key{RET}}. Hopefully it says that you're running
330@end group 504@w{Version @value{VERSION}} which is the latest version as of this
331@end example 505printing.
506
507If your version is much older than this, please consider upgrading.
508You can have your system administrator upgrade the system-wide
509version, or you can install your own personal version. It's really
510quite easy. @xref{Getting MH-E}, for instructions for getting and
511installing MH-E.
512
513If the @code{mh-version} command displays @samp{No MH variant
514detected}, then you need to install MH or tell MH-E where to find
515MH@footnote{In very old versions of MH-E, you may get the error
516message, @samp{Cannot find the commands `inc' and `mhl' and the file
517`components'} if MH-E can't find MH. In this case, you need to update
518MH-E, and you may need to install MH too. However, newer versions of
519MH-E are better at finding MH if it is on your system.}.
520
521The option @code{mh-variant} specifies the variant used by MH-E
522(@pxref{Options}). The default setting of this option is
523@samp{Auto-detect} which means that MH-E will automatically choose the
524first of nmh, MH, or GNU mailutils that it finds in the directories
525listed in @code{mh-path} (which you can customize),
526@code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
527all, you may have to customize @code{mh-path} and add the directory in
528which the command @code{mhparam} is located. If, on the other hand,
529you have both nmh and mailutils installed (for example) and
530@code{mh-variant-in-use} was initialized to nmh but you want to use
531mailutils, then you can set @code{mh-variant} to @samp{mailutils}.
532
533When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
534@code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
535@code{mh-variant-in-use} accordingly.
536
537@sp 1
538@center @strong{NOTE}
332 539
333@cindex ~ 540@quotation
541Prior to version 8, it was often necessary to set some of these
542variables in @file{~/.emacs}; now it is no longer necessary and can
543actually cause problems.
544@end quotation
545@sp 1
546
547@cindex @command{install-mh}
548@cindex MH commands, @command{install-mh}
549
550If you've never run MH before, you need to run @command{install-mh}
551from the shell before you continue. This sets up your personal MH
552environment@footnote{See the section
553@uref{@value{MH-BOOK-HOME}/setup.htm, Setting Up MH} in the MH book.}.
554If you don't, you'll be greeted with the error message: @samp{Install
555MH and run install-mh before running MH-E}.
556
557@cindex @samp{Draft-Folder:} MH profile component
558@cindex @samp{Path:} MH profile component
559@cindex @samp{Previous-Sequence:} MH profile component
560@cindex @samp{Unseen-Sequence:} MH profile component
561@cindex MH profile component, @samp{Draft-Folder:}
562@cindex MH profile component, @samp{Path:}
563@cindex MH profile component, @samp{Previous-Sequence:}
564@cindex MH profile component, @samp{Unseen-Sequence:}
565@findex mh-find-path
566@vindex mh-draft-folder
567@vindex mh-find-path-hook
568@vindex mh-inbox
569@vindex mh-previous-seq
570@vindex mh-unseen-seq
571@vindex mh-user-path
572
573In addition to setting variables that point to MH itself, MH-E also
574sets a handful of variables that point to where you keep your mail.
575During initialization, the function @code{mh-find-path} sets
576@code{mh-user-path} from your @samp{Path:} MH profile component (but
577defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
578from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
579@samp{Unseen-Sequence:}, @code{mh-previous-seq} from
580@samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
581(defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
582after these variables have been set. This hook can be used the change
583the value of these variables if you need to run with different values
584between MH and MH-E.
585
586@node Tour Through MH-E, Using This Manual, Getting Started, Top
587@chapter Tour Through MH-E
334 588
335The @samp{~} notation used by @file{~/.emacs} above represents your home 589This chapter introduces some of the terms you'll need to know and then
336directory. This is used by the @code{bash} and @code{csh} shells. If 590takes you on a tour of MH-E@footnote{The keys mentioned in these
337your shell does not support this feature, you could use the environment 591chapters refer to the default key bindings. If you've changed the
338variable @samp{$HOME} (such as @file{$HOME/.emacs}) or the absolute path 592bindings, refer to the command summaries at the beginning of each
339(as in @file{/home/wohler/.emacs}) instead. 593chapter for a mapping between default key bindings and function
594names.}. When you're done, you'll be able to send, read, and file
595mail, which is all that a lot of people ever do. But if you're the
596curious or adventurous type, read the rest of the manual to be able to
597use all the features of MH-E. I suggest you read this chapter first to
598get the big picture, and then you can read the manual as you wish.
340 599
341At this point, you should see something like the screen in the 600@menu
342figure in @ref{Reading Mail Tour}. We're now ready to move on. 601* Sending Mail Tour::
602* Reading Mail Tour::
603* Processing Mail Tour::
604* Leaving MH-E::
605* More About MH-E::
606@end menu
343 607
344@node Sending Mail Tour, Reading Mail Tour, Getting Started, Tour Through mh-e 608@node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
345@section Sending Mail 609@section Sending Mail
346 610
347@cindex sending mail 611@cindex sending mail
348@findex @code{mh-smail} 612@findex mh-smail
349 613
350Let's start our tour by sending ourselves a message which we can later 614Let's start our tour by sending ourselves a message which we can later
351read and process. Enter @kbd{M-x mh-smail} to invoke the mh-e program 615read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
352to send messages. You will be prompted in the minibuffer by @samp{To:}. 616to send messages. You will be prompted in the minibuffer by
353Enter your login name. The next prompt is @samp{cc:}. Hit @key{RET} to 617@samp{To:}. Enter your login name. The next prompt is @samp{Cc:}. Hit
354indicate that no carbon copies are to be sent. At the @samp{Subject:} 618@key{RET} to indicate that no carbon copies are to be sent. At the
355prompt, enter @kbd{Test} or anything else that comes to mind. 619@samp{Subject:} prompt, enter @kbd{Test} or anything else that comes
620to mind.
356 621
357@cindex MH-Letter mode 622@cindex MH-Letter mode
358@cindex modes, MH-Letter 623@cindex modes, MH-Letter
359@cindex mode 624@cindex mode
360 625
361Once you've specified the recipients and subject, your message appears 626Once you've specified the recipients and subject, your message appears
362in an Emacs buffer whose mode @footnote{A @dfn{mode} changes Emacs to 627in an Emacs buffer whose mode@footnote{A @dfn{mode} changes Emacs to
363make it easier to edit a particular type of text.} is MH-Letter. 628make it easier to edit a particular type of text.} is MH-Letter. Enter
364Enter some text in the body of the message, using normal Emacs commands. 629some text in the body of the message, using normal Emacs commands. You
365You should now have something like this: @footnote{If you're running Emacs 630should now have something like this@footnote{If you're running Emacs
366under the X Window System, then you would also see a menubar. I've left 631under the X Window System, then you would also see a menu bar. Under
367out the menubar in all of the example screens.} 632Emacs 21, you would also see a tool bar. I've left out the menu bar and
633tool bar in all of the example screens.}:
368 634
369@example
370@group
371@cartouche 635@cartouche
636@smallexample
372 637
373 638
374 639
375 640
376 641
377 642
378-----Emacs: *scratch* (Lisp Interaction)--All------------------- 643--:-- *scratch* (Lisp Interaction)--L1--All-------------------------
379To: wohler 644To: wohler
380cc: 645cc:
381Subject: Test 646Subject: Test
382-------- 647--------
383 This is a test message to get the wheels churning...# 648This is a test message to get the wheels churning...#
384 649
385 650
386--**-@{draft@} (MH-Letter)--All------------------------------------- 651--:** @{draft@} (MH-Letter)--L5--All-----------------------------------
387 652
653@end smallexample
388@end cartouche 654@end cartouche
389@i{mh-e message composition window} 655@i{MH-E message composition window}
390@end group
391@end example
392
393@cindex MH-Letter mode
394@cindex modes, MH-Letter
395 656
396Note the line of dashes that separates the header and the body of the 657Note the line of dashes that separates the header and the body of the
397message. It is essential that these dashes (or a blank line) are 658message. It is essential that these dashes (or a blank line) are
398present or the body of your message will be considered to be part of 659present or the body of your message will be considered to be part of
399the header. 660the header.
400 661
401There are several commands specific to MH-Letter mode, but at 662@cindex help
402this time we'll only use @kbd{C-c C-c} to send your message. Type 663@kindex C-c C-c
403@kbd{C-c C-c} now. That's all there is to it! 664
665There are several commands specific to MH-Letter mode@footnote{You can
666get quick help for the commands used most often with @kbd{C-c ?} or
667more complete help with the @kbd{C-h m} (@code{describe-mode})
668command.}, but at this time we'll only use @kbd{C-c C-c} to send your
669message. Type @kbd{C-c C-c} now. That's all there is to it!
404 670
405@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through mh-e 671@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
406@section Receiving Mail 672@section Receiving Mail
407 673
408@cindex reading mail 674@cindex @command{inc}
409@findex @code{mh-rmail} 675@cindex @command{scan}
410@cindex @code{inc} 676@cindex MH commands, @command{inc}
411@cindex MH commands, @code{inc} 677@cindex MH commands, @command{scan}
412@cindex @code{scan}
413@cindex MH commands, @code{scan}
414@cindex MH-Folder mode 678@cindex MH-Folder mode
415@cindex modes, MH-Folder 679@cindex modes, MH-Folder
680@cindex reading mail
681@findex mh-rmail
416 682
417To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}. 683To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
418This incorporates the new mail and put the output from @code{inc} 684This incorporates the new mail and puts the output from
419(called @dfn{scan lines} after the MH program @code{scan} which prints a 685@command{inc}@footnote{See the section
420one-line summary of each message) into a buffer called @samp{+inbox} 686@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
421whose major mode is MH-Folder. 687prev} in the MH book.} (called @dfn{scan lines} after the MH program
422 688@command{scan}@footnote{See the section
423@sp 2 689@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
424@need 1000 690pick Ranges Sequences} in the MH book.} which prints a one-line
691summary of each message) into a buffer called @samp{+inbox} whose
692major mode is MH-Folder.
693
694@sp 1
425@center @strong{NOTE} 695@center @strong{NOTE}
426 696
427@quotation 697@quotation
428The @kbd{M-x mh-rmail} command will show you only new mail, not old 698The @kbd{M-x mh-rmail} command will show you only new mail, not mail
429mail. If you were to run this tour again, you would use @kbd{M-r} to 699you have already read. If you were to run this tour again, you would
430pull all your messages into mh-e. 700use @kbd{F r} to pull all your messages into MH-E.
431@end quotation 701@end quotation
702@sp 1
432 703
433You should see the scan line for your message, and perhaps others. Use 704@kindex @key{RET}
705@kindex n
706@kindex p
707
708You should see the scan line for your message, and perhaps others. Use
434@kbd{n} or @kbd{p} to move the cursor to your test message and type 709@kbd{n} or @kbd{p} to move the cursor to your test message and type
435@key{RET} to read your message. You should see something like: 710@key{RET} to read your message. You should see something like:
436 711
437@example
438@group
439@cartouche 712@cartouche
440 3 24Aug root received fax files on Wed Aug 24 11:00:13 PDT 1994 713@smallexample
441# 4+ 24Aug To:wohler Test<<This is a test message to get the wheels chu 714 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
715# 4+t08/24 To:wohler Test<<This is a test message to get the wheels
442 716
443--%%-@{+inbox@} 4 msgs (1-4) (MH-Folder Show)--Bot------------------ 717-:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot--------------
444To: wohler 718To: wohler
445Subject: Test 719Subject: Test
446Date: Wed, 24 Aug 1994 13:01:13 -0700 720Date: Wed, 24 Aug 1994 13:01:13 -0700
447From: Bill Wohler <wohler@@newt.com> 721From: Bill Wohler <wohler@@stop.mail-abuse.org>
448 722
449 This is a test message to get the wheels churning... 723This is a test message to get the wheels churning...
450 724
451 725
452 726
453 727
454 728
455-----@{show-+inbox@} 4 (MH-Show)--Bot------------------------------- 729--:-- @{show-+inbox@} 4 (MH-Show)--L1--All---------------------------
456 730
731@end smallexample
457@end cartouche 732@end cartouche
458@i{After incorporating new messages} 733@i{After incorporating new messages}
459@end group
460@end example
461 734
462If you typed a long message, you can view subsequent pages with @key{SPC} 735@kindex @key{DEL}
463and previous pages with @key{DEL}. 736@kindex @key{SPC}
737
738If you typed a long message, you can view subsequent pages with
739@key{SPC} and previous pages with @key{DEL}.
464 740
465@node Processing Mail Tour, Leaving mh-e, Reading Mail Tour, Tour Through mh-e 741@node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
466@section Processing Mail 742@section Processing Mail
467 743
468@cindex processing mail 744@cindex processing mail
745@kindex r
469 746
470The first thing we want to do is reply to the message that we sent 747The first thing we want to do is reply to the message that we sent
471ourselves. Ensure that the cursor is still on the same line as your 748ourselves. Ensure that the cursor is still on the same line as your
472test message and type @kbd{r}. You are prompted in the minibuffer with 749test message and type @kbd{r}. You are prompted in the minibuffer with
473@samp{Reply to whom:}. Here mh-e is asking whether you'd like to reply 750@samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
474to the original sender only, to the sender and primary recipients, or to 751to the original sender only, to the sender and primary recipients, or
475the sender and all recipients. If you simply hit @key{RET}, you'll 752to the sender and all recipients. If you simply hit @key{RET}, you'll
476reply only to the sender. Hit @key{RET} now. 753reply only to the sender. Hit @key{RET} now.
477 754
478You'll find yourself in an Emacs buffer similar to that when you were 755You'll find yourself in an Emacs buffer similar to that when you were
479sending the original message, like this: 756sending the original message, like this:
480 757
481@example
482@group
483@cartouche 758@cartouche
759@smallexample
484To: wohler 760To: wohler
485Subject: Re: Test 761Subject: Re: Test
486In-reply-to: Bill Wohler's message of Wed, 24 Aug 1994 13:01:13 -0700 762In-reply-to: Bill Wohler's message of Wed, 24 Aug 1994 13:01:13 -0700
487 <199408242001.NAA00505@@newt.com> 763 <199408242001.NAA00505@@stop.mail-abuse.org>
488-------- 764--------
489# 765#
490 766
491--**-@{draft@} (MH-Letter)--All------------------------------------- 767--:-- @{draft@} (MH-Letter)--L11--Bot---------------------------------
492To: wohler 768To: wohler
493Subject: Test 769Subject: Test
494Date: Wed, 24 Aug 1994 13:01:13 -0700 770Date: Wed, 24 Aug 1994 13:01:13 -0700
495From: Bill Wohler <wohler@@newt.com> 771From: Bill Wohler <wohler@@stop.mail-abuse.org>
496 772
497 This is a test message to get the wheels churning... 773This is a test message to get the wheels churning...
498 774
499-----@{show-+inbox@} 4 (MH-Show)--Bot------------------------------- 775--:-- @{show-+inbox@} 4 (MH-Show)--L1--All----------------------------
500Composing a reply...done 776Composing a reply...done
777@end smallexample
501@end cartouche 778@end cartouche
502@i{Composition window during reply} 779@i{Composition window during reply}
503@end group
504@end example
505 780
506By default, MH will not add you to the address list of your replies, so 781@kindex C-c C-c
507if you find that the @samp{To:} header field is missing, don't worry. 782@kindex C-c C-f C-t
508In this case, type @kbd{C-c C-f C-t} to create and go to the @samp{To:} 783
509field, where you can type your login name again. You can move around 784By default, MH will not add you to the address list of your replies,
510with the arrow keys or with @kbd{C-p} (@code{previous-line}), @kbd{C-n} 785so if you find that the @samp{To:} header field is missing, don't
511(@code{next-line}), @kbd{C-b} (@code{backward-char}), and @kbd{C-f} 786worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
512(@code{forward-char}) and can delete the previous character with 787@samp{To:} field, where you can type your login name again. You can
513@key{BS}. When you're finished editing your message, send it with 788move around with the arrow keys or with @kbd{C-p}
514@kbd{C-c C-c} as before. 789(@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
515 790(@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
516@cindex folder 791delete the previous character with @key{BS}. When you're finished
517 792editing your message, send it with @kbd{C-c C-c} as before.
518You'll often want to save messages that were sent to you in an organized 793
519fashion. This is done with @dfn{folders}. You can use folders to keep 794@cindex folders
520messages from your friends, or messages related to a particular topic. 795@kindex o
521With your cursor in the MH-Folder buffer and positioned on the message 796
522you sent to yourself, type @kbd{o} to output (@code{refile} in MH 797You'll often want to save messages that were sent to you in an
523parlance) that message to a folder. Enter @kbd{test} at the 798organized fashion. This is done with @dfn{folders}. You can use
524@samp{Destination:} prompt and type @kbd{y} (or @key{SPC}) when mh-e 799folders to keep messages from your friends, or messages related to a
525asks to create the folder @samp{+test}. Note that a @samp{^} (caret) 800particular topic. With your cursor in the MH-Folder buffer and
526appears next to the message number, which means that the message has 801positioned on the message you sent to yourself, type @kbd{o} to output
527been marked for refiling but has not yet been refiled. We'll talk about 802(@command{refile} in MH parlance) that message to a folder. Enter
528how the refile is actually carried out in a moment. 803@kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
804(or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
805that a @samp{^} (caret) appears next to the message number, which
806means that the message has been marked for refiling but has not yet
807been refiled. We'll talk about how the refile is actually carried out
808in a moment.
529 809
530@cindex MH-Folder mode 810@cindex MH-Folder mode
531@cindex modes, MH-Folder 811@cindex modes, MH-Folder
812@kindex @key{RET}
813@kindex d
814@kindex i
815@kindex x
532 816
533Your previous reply is now waiting in the system mailbox. You 817Your previous reply is now waiting in the system mailbox. You
534incorporate this mail into your MH-Folder buffer named @samp{+inbox} 818incorporate this mail into your MH-Folder buffer named @samp{+inbox}
535with the @kbd{i} command. Do this now. After the mail is incorporated, 819with the @kbd{i} command. Do this now. After the mail is incorporated,
536use @kbd{n} or @kbd{p} to move the cursor to the new message, and read 820use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
537it with @key{RET}. Let's delete this message by typing @kbd{d}. Note 821it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
538that a @samp{D} appears next to the message number. This means that the 822that a @samp{D} appears next to the message number. This means that
539message is marked for deletion but is not yet deleted. To perform the 823the message is marked for deletion but is not yet deleted. To perform
540deletion (and the refile we did previously), use the @kbd{x} command. 824the deletion (and the refile we did previously), use the @kbd{x}
825command.
541 826
542@findex @code{mh-smail} 827@findex mh-smail
828@kindex m
543 829
544If you want to send another message you can use @kbd{m} instead of 830If you want to send another message you can use @kbd{m} instead of
545@kbd{M-x mh-smail}. So go ahead, send some mail to your friends! 831@kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
832
833@cindex help
834@cindex prefix characters
835@findex describe-mode
836@kindex ?
837@kindex C-h m
546 838
547@node Leaving mh-e, More About mh-e, Processing Mail Tour, Tour Through mh-e 839You can get a quick reminder about these commands by typing @kbd{?}.
548@section Leaving mh-e 840This lists several @dfn{prefix characters}. To list the commands
841available via the prefix characters, type the prefix character
842followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
843available with the @kbd{C-h m} (@code{describe-mode}) command.
844
845@node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
846@section Leaving MH-E
549 847
550@cindex Emacs, quitting 848@cindex Emacs, quitting
551@cindex quitting 849@cindex quitting
552 850
553You may now wish to exit @code{emacs} entirely. Use @kbd{C-x C-c} to 851You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
554exit @code{emacs}. If you exited without running @kbd{x} in the 852to exit @command{emacs}. If you exited without running @kbd{x} in the
555@samp{+inbox} buffer, Emacs will offer to save it for you. Type @kbd{y} 853@samp{+inbox} buffer, Emacs will offer to save it for you. Type
556or @key{SPC} to save @samp{+inbox} changes, which means to perform any refiles 854@kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
557and deletes that you did there. 855perform any refiles and deletes that you did there.
558 856
559If you don't want to leave Emacs, you can type @kbd{q} to bury (hide) 857@findex mh-rmail
560the mh-e folder or delete them entirely with @kbd{C-x k}. You can then 858@kindex q
561later recall them with @kbd{C-x b} or @kbd{M-x mh-rmail}.
562 859
563@node More About mh-e, , Leaving mh-e, Tour Through mh-e 860If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
564@section More About mh-e 861the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
862later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
863
864@cindex @command{packf}
865@cindex MH commands, @command{packf}
866@cindex exporting folders
867@cindex folders, exporting
868@cindex mbox-style folder
869
870On the other hand, if you no longer want to use MH and MH-E, you can
871take your mail with you. You can copy all of your mail into a single
872file, mbox-style, by using the MH command @command{packf}. For
873example, to create a file called @file{msgbox} with the messages in
874your @samp{+inbox} folder, use @samp{packf +inbox}. The
875@command{packf} command will append the messages to the file if it
876already exists, so you can use @samp{folders -recurse -fast} in a
877script to copy all of your messages into a single file, or using the
878@samp{-file} argument, a file for each folder.
879
880@node More About MH-E, , Leaving MH-E, Tour Through MH-E
881@section More About MH-E
565 882
566These are the basic commands to get you going, but there are plenty 883These are the basic commands to get you going, but there are plenty
567more. If you think that mh-e is for you, read @ref{Using mh-e} and 884more. If you think that MH-E is for you, read the rest of the manual
568@ref{Customizing mh-e} to find out how you can: 885to find out how you can:
569 886
570@itemize @bullet 887@itemize @bullet
571@item 888@item
572Print your messages. (@ref{Printing} and @ref{Customizing Printing}.) 889Print your messages (@ref{Printing}).
890@c -------------------------
891@item
892Edit messages and include your signature (@ref{Editing Drafts}).
893@c -------------------------
894@item
895Forward messages (@ref{Forwarding}).
896@c -------------------------
897@item
898Read digests (@ref{Digests}).
899@c -------------------------
573@item 900@item
574Edit messages and include your signature. (@ref{Draft Editing} 901Edit bounced messages (@ref{Editing Again}).
575and @ref{Customizing Draft Editing}.) 902@c -------------------------
576@item 903@item
577Forward messages. (@ref{Forwarding} and @ref{Customizing Forwarding}.) 904Send multimedia messages (@ref{Adding Attachments}).
905@c -------------------------
578@item 906@item
579Read digests. (@ref{Viewing}.) 907Read HTML messages (@ref{HTML}).
908@c -------------------------
580@item 909@item
581Edit bounced messages. (@ref{Old Drafts} and @ref{Customizing Old Drafts}.) 910Use @ref{Aliases} and @ref{Identities}.
911@c -------------------------
582@item 912@item
583Send multimedia messages. (@ref{Editing MIME} and @ref{Customizing Editing MIME}.) 913Create different views of your mail (@ref{Threading} and @ref{Limits}).
914@c -------------------------
584@item 915@item
585Process mail that was sent with @code{shar} or @code{uuencode}. 916Deal with junk mail (@ref{Junk}).
586(@ref{Files and Pipes}.) 917@c -------------------------
587@item 918@item
588Use sequences conveniently. (@ref{Sequences}.) 919Handle signed and encrypted messages (@ref{Reading PGP} and
920@ref{Sending PGP}).
921@c -------------------------
589@item 922@item
590Show header fields in different fonts. (@ref{Customizing Viewing}.) 923Process mail that was sent with @command{shar} or @command{uuencode}
924(@ref{Files and Pipes}).
925@c -------------------------
591@item 926@item
592Find previously refiled messages. (@ref{Searching}.) 927Use sequences conveniently (@ref{Sequences}).
928@c -------------------------
593@item 929@item
594Place messages in a file. (@ref{Files and Pipes}.) 930Use the @ref{Speedbar}, @ref{Tool Bar}, and @ref{Menu Bar}.
931@c -------------------------
932@item
933Show header fields in different fonts (@ref{Reading Mail}).
934@c -------------------------
935@item
936Find previously refiled messages (@ref{Searching}).
937@c -------------------------
938@item
939Place messages in a file (@ref{Files and Pipes}).
595@end itemize 940@end itemize
596 941
597Remember that you can also use MH commands when you're not running mh-e 942Remember that you can also use MH commands when you're not running
598(and when you are!). 943MH-E (and when you are!).
599 944
600@node Using mh-e, Customizing mh-e, Tour Through mh-e, Top 945@node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
601@chapter Using mh-e 946@chapter Using This Manual
602 947
603This chapter leaves the tutorial style and goes into more detail about 948This chapter begins the meat of the manual which goes into more detail
604every mh-e command. The default, or "out of the box," behavior is 949about every MH-E command and option.
605documented. If this is not to your liking (for instance, you print with
606something other than @code{lpr)}, see the associated section in
607@ref{Customizing mh-e} which is organized exactly like this chapter.
608 950
609@cindex Emacs, functions; describe-mode 951@cindex Emacs, info
610@cindex Emacs, online help 952@cindex Emacs, online help
953@cindex info
611@cindex online help 954@cindex online help
955@findex describe-mode
956@findex mh-help
957@kindex ?
958@kindex C-c ?
959
960There are many commands, but don't get intimidated. There are command
961summaries at the beginning of each chapter. In case you have or would
962like to rebind the keys, the command summaries also list the
963associated Emacs Lisp function. Furthermore, even if you're stranded
964on a desert island with a laptop and are without your manuals, you can
965get a summary of all these commands with GNU Emacs online help: use
966@kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
967@kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
968help appears in a buffer called @samp{*MH-E Help*}
969(@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
970i} to read this manual via Info. The online help is quite good; try
971running @kbd{C-h C-h}. This brings up a list of available help topics,
972one of which displays the documentation for a given key (like @kbd{C-h
973k C-n}). Another useful help feature is to view the manual section
974that describes a given key (such as @kbd{C-h C-k i}). In addition,
975review @ref{Conventions}, if any of the GNU Emacs conventions are
976strange to you.
977
978In addition to all of the commands, it is also possible to reconfigure
979MH-E to fit the needs of even the most demanding user. The following
980chapters also describe all of the options, show the defaults, and make
981recommendations for customization.
612 982
613There are many commands, but don't get intimidated. There are command 983However, when customizing your mail environment, first try to change
614summaries at the beginning of each section. In case you have or would 984what you want in MH, and only change MH-E if changing MH is not
615like to rebind the keys, the command summaries also list the associated 985possible. That way you will get the same behavior inside and outside
616Emacs Lisp function. Furthermore, even if you're stranded on a desert 986GNU Emacs. Note that MH-E does not provide hooks for customizations
617island with a laptop and are without your manuals, you can get a summary 987that can be done in MH; this omission is intentional.
618of all these commands with GNU Emacs online help: use @kbd{C-h m} 988
619(@code{describe-mode}) for a brief summary of commands or @kbd{C-h i} to 989@cindex Emacs, Emacs Lisp manual
620read this manual via Info. The online help is quite good; try running 990@cindex Emacs, info
621@kbd{C-h C-h C-h}. This brings up a list of available help topics, one 991@cindex Emacs, online help
622of which displays the documentation for a given key (like @kbd{C-h k 992@cindex info
623C-n}). In addition, review @ref{Conventions}, if any of the GNU Emacs 993@cindex online help
624conventions are strange to you. 994
625 995I hope I've included enough examples here to get you well on your way.
626Let's get started! 996If you want to explore Emacs Lisp further, a programming manual does
997exist,
998@c Yes, some of the stuff in the following sections is redundant, but
999@c TeX barfs if the @ifs are inside the @footnote.
1000@iftex
1001@footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1002online in the Info system by typing @kbd{C-h i m Emacs Lisp
1003@key{RET}}. It is also available online at @*
1004@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1005can also order a printed manual, which has the desirable side-effect
1006of helping to support the Free Software Foundation which made all this
1007great software available. You can find an order form by running
1008@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1009gnu.org}.}
1010@end iftex
1011@ifinfo
1012@footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1013Emacs Lisp Reference Manual}, which may be available online in the
1014Info system. It is also available online at
1015@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1016can also order a printed manual, which has the desirable side-effect
1017of helping to support the Free Software Foundation which made all this
1018great software available. You can find an order form by running
1019@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1020gnu.org}.}
1021@end ifinfo
1022@ifhtml
1023@footnote{The
1024@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/,
1025The GNU Emacs Lisp Reference Manual} may also be available online in
1026the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1027also order a printed manual, which has the desirable side-effect of
1028helping to support the Free Software Foundation which made all this
1029great software available. You can find an order form by running
1030@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1031gnu.org}.}
1032@end ifhtml
1033and you can look at the code itself for examples. Look in the Emacs
1034Lisp directory on your system (such as
1035@file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1036files there. When calling MH-E and other Emacs Lisp functions directly
1037from Emacs Lisp code, you'll need to know the correct arguments. Use
1038the online help for this. For example, try @kbd{C-h f
1039mh-execute-commands @key{RET}}. If you write your own functions,
1040please do not prefix your symbols (variables and functions) with
1041@samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1042conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1043your initials.
627 1044
628@menu 1045@menu
629* Reading Mail:: 1046* Options::
630* Sending Mail:: 1047* Ranges::
631* Draft Editing:: 1048* Folder Selection::
632* Moving Mail::
633* Searching::
634* Sequences::
635* Miscellaneous::
636@end menu 1049@end menu
637 1050
638@node Reading Mail, Sending Mail, Using mh-e, Using mh-e 1051@node Options, Ranges, Using This Manual, Using This Manual
639@section Reading Your Mail 1052@section Options
1053
1054@cindex Emacs, customizing
1055@cindex Emacs, setting options
1056@cindex customizing MH-E
1057@cindex setting options
1058@findex customize-option
1059@vindex mh-lpr-command-format, example
1060
1061Many string or integer options are easy to modify using @kbd{M-x
1062customize-option}. For example, to modify the option that controls
1063printing, you would run @kbd{M-x customize-option @key{RET}
1064mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1065the string to the right of the variable. For example, you may change
1066the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1067use the @samp{State} combo box and select @samp{Save for Future
1068Sessions}. @ref{Printing} talks more about this option.
1069
1070@vindex mh-bury-show-buffer-flag, example
1071
1072Options can also hold boolean values. In Emacs Lisp, the boolean
1073values are @code{nil}, which means false, and @code{t}, which means
1074true. The @code{customize-option} function makes it easy to change
1075boolean values; simply click on the toggle button in the customize
1076buffer to switch between @samp{on} (@code{t}) and @samp{off}
1077(@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1078to @samp{off} to keep the MH-Show buffer at the top of the buffer
1079stack. Use the @samp{State} combo box and choose @samp{Set for Current
1080Session} to see how the option affects the show buffer. Then choose
1081the @samp{Erase Customization} menu item to reset the option to the
1082default, which places the MH-Show buffer at the bottom of the buffer
1083stack.
1084
1085The text usually says to turn on an option by setting it to a
1086@emph{non-@code{nil}} value, because sometimes values other than
1087@samp{on} are meaningful (for example, see @code{mh-mhl-format-file},
1088described in @ref{Viewing}). Other options, such as hooks, involve a
1089little more Emacs Lisp programming expertise.
640 1090
641@cindex reading mail 1091@cindex @samp{mh} customization group
642@findex @code{mh-rmail} 1092@cindex customization group, @samp{mh}
643@cindex MH-Folder mode 1093@findex customize-group
644@cindex modes, MH-Folder 1094@findex mh-customize
1095
1096You can browse all of the MH-E options with the @code{customize-group}
1097function. Try entering @kbd{M-x customize-group @key{RET} mh
1098@key{RET}} to view the top-level options as well as buttons for all of
1099the MH-E customization groups. Another way to view the MH-E
1100customization group is to use @kbd{M-x mh-customize @key{RET}}.
1101
1102@node Ranges, Folder Selection, Options, Using This Manual
1103@section Ranges
1104
1105@c Sync with mh-folder-mode docstring.
1106
1107@cindex ranges
1108@cindex message abbreviations
1109@cindex message ranges
1110
1111Many commands that operate on individual messages, such as
1112@code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1113argument. This argument can be used in several ways.
1114
1115If you provide the prefix argument @kbd{C-u} to these commands, then
1116you will be prompted for the message range. This can be any valid MH
1117range which can include messages, sequences (@pxref{Sequences}), and
1118the abbreviations (described in the @command{mh}(1) man page):
1119
1120@table @samp
1121@item <num1>-<num2>
1122Indicates all messages in the range <num1> to <num2>, inclusive. The
1123range must be nonempty.
1124@c -------------------------
1125@item <num>:N
1126@item <num>:+N
1127@itemx <num>:-N
1128Up to N messages beginning with (or ending with) message num. Num may
1129be any of the predefined symbols: first, prev, cur, next or last.
1130@c -------------------------
1131@item first:N
1132@itemx prev:N
1133@itemx next:N
1134@itemx last:N
1135The first, previous, next or last messages, if they exist.
1136@c -------------------------
1137@item all
1138All of the messages.
1139@end table
645 1140
646The mh-e entry point for reading mail is @kbd{M-x mh-rmail}. This 1141For example, a range that shows all of these things is @samp{1 2 3
647command incorporates your mail and creates a buffer called @samp{+inbox} 11425-10 last:5 unseen}.
648in MH-Folder mode. The @kbd{M-x mh-rmail} command shows you only new
649mail, not old mail. @footnote{If you want to see your old mail as well,
650use @kbd{M-r} to pull all your messages into mh-e. Or, give a prefix
651argument to @code{mh-rmail} so it will prompt you for folder to visit
652like @kbd{M-f} (for example, @kbd{C-u M-x mh-rmail @key{RET} bob
653@key{RET}}). Both @kbd{M-r} and @kbd{M-f} are described in
654@ref{Organizing}.} The @samp{+inbox} buffer contains @dfn{scan lines},
655which are one-line summaries of each incorporated message. You can
656perform most MH commands on these messages via one-letter commands
657discussed in this chapter. See @code{scan}(1) for a description of the
658contents of the scan lines, and see the Figure in @ref{Reading Mail
659Tour}, for an example.
660 1143
661@table @kbd 1144@vindex transient-mark-mode
662@item RET
663Display a message (@code{mh-show}).
664 1145
665@item SPC 1146If the option @code{transient-mark-mode} is set to @code{t} and you
666Go to next page in message (@code{mh-page-msg}). 1147set a region in the MH-Folder buffer, then the MH-E command will
1148perform the operation on all messages in that region.
667 1149
668@item BS 1150@cindex @samp{mh-range} customization group
669Go to previous page in message (@code{mh-previous-page}). 1151@cindex customization group, @samp{mh-range}
670 1152
671@item , (comma) 1153The @samp{mh-range} customization group contains a single option which
672Display a message with all header fields (@code{mh-header-display}). 1154affects how ranges are interpreted.
673 1155
674@item M-SPC 1156@vtable @code
675Go to next message in digest (@code{mh-page-digest}). 1157@item mh-interpret-number-as-range-flag
1158On means interpret a number as a range (default: @samp{on}).
1159@end vtable
676 1160
677@item M-BS 1161Since one of the most frequent ranges used is @samp{last:N}, MH-E will
678Go to previous message in digest (@code{mh-page-digest-backwards}). 1162interpret input such as @samp{200} as @samp{last:200} if the
1163@code{mh-interpret-number-as-range-flag} option is on (which is the
1164default). If you need to scan just the message 200, then use the range
1165@samp{200:1} or @samp{200-200}.
679 1166
680@item M-b 1167@node Folder Selection, , Ranges, Using This Manual
681Break up digest into separate messages (@code{mh-burst-digest}). 1168@section Folder Selection
682 1169
683@item n 1170@cindex folders, selecting
684Display next message (@code{mh-next-undeleted-msg}).
685 1171
686@item p 1172When you choose a folder in MH-E via a command such as @kbd{o}
687Display previous message (@code{mh-previous-undeleted-msg}). 1173(@code{mh-refile-msg}), completion is used to enter the folder
1174@ifnothtml
1175(@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1176@end ifnothtml
1177@ifhtml
1178(see the section
1179@uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
1180Completion} in @cite{The GNU Emacs Manual}).
1181@end ifhtml
1182In addition, MH-E has several ways of choosing a suitable default so
1183that the folder can often be selected with a single @key{RET} key.
688 1184
689@item g 1185@cindex @samp{mh-folder-selection} customization group
690Go to a message (@code{mh-goto-msg}). 1186@cindex customization group, @samp{mh-folder-selection}
691 1187
692@item M-< 1188The @samp{mh-folder-selection} customization group contains some
693Go to first message (@code{mh-first-msg}). 1189options which are used to help with this.
694 1190
695@item M-> 1191@vtable @code
696Go to last message (@code{mh-last-msg}). 1192@item mh-default-folder-for-message-function
1193Function to select a default folder for refiling or @samp{Fcc:}
1194(default: @code{nil}).
1195@c -------------------------
1196@item mh-default-folder-list
1197List of addresses and folders (default: @code{nil}).
1198@c -------------------------
1199@item mh-default-folder-must-exist-flag
1200On means guessed folder name must exist to be used (default:
1201@samp{on}).
1202@c -------------------------
1203@item mh-default-folder-prefix
1204Prefix used for folder names generated from aliases (default: @code{""}).
1205@end vtable
1206
1207You can set the option @code{mh-default-folder-for-message-function}
1208to a function that provides a default folder for the message to be
1209refiled. When this function is called, the current buffer contains the
1210message being refiled and point is at the start of the message. This
1211function should return the default folder as a string with a leading
1212@samp{+} sign. It can also return @code{nil} so that the last folder
1213name is used as the default, or an empty string to suppress the
1214default entirely.
1215
1216Otherwise, the name of the destination folder is derived from the
1217sender as follows:
1218
1219@enumerate
1220@item
1221The folder name associated with the first address found in the list
1222@code{mh-default-folder-list} is used. Each element in this list
1223contains a @samp{Check Recipient} item. If this item is turned on,
1224then the address is checked against the recipient instead of the
1225sender. This is useful for mailing lists.
1226@c -------------------------
1227@item
1228An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1229the address is used. The prefix is used to prevent clutter in your
1230mail directory. @xref{Aliases}.
1231@end enumerate
697 1232
698@item t 1233If the derived folder does not exist, and
699Toggle between MH-Folder and MH-Folder Show modes (@code{mh-toggle-showing}). 1234@code{mh-default-folder-must-exist-flag} is @code{t}, then the last
700@end table 1235folder name used is suggested. This is useful if you get mail from
1236various people for whom you have an alias, but file them all in the
1237same project folder.
701 1238
702@menu 1239@node Incorporating Mail, Reading Mail, Using This Manual, Top
703* Viewing:: 1240@chapter Incorporating Your Mail
704* Moving Around::
705@end menu
706 1241
707@node Viewing, Moving Around, Reading Mail, Reading Mail 1242@cindex incorporating
708@subsection Viewing Your Mail
709
710@findex @code{mh-show}
711@findex @code{mh-page-msg}
712@findex @code{mh-previous-page}
713@findex @code{mh-header-display}
714
715The @kbd{RET} (@code{mh-show}) command displays the message that the
716cursor is on. If the message is already displayed, it scrolls to the
717beginning of the message. Use @key{SPC} (@code{mh-page-msg}) and
718@key{BS} (@code{mh-previous-page}) to move forwards and backwards one
719page at a time through the message. You can give either of these
720commands a prefix argument that specifies the number of lines to scroll
721(such as @kbd{10 SPC}). mh-e normally hides a lot of the
722superfluous header fields that mailers add to a message, but if you wish
723to see all of them, use the @kbd{,} (comma; @code{mh-header-display})
724command.
725 1243
726@menu 1244This chapter talks about getting mail from your system mailbox into
727* Reading Digests:: 1245your MH @samp{+inbox} folder. The following command accomplishes that
728* Reading MIME:: 1246and is found in the @samp{Folder} menu.
729@end menu
730 1247
731@node Reading Digests, Reading MIME, Viewing, Viewing 1248@table @kbd
732@subsubsection Reading Digests 1249@cindex @samp{Folder > Incorporate New Mail} menu item
1250@cindex menu item, @samp{Folder > Incorporate New Mail}
1251@findex mh-inc-folder
1252@kindex i
1253@item i
1254Incorporate new mail into a folder (@code{mh-inc-folder}).
1255@end table
733 1256
734@cindex digests 1257@cindex @samp{mh-inc} customization group
735@findex @code{mh-page-digest} 1258@cindex customization group, @samp{mh-inc}
736@findex @code{mh-page-digest-backwards}
737
738A digest is a message that contains other messages. Special mh-e
739commands let you read digests conveniently. You can use @key{SPC} and
740@key{BS} to page through the digest as if it were a normal message, but
741if you wish to skip to the next message in the digest, use @kbd{M-SPC}
742(@code{mh-page-digest}). To return to a previous message, use
743@kbd{M-BS} (@code{mh-page-digest-backwards}).
744
745@cindex @code{burst}
746@cindex MH commands, @code{burst}
747@cindex MH-Folder Show mode
748@cindex modes, MH-Folder Show
749@findex @code{mh-burst-digest}
750
751@c There was a page break at the colon in the following paragraph which
752@c broke the transition to the example.
753@need 2000
754
755Another handy command is @kbd{M-b} (@code{mh-burst-digest}). This
756command uses the MH command @code{burst} to break out each message in
757the digest into its own message. Using this command, you can quickly
758delete unwanted messages, like this: Once the digest is split up, toggle
759out of MH-Folder Show mode with @kbd{t} (@pxref{Moving Around}) so that
760the scan lines fill the screen and messages aren't displayed. Then use
761@kbd{d} (@pxref{Deleting}) to quickly delete messages that you don't
762want to read (based on the @samp{Subject:} header field). You can also
763burst the digest to reply directly to the people who posted the messages
764in the digest. One problem you may encounter is that the @samp{From:}
765header fields are preceded with a @samp{>} so that your reply can't
766create the @samp{To:} field correctly. In this case, you must correct
767the @samp{To:} field yourself. This is described later in @ref{Editing
768Textual}.
769
770@node Reading MIME, , Reading Digests, Viewing
771@subsubsection Reading Multimedia Mail
772 1259
773@cindex multimedia mail 1260The following options in the @samp{mh-inc} customization group are
774@cindex MIME 1261used.
775@cindex @code{show}
776@cindex MH commands, @code{show}
777@cindex @code{mhshow}
778@cindex MH commands, @code{mhshow}
779
780MH has the ability to read @dfn{@sc{mime}} (Multipurpose Internet Mail
781Extensions) messages. Unfortunately, mh-e does not yet have this
782ability, so you have to use the MH commands @code{show} or @code{mhshow}
783from the shell to read @sc{mime} messages. @footnote{You can call them
784directly from Emacs if you're running the X Window System: type @kbd{M-!
785xterm -e mhshow @var{message-number}}. You can leave out the @code{xterm
786-e} if you use @code{mhlist} or @code{mhstore}.}
787
788@node Moving Around, , Viewing, Reading Mail
789@subsection Moving Around
790 1262
791@cindex moving between messages 1263@vtable @code
792@findex @code{mh-next-undeleted-msg} 1264@item mh-inc-prog
793@findex @code{mh-previous-undeleted-msg} 1265Program to incorporate mail (default: @samp{"inc"}).
794@findex @code{mh-goto-msg} 1266@c -------------------------
795@findex @code{mh-last-msg} 1267@item mh-inc-spool-list
796@findex @code{mh-first-msg} 1268Alternate spool files (default: @code{nil}).
797 1269@end vtable
798To move on to the next message, use the @kbd{n}
799(@code{mh-next-undeleted-msg}) command; use the @kbd{p}
800(@code{mh-previous-undeleted-msg}) command to read the previous message.
801Both of these commands can be given a prefix argument to specify how
802many messages to skip (for example, @kbd{5 n}). You can also move to a
803specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
804message number either before or after typing @kbd{g}. In the latter
805case, Emacs prompts you. Finally, you can go to the first or last
806message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
807(@code{mh-last-msg}) respectively.
808 1270
809@cindex MH-Folder mode 1271The following hook is available.
810@cindex modes, MH-Folder
811 1272
812You can also use the Emacs commands @kbd{C-p} (@code{previous-line}) and 1273@vtable @code
813@kbd{C-n} (@code{next-line}) to move up and down the scan lines in the 1274@item mh-inc-folder-hook
814MH-Folder window. These commands can be used in conjunction with 1275Hook run by @samp{mh-inc-folder} after incorporating mail into a
815@kbd{RET} to look at deleted or refiled messages. 1276folder (default: @code{nil}).
1277@end vtable
1278
1279If at any time you receive new mail, incorporate the new mail into
1280your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1281that @kbd{i} will display the @samp{+inbox} buffer, even if there
1282isn't any new mail. You can incorporate mail from any file into the
1283current folder by specifying a prefix argument; you'll be prompted for
1284the name of the file to use as well as the destination folder (for
1285example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
816 1286
817@cindex MH-Folder mode 1287@cindex @file{.emacs}
818@cindex modes, MH-Folder 1288@cindex Emacs, notification of new mail
819@cindex MH-Folder Show mode 1289@cindex files, @file{.emacs}
820@cindex modes, MH-Folder Show 1290@cindex new mail
821@cindex junk mail 1291@cindex notification of new mail
822@findex @code{mh-toggle-showing}
823 1292
824The command @kbd{t} (@code{mh-toggle-showing}) switches between 1293Emacs can notify you when you have new mail by displaying @samp{Mail}
825MH-Folder mode and MH-Folder Show mode. @footnote{For you Emacs 1294in the mode line. To enable this behavior, and to have a clock in the
826wizards, this is implemented as an Emacs minor mode.} MH-Folder mode 1295mode line besides, add the following to @file{~/.emacs}:
827turns off the associated show buffer so that you can perform operations
828on the messages quickly without reading them. This is an excellent way
829to prune out your junk mail or to refile a group of messages to another
830folder for later examination.
831 1296
832@node Sending Mail, Draft Editing, Reading Mail, Using mh-e 1297@findex display-time
833@section Sending Mail
834 1298
835@cindex sending mail 1299@lisp
836@findex @code{mh-smail} 1300(display-time)
1301@end lisp
837 1302
838You can send a mail message in several ways. You can call @kbd{M-x 1303@cindex @command{inc}
839mh-smail} directly, or from the command line like this: 1304@cindex MH commands, @command{inc}
1305@cindex incorporating
1306@vindex mh-progs
840 1307
841@cindex starting from command line 1308The name of the program that incorporates new mail is stored in
1309@code{mh-inc-prog}; it is @samp{"inc"} by default. This program
1310generates a one-line summary for each of the new messages. Unless it
1311is an absolute pathname, the file is assumed to be in the
1312@code{mh-progs} directory (@pxref{Getting Started}). You may also link
1313a file to @command{inc} that uses a different format (see
1314@samp{mh-profile}(5), and sections
1315@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
1316prev} and @uref{@value{MH-BOOK-HOME}/mhstr.htm, MH Format Strings} in
1317the MH book). You'll then need to modify several variables
1318appropriately (@pxref{Scan Line Formats}).
1319
1320You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1321retrieve mail from arbitrary spool files other than your system
1322mailbox, file it in folders other than your @samp{+inbox}, and assign
1323key bindings to incorporate this mail.
1324
1325@cindex @command{procmail}
1326@cindex @file{.procmailrc}
1327@cindex Unix commands, @command{procmail}
1328@cindex files, @file{.procmailrc}
1329
1330Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1331use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1332with the following recipe in @file{.procmailrc}:
842 1333
843@example 1334@smallexample
844% @kbd{emacs -f mh-smail} 1335MAILDIR=$HOME/mail
845@end example 1336:0:
1337* ^From mh-e-devel-admin@@stop.mail-abuse.org
1338mh-e
1339@end smallexample
846 1340
847From within mh-e's MH-Folder mode, other methods of sending mail 1341In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
848are available as well: 1342@kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1343and click on the @samp{INS} button. Enter a @samp{Spool File} of
1344@samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1345Binding} of @samp{m}.
849 1346
850@table @kbd 1347@cindex @command{emacsclient}
851@item m 1348@cindex @command{gnuclient}
852Compose a message (@code{mh-send}). 1349@cindex @command{xbuffy}
1350@cindex @samp{gnuserv}
1351@cindex Unix commands, @command{emacsclient}
1352@cindex Unix commands, @command{gnuclient}
1353@cindex Unix commands, @command{xbuffy}
853 1354
854@item r 1355You can use @command{xbuffy} to automate the incorporation of this
855Reply to a message (@code{mh-reply}). 1356mail using the Emacs 22 command @command{emacsclient} as follows:
856 1357
857@item f 1358@smallexample
858Forward message(s) (@code{mh-forward}). 1359box ~/mail/mh-e
1360 title mh-e
1361 origMode
1362 polltime 10
1363 headertime 0
1364 command emacsclient --eval '(mh-inc-spool-mh-e)'
1365@end smallexample
859 1366
860@item M-d 1367In XEmacs, the command @command{gnuclient} is used in a similar
861Redistribute a message (@code{mh-redistribute}). 1368fashion.
862 1369
863@item M-e 1370You can set the hook @code{mh-inc-folder-hook}, which is called after
864Edit a message that was bounced by mailer (@code{mh-extract-rejected-mail}). 1371new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1372command. A good use of this hook is to rescan the whole folder either
1373after running @kbd{M-x mh-rmail} the first time or when you've changed
1374the message numbers from outside of MH-E.
865 1375
866@item M-a 1376@findex mh-execute-commands
867Edit a message to send it again (@code{mh-edit-again}). 1377@findex mh-rescan-folder, example
868@end table 1378@findex mh-show, example
1379@vindex mh-inc-folder-hook, example
869 1380
870@cindex MH-Folder mode 1381@smalllisp
871@cindex modes, MH-Folder 1382@group
872@cindex MH-Letter mode 1383(defun my-mh-inc-folder-hook ()
873@cindex modes, MH-Letter 1384 "Hook to rescan folder after incorporating mail."
874@findex @code{mh-send} 1385 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1386 (mh-execute-commands)) ; @r{carry them out}
1387 (mh-rescan-folder) ; @r{synchronize with +inbox}
1388 (mh-show)) ; @r{show the current message}
875 1389
876From within a MH-Folder buffer, you can simply use the command @kbd{m} 1390(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
877(@code{mh-send}). However you invoke @code{mh-send}, you are prompted
878for the @samp{To:}, @samp{cc:}, and @samp{Subject:} header fields. Once
879you've specified the recipients and subject, your message appears in an
880Emacs buffer whose mode is MH-Letter (see the Figure in @ref{Sending
881Mail} to see what the buffer looks like). MH-Letter mode allows you to
882edit your message, to check the validity of the recipients, to insert
883other messages into your message, and to send the message. We'll go
884more into depth about editing a @dfn{draft} @footnote{I highly recommend
885that you use a @dfn{draft folder} so that you can edit several drafts in
886parallel. To do so, create a folder (e.g., @file{+drafts}), and add a
887profile component called @samp{Draft-Folder:} which contains
888@file{+drafts} (see @code{mh-profile}(5)).} (a message you're composing)
889in just a moment.
890
891@findex @code{mh-smail}
892@findex @code{mh-smail-other-window}
893
894@code{mh-smail} always creates a two-window layout with the current
895buffer on top and the draft on the bottom. If you would rather preserve
896the window layout, use @kbd{M-x mh-smail-other-window}.
897 1391
898@menu 1392@i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
899* Replying::
900* Forwarding::
901* Redistributing::
902* Old Drafts::
903@end menu
904 1393
905@node Replying, Forwarding, Sending Mail, Sending Mail 1394@end group
906@subsection Replying to Mail 1395@end smalllisp
907 1396
908@cindex replying 1397@node Reading Mail, Folders, Incorporating Mail, Top
909@cindex @code{mhl} 1398@chapter Reading Your Mail
910@cindex MH commands, @code{mhl}
911@cindex @file{mhl.reply}
912@cindex files, @file{mhl.reply}
913@findex @code{mh-reply}
914 1399
915To compose a reply to a message, use the @kbd{r} (@code{mh-reply}) 1400@cindex MH-Folder mode
916command. If you supply a prefix argument (as in @kbd{C-u r}), the 1401@cindex MH-Show mode
917message you are replying to is inserted in your reply after having first 1402@cindex modes, MH-Folder
918been run through @code{mhl} with the format file @file{mhl.reply}. See 1403@cindex modes, MH-Show
919@code{mhl}(1) to see how you can modify the default @file{mhl.reply} 1404@cindex reading mail
920file. 1405@cindex scan lines
1406@findex mh-rmail
1407
1408The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1409command incorporates your mail and creates a buffer called
1410@samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1411you only new mail, not mail you have already read@footnote{If you want
1412to see your old mail as well, use @kbd{F r} to pull all your messages
1413into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
1414prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1415M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1416
1417The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1418summaries of each incorporated message. You can perform most MH
1419commands on these messages via one- or two-letter commands in either
1420the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1421See @command{scan}(1) for a description of the contents of the scan
1422lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
921 1423
922When you reply to a message, you are first prompted with @samp{Reply to 1424@table @kbd
923whom?}. You have several choices here. 1425@kindex ?
1426@findex mh-help
1427@item ?
1428Display cheat sheet for the MH-E commands (@code{mh-help}).
1429@c -------------------------
1430@cindex @samp{Message > Show Message} menu item
1431@cindex menu item, @samp{Message > Show Message}
1432@kindex @key{RET}
1433@findex mh-show
1434@item @key{RET}
1435Display message (@code{mh-show}).
1436@c -------------------------
1437@cindex @samp{Message > Show Message with Header} menu item
1438@cindex menu item, @samp{Message > Show Message with Header}
1439@kindex , (comma)
1440@findex mh-header-display
1441@item , (comma)
1442Display message with all header fields (@code{mh-header-display}).
1443@c -------------------------
1444@kindex ; (semicolon)
1445@findex mh-toggle-mh-decode-mime-flag
1446@item ; (semicolon)
1447Toggle the value of @code{mh-decode-mime-flag}
1448(@code{mh-toggle-mh-decode-mime-flag}).
1449@c -------------------------
1450@kindex @key{SPC}
1451@findex mh-page-msg
1452@item @key{SPC}
1453Display next page in message (@code{mh-page-msg}).
1454@c -------------------------
1455@kindex @key{BS}
1456@findex mh-previous-page
1457@item @key{BS}
1458Display previous page in message (@code{mh-previous-page}).
1459@c -------------------------
1460@cindex @samp{Message > Write Message to File...} menu item
1461@cindex menu item, @samp{Message > Write Message to File...}
1462@kindex >
1463@findex mh-write-msg-to-file
1464@item >
1465Append message to end of file (@code{mh-write-msg-to-file}).
1466@c -------------------------
1467@cindex @samp{Message > Pipe Message to Command...} menu item
1468@cindex menu item, @samp{Message > Pipe Message to Command...}
1469@kindex |
1470@findex mh-pipe-msg
1471@item |
1472Pipe message through shell command (@code{mh-pipe-msg}).
1473@c -------------------------
1474@kindex C-d
1475@findex mh-delete-msg-no-motion
1476@item C-d
1477Delete range, don't move to next message
1478(@code{mh-delete-msg-no-motion}).
1479@c -------------------------
1480@cindex @samp{Message > Delete Message} menu item
1481@cindex menu item, @samp{Message > Delete Message}
1482@kindex d
1483@findex mh-delete-msg
1484@item d
1485Delete range (@code{mh-delete-msg}).
1486@c -------------------------
1487@kindex D ?
1488@findex mh-prefix-help
1489@item D ?
1490Display cheat sheet for the commands of the current prefix in
1491minibuffer (@code{mh-prefix-help}).
1492@c -------------------------
1493@kindex D @key{SPC}
1494@findex mh-page-digest
1495@item D @key{SPC}
1496Display next message in digest (@code{mh-page-digest}).
1497@c -------------------------
1498@kindex D @key{BS}
1499@findex mh-page-digest-backwards
1500@item D @key{BS}
1501Display previous message in digest (@code{mh-page-digest-backwards}).
1502@c -------------------------
1503@cindex @samp{Message > Burst Digest Message} menu item
1504@cindex menu item, @samp{Message > Burst Digest Message}
1505@kindex D b
1506@findex mh-burst-digest
1507@item D b
1508Break up digest into separate messages (@code{mh-burst-digest}).
1509@c -------------------------
1510@cindex @samp{Message > Go to Message by Number...} menu item
1511@cindex menu item, @samp{Message > Go to Message by Number...}
1512@kindex g
1513@findex mh-goto-msg
1514@item g
1515Go to a message (@code{mh-goto-msg}).
1516@c -------------------------
1517@kindex k
1518@findex mh-delete-subject-or-thread
1519@item k
1520Delete messages with same subject or thread
1521(@code{mh-delete-subject-or-thread}).
1522@c -------------------------
1523@kindex K ?
1524@findex mh-prefix-help
1525@item K ?
1526Display cheat sheet for the commands of the current prefix in
1527minibuffer (@code{mh-prefix-help}).
1528@c -------------------------
1529@kindex K @key{TAB}
1530@findex mh-next-button
1531@item K @key{TAB}
1532Go to the next button (@code{mh-next-button}).
1533@c -------------------------
1534@kindex K S-@key{TAB}
1535@findex mh-prev-button
1536@item K S-@key{TAB}
1537Go to the previous button (@code{mh-prev-button}).
1538@c -------------------------
1539@kindex K a
1540@findex mh-mime-save-parts
1541@item K a
1542Save attachments (@code{mh-mime-save-parts}).
1543@c -------------------------
1544@kindex K e
1545@findex mh-display-with-external-viewer
1546@item K e
1547View attachment externally (@code{mh-display-with-external-viewer}).
1548@c -------------------------
1549@kindex K i
1550@findex mh-folder-inline-mime-part
1551@item K i
1552Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1553@c -------------------------
1554@kindex K o
1555@findex mh-folder-save-mime-part
1556@item K o
1557Save (output) attachment (@code{mh-folder-save-mime-part}).
1558@c -------------------------
1559@kindex K t
1560@findex mh-toggle-mime-buttons
1561@item K t
1562Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1563(@code{mh-toggle-mime-buttons}).
1564@c -------------------------
1565@kindex K v
1566@findex mh-folder-toggle-mime-part
1567@item K v
1568View attachment (@code{mh-folder-toggle-mime-part}).
1569@c -------------------------
1570@cindex @samp{Message > Modify Message} menu item
1571@cindex menu item, @samp{Message > Modify Message}
1572@kindex M
1573@findex mh-modify
1574@item M
1575Edit message (@code{mh-modify}).
1576@c -------------------------
1577@cindex @samp{Message > Go to First Message} menu item
1578@cindex menu item, @samp{Message > Go to First Message}
1579@kindex M-<
1580@findex mh-first-msg
1581@item M-<
1582Display first message (@code{mh-first-msg}).
1583@c -------------------------
1584@cindex @samp{Message > Go to Last Message} menu item
1585@cindex menu item, @samp{Message > Go to Last Message}
1586@kindex M->
1587@findex mh-last-msg
1588@item M->
1589Display last message (@code{mh-last-msg}).
1590@c -------------------------
1591@kindex M-n
1592@findex mh-next-unread-msg
1593@item M-n
1594Display next unread message (@code{mh-next-unread-msg}).
1595@c -------------------------
1596@kindex M-p
1597@findex mh-previous-unread-msg
1598@item M-p
1599Display previous unread message (@code{mh-previous-unread-msg}).
1600@c -------------------------
1601@cindex @samp{Message > Next Message} menu item
1602@cindex menu item, @samp{Message > Next Message}
1603@kindex n
1604@findex mh-next-undeleted-msg
1605@item n
1606Display next message (@code{mh-next-undeleted-msg}).
1607@c -------------------------
1608@cindex @samp{Message > Previous Message} menu item
1609@cindex menu item, @samp{Message > Previous Message}
1610@kindex p
1611@findex mh-previous-undeleted-msg
1612@item p
1613Display previous message (@code{mh-previous-undeleted-msg}).
1614@c -------------------------
1615@kindex P ?
1616@findex mh-prefix-help
1617@item P ?
1618Display cheat sheet for the commands of the current prefix in
1619minibuffer (@code{mh-prefix-help}).
1620@c -------------------------
1621@kindex P C
1622@findex mh-ps-print-toggle-color
1623@item P C
1624Toggle whether color is used in printing messages
1625(@code{mh-ps-print-toggle-color}).
1626@c -------------------------
1627@kindex P F
1628@findex mh-ps-print-toggle-faces
1629@item P F
1630Toggle whether printing is done with faces or not
1631(@code{mh-ps-print-toggle-faces}).
1632@c -------------------------
1633@kindex P f
1634@findex mh-ps-print-msg-file
1635@item P f
1636Print range to file (@code{mh-ps-print-msg-file}).
1637@c -------------------------
1638@cindex @samp{Message > Print Message} menu item
1639@cindex menu item, @samp{Message > Print Message}
1640@kindex P l
1641@findex mh-print-msg
1642@item P l
1643Print range the old fashioned way
1644(@code{mh-print-msg}).
1645@c -------------------------
1646@kindex P p
1647@findex mh-ps-print-msg
1648@item P p
1649Print range (@code{mh-ps-print-msg}).
1650@c -------------------------
1651@kindex X ?
1652@findex mh-prefix-help
1653@item X ?
1654Display cheat sheet for the commands of the current prefix in
1655minibuffer (@code{mh-prefix-help}).
1656@c -------------------------
1657@cindex @samp{Message > Unpack Uuencoded Message...} menu item
1658@cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1659@kindex X s
1660@kindex X u
1661@findex mh-store-msg
1662@item X s
1663@itemx X u
1664Unpack message created with @command{uudecode} or @command{shar}
1665(@code{mh-store-msg}).
1666@c -------------------------
1667@kindex Mouse-2
1668@findex mh-show-mouse
1669@item Mouse-2
1670Move point to mouse event and show message (@code{mh-show-mouse}).
1671@end table
924 1672
925@example 1673Within the MH-Show buffer, the following command is defined.
926@group
927@b{Response} @b{Reply Goes To}
928 1674
929@kbd{from} @r{The person who sent the message. This is the default,} 1675@table @kbd
930 @r{so @key{RET} is sufficient.} 1676@kindex @key{RET}
1677@kindex Mouse-1
1678@kindex Mouse-2
1679@findex mh-press-button
1680@item @key{RET}
1681@itemx Mouse-1
1682@itemx Mouse-2
1683View contents of button (@code{mh-press-button}).
1684@end table
931 1685
932@kbd{to} @r{Replies to the sender, plus all recipients in the} 1686@cindex @samp{mh-show} customization group
933 @r{@samp{To:} header field.} 1687@cindex customization group, @samp{mh-show}
1688
1689The following table lists options in the @samp{mh-show} customization
1690group that are used while reading mail.
1691
1692@vtable @code
1693@item mh-bury-show-buffer-flag
1694On means show buffer is buried (default: @samp{on}).
1695@c -------------------------
1696@item mh-clean-message-header-flag
1697On means remove extraneous header fields (default: @samp{on}).
1698@c -------------------------
1699@item mh-decode-mime-flag
1700On means attachments are handled (default: @samp{on} if the Gnus
1701@samp{mm-decode} package is present).
1702@c -------------------------
1703@item mh-display-buttons-for-alternatives-flag
1704On means display buttons for all alternative attachments (default:
1705@samp{off}).
1706@c -------------------------
1707@item mh-display-buttons-for-inline-parts-flag
1708On means display buttons for all inline attachments (default:
1709@samp{off}).
1710@c -------------------------
1711@item mh-do-not-confirm-flag
1712On means non-reversible commands do not prompt for confirmation
1713(default: @samp{off}).
1714@c -------------------------
1715@item mh-fetch-x-image-url
1716Control fetching of @samp{X-Image-URL:} header field image (default:
1717@code{Never Fetch}).
1718@c -------------------------
1719@item mh-graphical-smileys-flag
1720On means graphical smileys are displayed (default: @samp{on}).
1721@c -------------------------
1722@item mh-graphical-emphasis-flag
1723On means graphical emphasis is displayed (default: @samp{on}).
1724@c -------------------------
1725@item mh-highlight-citation-style
1726Style for highlighting citations (default: @samp{Multicolor}).
1727@c -------------------------
1728@item mh-invisible-header-fields-default
1729List of hidden header fields (default: a checklist too long to list
1730here).
1731@c -------------------------
1732@item mh-invisible-header-fields
1733Additional header fields to hide (default: @code{nil}).
1734@c -------------------------
1735@item mh-lpr-command-format
1736Command used to print (default: @samp{"lpr -J '%s'"}).
1737@c -------------------------
1738@item mh-max-inline-image-height
1739Maximum inline image height if \"Content-Disposition:\" is not
1740present (default: 0).
1741@c -------------------------
1742@item mh-max-inline-image-width
1743Maximum inline image width if \"Content-Disposition:\" is not
1744present(default: 0).
1745@c -------------------------
1746@item mh-mhl-format-file
1747Specifies the format file to pass to the @command{mhl} program
1748(default: @samp{Use Default mhl Format (Printing Only)}).
1749@c -------------------------
1750@item mh-mime-save-parts-default-directory
1751Default directory to use for @kbd{K a}.
1752@c -------------------------
1753@item mh-print-background-flag
1754On means messages should be printed in the background (default:
1755@samp{off}).
1756@c -------------------------
1757@item mh-show-maximum-size
1758Maximum size of message (in bytes) to display automatically (default:
17590).
1760@c -------------------------
1761@item mh-show-use-xface-flag
1762On means display face images in MH-Show buffers (default: @code{on}).
1763@c -------------------------
1764@item mh-store-default-directory
1765Default directory for @kbd{X s} (default: @samp{Current}).
1766@c -------------------------
1767@item mh-summary-height
1768Number of lines in MH-Folder buffer (including the mode line)
1769(default: depends on size of frame).
1770@end vtable
934 1771
935@kbd{all} 1772The following hooks are available.
936@kbd{cc} @r{Forms a reply to the sender, plus all recipients.}
937@end group
938@end example
939 1773
940@cindex @code{repl} 1774@vtable @code
941@cindex MH commands, @code{repl} 1775@item mh-delete-msg-hook
1776Hook run after marking each message for deletion (default: @code{nil}).
1777@c -------------------------
1778@item mh-show-hook
1779Hook run after @key{RET} shows a message (default: @code{nil}).
1780@c -------------------------
1781@item mh-show-mode-hook
1782Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1783@end vtable
1784
1785The following faces are available.
1786
1787@vtable @code
1788@item mh-show-cc
1789Face used to highlight @samp{cc:} header fields.
1790@c -------------------------
1791@item mh-show-date
1792Face used to highlight @samp{Date:} header fields.
1793@c -------------------------
1794@item mh-show-from
1795Face used to highlight @samp{From:} header fields.
1796@c -------------------------
1797@item mh-show-header
1798Face used to deemphasize less interesting header fields.
1799@c -------------------------
1800@item mh-show-pgg-bad
1801Bad PGG signature face.
1802@c -------------------------
1803@item mh-show-pgg-good
1804Good PGG signature face.
1805@c -------------------------
1806@item mh-show-pgg-unknown
1807Unknown or untrusted PGG signature face.
1808@c -------------------------
1809@item mh-show-signature
1810Signature face.
1811@c -------------------------
1812@item mh-show-subject
1813Face used to highlight @samp{Subject:} header fields.
1814@c -------------------------
1815@item mh-show-to
1816Face used to highlight @samp{To:} header fields.
1817@c -------------------------
1818@item mh-show-xface
1819X-Face image face.
1820@end vtable
1821
1822The functions and variables introduced here are explained in more
1823detail in the following sections.
942 1824
943Depending on your answer, @code{repl} is given a different argument to 1825@menu
944form your reply. Specifically, a choice of @kbd{from} or none at all 1826* Viewing::
945runs @code{repl -nocc all}, and a choice of @kbd{to} runs @code{repl -cc 1827* Viewing Attachments::
946to}. Finally, either @kbd{cc} or @kbd{all} runs @code{repl -cc all 1828* HTML::
947-nocc me}. 1829* Digests::
1830* Reading PGP::
1831* Printing::
1832* Files and Pipes::
1833* Navigating::
1834* Miscellaneous Commands and Options::
1835@end menu
948 1836
949@cindex MH-Letter mode 1837@node Viewing, Viewing Attachments, Reading Mail, Reading Mail
950@cindex modes, MH-Letter 1838@section Viewing Your Mail
1839
1840@findex mh-header-display
1841@findex mh-page-msg
1842@findex mh-previous-page
1843@findex mh-show
1844@findex mh-show-mouse
1845@kindex , (comma)
1846@kindex . (period)
1847@kindex @key{BS}
1848@kindex @key{RET}
1849@kindex @key{SPC}
1850@kindex Mouse-2
1851
1852The command @key{RET} (@code{mh-show}) displays the message that the
1853cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
1854message that the mouse cursor is on. If the message is already
1855displayed, it scrolls to the beginning of the message. Use @key{SPC}
1856(@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
1857forwards and backwards one page at a time through the message. You can
1858give either of these commands a prefix argument that specifies the
1859number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
1860command will also show the next undeleted message if it is used at the
1861bottom of a message. MH-E normally hides a lot of the superfluous
1862header fields that mailers add to a message, but if you wish to see
1863all of them, use the command @kbd{,} (comma;
1864@code{mh-header-display}).
1865
1866The option @code{mh-show-maximum-size} provides an opportunity to skip
1867over large messages which may be slow to load. The default value of 0
1868means that all message are shown regardless of size.
1869
1870A litany of options control what displayed messages look like.
1871
1872@vindex mh-show-cc
1873@vindex mh-show-date
1874@vindex mh-show-from
1875@vindex mh-show-header
1876@vindex mh-show-subject
1877@vindex mh-show-to
1878
1879First, the appearance of the header fields can be modified by
1880customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
1881@code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
1882The face @code{mh-show-header} is used to deemphasize the other, less
1883interesting, header fields.
1884
1885@cindex regular expressions, @code{mh-invisible-header-fields}
1886@vindex mh-clean-message-header-flag
1887@vindex mh-invisible-header-fields-default
1888@vindex mh-invisible-header-fields
1889
1890Normally messages are delivered with a handful of uninteresting header
1891fields. These are hidden by turning on the option
1892@code{mh-clean-message-header-flag} (which it is by default). The
1893header fields listed in the option
1894@code{mh-invisible-header-fields-default} are hidden, although you can
1895check off any field that you would like to see. Header fields that you
1896would like to hide that aren't listed can be added to the option
1897@code{mh-invisible-header-fields} with a couple of caveats. Regular
1898expressions are not allowed. Unique fields should have a @samp{:}
1899suffix; otherwise, the element can be used to render invisible an
1900entire class of fields that start with the same prefix. If you think a
1901header field should be generally ignored, report a bug (@pxref{Bug
1902Reports}).
1903
1904@cindex @samp{Face:} header field
1905@cindex @samp{X-Face:} header field
1906@cindex @samp{X-Image-URL:} header field
1907@cindex header field, @samp{Face:}
1908@cindex header field, @samp{X-Face:}
1909@cindex header field, @samp{X-Image-URL:}
1910@vindex mh-show-use-xface-flag
1911
1912MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
1913@samp{X-Image-URL:} header fields. If any of these fields occur in the
1914header of your message, the sender's face will appear in the
1915@samp{From:} header field. If more than one of these fields appear,
1916then the first field found in the order @samp{Face:}, @samp{X-Face:},
1917and @samp{X-Image-URL:} will be used. The option
1918@code{mh-show-use-xface-flag} is used to turn this feature on and off.
1919This feature will be turned on by default if your system supports it.
1920
1921The first header field used, if present, is the Gnus-specific
1922@samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
1923Emacs 21 and XEmacs. For more information, see
1924@uref{http://quimby.gnus.org/circus/face/}.}.
1925
1926@cindex @command{uncompface}
1927@cindex Emacs, packages, x-face
1928@cindex Unix commands, @command{uncompface}
1929@cindex x-face package
1930@vindex mh-show-xface
1931
1932Next is the traditional @samp{X-Face:} header field@footnote{The
1933display of this field requires the
1934@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
1935@command{uncompface} program}. Recent versions of XEmacs have internal
1936support for @samp{X-Face:} images. If your version of XEmacs does not,
1937then you'll need both @command{uncompface} and the
1938@uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
1939renders the foreground and background of the image using the
1940associated attributes of the face @code{mh-show-xface}.
1941
1942@cindex @command{convert}
1943@cindex @command{wget}
1944@cindex ImageMagick
1945@cindex Unix commands, @command{convert}
1946@cindex Unix commands, @command{wget}
1947@vindex mh-fetch-x-image-url
1948
1949Finally, MH-E will display images referenced by the
1950@samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
1951@samp{X-Face:} fields are present@footnote{The display of the images
1952requires the @uref{http://www.gnu.org/software/wget/wget.html,
1953@command{wget} program} to fetch the image and the @command{convert}
1954program from the @uref{http://www.imagemagick.org/, ImageMagick
1955suite}.}. Of the three header fields this is the most efficient in
1956terms of network usage since the image doesn't need to be transmitted
1957with every single mail. The option @code{mh-fetch-x-image-url}
1958controls the fetching of the @samp{X-Image-URL:} header field image
1959with the following values:
1960
1961@table @samp
1962@item Ask Before Fetching
1963You are prompted before the image is fetched. MH-E will remember your
1964reply and will either use the already fetched image the next time the
1965same URL is encountered or silently skip it if you didn't fetch it the
1966first time. This is a good setting.
1967@c -------------------------
1968@item Never Fetch
1969Images are never fetched and only displayed if they are already
1970present in the cache. This is the default.
1971@end table
951 1972
952Two windows are then created. One window contains the message to which 1973There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
953you are replying. Your draft, in MH-Letter mode (described in 1974of service) reasons. For example, fetching a URL can tip off a spammer
954@ref{Draft Editing}), is in the other window. 1975that you've read his email (which is why you shouldn't blindly answer
1976yes if you've set this option to @samp{Ask Before Fetching}). Someone
1977may also flood your network and fill your disk drive by sending a
1978torrent of messages, each specifying a unique URL to a very large
1979file.
955 1980
956If you wish to customize the header or other parts of the reply draft, 1981@cindex @file{.mhe-x-image-cache}
957please see @code{repl}(1) and @code{mh-format}(5). 1982@cindex files, @file{.mhe-x-image-cache}
1983
1984The cache of images is found in the directory
1985@file{.mhe-x-image-cache} within your MH directory. You can add your
1986own face to the @samp{From:} field too. @xref{Picture}.
1987
1988@cindex @command{mhl}
1989@cindex MH commands, @command{mhl}
1990@vindex mh-mhl-format-file
1991
1992Normally MH-E takes care of displaying messages itself (rather than
1993calling an MH program to do the work). If you'd rather have
1994@command{mhl} display the message (within MH-E), change the option
1995@code{mh-mhl-format-file} from its default value of @samp{Use Default
1996mhl Format (Printing Only)}. You can set this option to @samp{Use
1997Default mhl Format} to get the same output as you would get if you ran
1998@command{mhl} from the shell. If you have a format file that you want
1999MH-E to use, you can set this option to @samp{Specify an mhl Format
2000File} and enter the name of your format file (@command{mhl}(1) or
2001section @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in
2002the MH book tells you how to write one). Your format file should
2003specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2004parse the header. Note that @command{mhl} is always used for printing
2005and forwarding; in this case, the value of @code{mh-mhl-format-file}
2006is consulted if you have specified a format file.
2007
2008@vindex mh-highlight-citation-style
2009@cindex citations, highlighting
2010@cindex highlighting citations
2011
2012If the sender of the message has cited other messages in his message,
2013then MH-E will highlight these citations to emphasize the sender's
2014actual response. The option @code{mh-highlight-citation-style} can be
2015customized to change the highlighting style. The @samp{Multicolor}
2016method uses a different color for each indentation while the
2017@samp{Monotone} method highlights all citations in red. To disable
2018highlighting of citations entirely, choose @samp{None}.
2019
2020@cindex URLs, highlighting
2021@cindex email addresses, highlighting
2022@cindex highlighting URLs
2023@cindex highlighting email addresses
2024@cindex links, following
2025@findex goto-address-at-point
2026@kindex C-c @key{RET}
2027@kindex Mouse-2
2028@vindex goto-address-highlight-p
2029
2030Email addresses and URLs in the message are highlighted if the option
2031@code{goto-address-highlight-p} is on, which it is by default. To view
2032the web page for a highlighted URL or to send a message using a
2033highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}.
2034See @ref{Sending Mail}, to see how to configure Emacs to send the
2035message using MH-E.
2036
2037@cindex boldface, showing
2038@cindex emphasis
2039@cindex italics, showing
2040@cindex smileys
2041@cindex typesetting
2042@cindex underline, showing
2043@vindex gnus-emphasis-alist
2044@vindex mh-decode-mime-flag
2045@vindex mh-graphical-emphasis-flag
2046@vindex mh-graphical-smileys-flag
2047
2048It is a long standing custom to inject body language using a
2049cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2050render these as graphical widgets if the option
2051@code{mh-graphical-smileys-flag} is turned on, which it is by default.
2052Smileys include patterns such as :-) and ;-). Similarly, a few
2053typesetting features are indicated in ASCII text with certain
2054characters. If your terminal supports it, MH-E can render these
2055typesetting directives naturally if the option
2056@code{mh-graphical-emphasis-flag} is turned on, which it is by
2057default. For example, _underline_ will be
2058@ifhtml
2059@html
2060<u>underlined</u>,
2061@end html
2062@end ifhtml
2063@ifnothtml
2064underlined,
2065@end ifnothtml
2066*bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2067and so on. See the option @code{gnus-emphasis-alist} for the whole
2068list. Both of these options are disabled if the option
2069@code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2070
2071@cindex signature separator
2072@cindex vCard
2073@vindex mh-show-signature
2074
2075MH-E normally renders signatures and vCards in italics so that the
2076body of the message stands out more. MH-E depends on the presence of
2077the @dfn{signature separator} (@samp{"-- "}) to do this. You can also
2078customize the face @code{mh-show-signature} so the appearance of the
2079signature block is more to your liking.
2080
2081@vindex mh-show-hook
2082@vindex mh-show-mode-hook
2083
2084Two hooks can be used to control how messages are displayed. The first
2085hook, @code{mh-show-mode-hook}, is called early on in the process of
2086the message display. It is usually used to perform some action on the
2087message's content. The second hook, @code{mh-show-hook}, is the last
2088thing called after messages are displayed. It's used to affect the
2089behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2090early.
958 2091
959@node Forwarding, Redistributing, Replying, Sending Mail 2092@vindex mh-show-buffer-mode-line-buffer-id
960@subsection Forwarding Mail 2093@cindex MH-Show mode
2094@cindex modes, MH-Show
961 2095
962@cindex forwarding 2096For those who like to modify their mode lines, use
963@cindex @code{forw} 2097@code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
964@cindex MH commands, @code{forw} 2098the MH-Show buffers. Place the two escape strings @samp{%s} and
965@findex @code{mh-forward} 2099@samp{%d}, which will display the folder name and the message number,
966 2100respectively, somewhere in the string in that order. The default value
967To forward a message, use the @kbd{f} (@code{mh-forward}) command. You 2101of @samp{"@{show-%s@} %d"} yields a mode line of
968are given a draft to edit that looks like it would if you had run the MH
969command @code{forw}. You are given a chance to add some text (see
970@ref{Draft Editing}).
971
972You can forward several messages by using a prefix argument; in this
973case, you are prompted for the name of a @dfn{sequence}, a symbolic name
974that represents a list or range of message numbers (for example,
975@kbd{C-u f forbob @key{RET}}). All of the messages in the sequence are
976inserted into your draft. By the way, although sequences are often
977mentioned in this chapter, you don't have to worry about them for now;
978the full description of sequences in mh-e is at the end in
979@ref{Sequences}. To learn more about sequences in general, please see
980@code{mh-sequence}(5).
981
982@node Redistributing, Old Drafts, Forwarding, Sending Mail
983@subsection Redistributing Your Mail
984 2102
985@cindex redistributing 2103@smallexample
986@findex @code{mh-redistribute} 2104-----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2105@end smallexample
987 2106
988The command @kbd{M-d} (@code{mh-redistribute}) is similar in function to 2107@node Viewing Attachments, HTML, Viewing, Reading Mail
989forwarding mail, but it does not allow you to edit the message, nor does 2108@section Viewing Attachments
990it add your name to the @samp{From:} header field. It appears to the
991recipient as if the message had come from the original sender. For more
992information on redistributing messages, see @code{dist}(1). Also
993investigate the @kbd{M-a} (@code{mh-edit-again}) command in @ref{Old
994Drafts}, for another way to redistribute messages.
995 2109
996@node Old Drafts, , Redistributing, Sending Mail 2110@cindex @command{mhshow}
997@subsection Editing Old Drafts and Bounced Messages 2111@cindex @command{show}
2112@cindex MH commands, @command{mhshow}
2113@cindex MH commands, @command{show}
2114@cindex MIME
2115@cindex attachments
2116@cindex body parts
2117@cindex multimedia mail
998 2118
999@cindex re-editing drafts 2119MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
1000@cindex @file{draft} 2120Mail Extensions) messages which are simply messages with additional
1001@cindex files, @file{draft} 2121@dfn{body parts} or @dfn{attachments}. You can use the MH commands
1002@findex @code{mh-edit-again} 2122@command{show}@footnote{See the section
2123@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
2124prev} in the MH book.} or @command{mhshow}@footnote{See the section
2125@uref{@value{MH-BOOK-HOME}/usimim.htm#ReMIMa, Reading MIME Mail} in
2126the MH book.} from the shell to read @sc{mime} messages@footnote{You
2127can call them directly from Emacs if you're running the X Window
2128System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2129leave out the @samp{xterm -e} if you use @command{mhlist} or
2130@command{mhstore}.}.
2131
2132@cindex Emacs, packages, mm-decode
2133@cindex mm-decode package
2134@findex mh-toggle-mh-decode-mime-flag
2135@kindex ; (semicolon)
2136@vindex mh-decode-mime-flag
2137
2138MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2139package is present. If so, the option @code{mh-decode-mime-flag} will
2140be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2141or attachments. There isn't much point in turning off the option
2142@code{mh-decode-mime-flag}; however, you can inspect it if it appears
2143that the body parts are not being interpreted correctly or toggle it
2144with the command @kbd{;} (semicolon;
2145@code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2146option also controls the display of quoted-printable messages and
2147other graphical widgets. @xref{Viewing}.
2148
2149@cindex buttons
2150@kindex Mouse-1
2151@kindex Mouse-2
2152@kindex @key{RET}
2153@findex mh-press-button
2154@findex mh-next-button
2155@findex mh-prev-button
2156@kindex K @key{TAB}
2157@kindex K S-@key{TAB}
2158
2159Attachments in MH-E are indicated by buttons like this:
1003 2160
1004If you don't complete a draft for one reason or another, and if the 2161@example
1005draft buffer is no longer available, you can pick your draft up again 2162[1. image/jpeg; foo.jpg]...
1006with @kbd{M-a} (@code{mh-edit-again}). If you don't use a draft folder, 2163@end example
1007your last @file{draft} file will be used. If you use draft folders,
1008you'll need to visit the draft folder with @kbd{M-f drafts @key{RET}},
1009use @kbd{n} to move to the appropriate message, and then use @kbd{M-a}
1010to prepare the message for editing.
1011 2164
1012The @kbd{M-a} command can also be used to take messages that were sent 2165To view the contents of the button, use either @kbd{Mouse-1} or
1013to you and to send them to more people. 2166@kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2167the cursor is over the button. This command is a toggle so if you use
2168it again on the same attachment, it is hidden. If Emacs does not know
2169how to display the attachment, then Emacs offers to save the
2170attachment in a file. To move the cursor to the next button, use the
2171command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2172buffer is reached then the search wraps over to the start of the
2173buffer. To move the cursor to the previous button, use the command
2174@kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2175buffer is reached then the search wraps over to the end of the buffer.
2176
2177@cindex attachments, viewing
2178@cindex viewing attachments
2179@findex mh-folder-toggle-mime-part
2180@kindex K v
2181
2182Another way to view the contents of a button is to use the command
2183@kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2184(or hides) the attachment associated with the button under the cursor.
2185If the cursor is not located over a button, then the cursor first
2186moves to the next button, wrapping to the beginning of the message if
2187necessary. This command has the advantage over the previous commands
2188of working from the MH-Folder buffer. You can also provide a numeric
2189prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2190with that number. If Emacs does not know how to display the
2191attachment, then Emacs offers to save the attachment in a file.
2192
2193@cindex @file{/etc/mailcap}
2194@cindex files, @file{/etc/mailcap}
2195@findex mailcap-mime-info
2196@findex mh-display-with-external-viewer
2197@kindex K e
2198
2199If Emacs does not know how to view an attachment, you could save it
2200into a file and then run some program to open it. It is easier,
2201however, to launch the program directly from MH-E with the command
2202@kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2203likely use this to view spreadsheets and documents, it is also useful
2204to use your browser to view HTML attachments with higher fidelity than
2205what Emacs can provide. This command displays the attachment
2206associated with the button under the cursor. If the cursor is not
2207located over a button, then the cursor first moves to the next button,
2208wrapping to the beginning of the message if necessary. You can provide
2209a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2210labeled with that number. This command tries to provide a reasonable
2211default for the viewer by calling the Emacs function
2212@code{mailcap-mime-info}. This function usually reads the file
2213@file{/etc/mailcap}.
2214
2215@cindex attachments, saving
2216@cindex saving attachments
2217
2218@findex mh-folder-save-mime-part
2219@kindex K o
2220
2221Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2222attachments (the mnemonic is ``output''). This command saves the
2223attachment associated with the button under the cursor. If the cursor
2224is not located over a button, then the cursor first moves to the next
2225button, wrapping to the beginning of the message if necessary. You can
2226also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2227attachment labeled with that number. This command prompts you for a
2228filename and suggests a specific name if it is available.
2229
2230@cindex @command{mhn}
2231@cindex @command{mhstore}
2232@cindex MH commands, @command{mhn}
2233@cindex MH commands, @command{mhstore}
2234@findex mh-mime-save-parts
2235@kindex K a
2236@vindex mh-mime-save-parts-default-directory
2237
2238You can save all of the attachments at once with the command @kbd{K a}
2239(@code{mh-mime-save-parts}). The attachments are saved in the
2240directory specified by the option
2241@code{mh-mime-save-parts-default-directory} unless you use a prefix
2242argument (as in @kbd{C-u K a}) in which case you are prompted for the
2243directory. These directories may be superseded by MH profile
2244components, since this function calls on @command{mhstore}
2245(@command{mhn}) to do the work.
2246
2247The default value for the option
2248@code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2249that you are always prompted for the directory in which to save the
2250attachments. However, if you usually use the same directory within a
2251session, then you can set this option to @samp{Prompt the First Time}
2252to avoid the prompt each time. you can make this directory permanent
2253by choosing @samp{Directory} and entering the directory's name.
2254
2255@cindex attachments, inline
2256@cindex inline attachments
2257@findex mh-toggle-mime-buttons
2258@kindex K t
2259@vindex mh-display-buttons-for-inline-parts-flag
2260
2261The sender can request that attachments should be viewed inline so
2262that they do not really appear like an attachment at all to the
2263reader. Most of the time, this is desirable, so by default MH-E
2264suppresses the buttons for inline attachments. On the other hand, you
2265may receive code or HTML which the sender has added to his message as
2266inline attachments so that you can read them in MH-E. In this case, it
2267is useful to see the buttons so that you know you don't have to cut
2268and paste the code into a file; you can simply save the attachment. If
2269you want to make the buttons visible for inline attachments, you can
2270use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2271the visibility of these buttons. You can turn on these buttons
2272permanently by turning on the option
2273@code{mh-display-buttons-for-inline-parts-flag}.
2274
2275MH-E cannot display all attachments inline however. It can display
2276text (including @sc{html}) and images.
2277
2278@cindex @samp{Content-Disposition:} header field
2279@cindex header field, @samp{Content-Disposition:}
2280@cindex inline images
2281@vindex mh-max-inline-image-height
2282@vindex mh-max-inline-image-width
2283
2284Some older mail programs do not insert the needed
2285plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2286header field.} to tell MH-E whether to display the attachments inline
2287or not. If this is the case, MH-E will display these images inline if
2288they are smaller than the window. However, you might want to allow
2289larger images to be displayed inline. To do this, you can change the
2290options @code{mh-max-inline-image-width} and
2291@code{mh-max-inline-image-height} from their default value of zero to
2292a large number. The size of your screen is a good choice for these
2293numbers.
2294
2295@cindex alternatives
2296@cindex attachments, alternatives
2297@vindex mh-display-buttons-for-alternatives-flag
2298
2299Sometimes, a mail program will produce multiple alternatives of an
2300attachment in increasing degree of faithfulness to the original
2301content. By default, only the preferred alternative is displayed. If
2302the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2303the preferred part is shown inline and buttons are shown for each of
2304the other alternatives.
2305
2306@kindex K i
2307@findex mh-folder-inline-mime-part
2308
2309You can view the raw contents of an attachment with the command @kbd{K
2310i} (@code{mh-folder-inline-mime-part}). This command displays (or
2311hides) the contents of the attachment associated with the button under
2312the cursor verbatim. If the cursor is not located over a button, then
2313the cursor first moves to the next button, wrapping to the beginning
2314of the message if necessary. You can also provide a numeric prefix
2315argument (as in @kbd{4 K i}) to view the attachment labeled with that
2316number.
2317
2318For additional information on buttons, see
2319@ifinfo
2320@ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2321@end ifinfo
2322@ifnotinfo
2323the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2324Article Buttons} and
2325@uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2326in the @cite{The Gnus Manual}.
2327@end ifnotinfo
2328
2329@node HTML, Digests, Viewing Attachments, Reading Mail
2330@section HTML
2331
2332@cindex HTML
2333@cindex Gnus
2334@vindex mm-text-html-renderer
2335
2336MH-E can display messages that have been sent in HTML@footnote{This
2337feature depends on a version of Gnus that is at least 5.10.}. The
2338content of the message will appear in the MH-Show buffer as you would
2339expect if the entire message is HTML, or there is an inline HTML body
2340part. However, if there is an HTML body part that is an attachment,
2341then you'll see a button like this:
1014 2342
1015@cindex Mailer-Daemon 2343@example
1016@findex @code{mh-extract-rejected-mail} 2344[1. text/html; foo.html]...
2345@end example
1017 2346
1018Don't use @kbd{M-a} to re-edit a message from a @i{Mailer-Daemon} who 2347See @ref{Viewing Attachments} to see how to read the contents of this
1019complained that your mail wasn't posted for some reason or another. In 2348body part.
1020this case, use @kbd{M-e} (@code{mh-extract-rejected-mail}) to prepare 2349
1021the message for editing by removing the @i{Mailer-Daemon} envelope and 2350The browser that MH-E uses is determined by the option
1022unneeded header fields. Fix whatever addressing problem you had, and 2351@code{mm-text-html-renderer}. The default setting is set automatically
1023send the message again with @kbd{C-c C-c}. 2352based upon the presence of a known browser on your system. If you wish
2353to use a different browser, then set this option accordingly. See the
2354documentation for the browser you use for additional information on
2355how to use it. In particular, find and disable the option to render
2356images as this can tip off spammers that the email address they have
2357used is valid.
2358
2359If you're confused about which @code{mm-text-html-renderer} to use,
2360here's a brief description of each, sorted by popularity, that
2361includes the results of a quick poll of MH-E users from 2005-12-23.
2362
2363@table @asis
2364
2365@item @samp{w3m} 7
2366The @samp{w3m} browser requires an external program. It's quick,
2367produces pretty nice output, and best of all, it's the only browser
2368that highlights links. These can be clicked with @kbd{Mouse-2} to view
2369the content of the link in @samp{w3m} or with @kbd{S-Mouse-2} to view
2370the content of the link in an external browser. The @samp{w3m} browser
2371handles tables well and actually respects the table's width parameter
2372(which can cause text to wrap if the author didn't anticipate that the
2373page would be viewed in Emacs).
2374@c -------------------------
2375@item @samp{w3m-standalone} 3
2376This browser, along with @samp{nil} for the external browser, are the
2377only choices that work without having to download a separate lisp
2378package or external program. This browser is quick, but does not show
2379links. It handles simple tables but some tables get rendered much
2380wider than the Emacs frame. This browser was the only one not to
2381handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2382render @samp{&reg;}.
2383@c -------------------------
2384@item @samp{links} 1
2385The @samp{links} browser requires an external program. It's quick, and
2386produces nicer output than @samp{lynx} on single column mails in
2387tables. However, it doesn't show links and it doesn't do as nice a job
2388on multi-column tables as some lines wrap. At least it fits in 80
2389columns and thus seems better than @samp{w3} and
2390@samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2391@c -------------------------
2392@item @samp{lynx} 1
2393The @samp{lynx} browser requires an external program. It's quick and
2394produces pretty decent output but it doesn't show links. It doesn't
2395seem to do multi-column tables which makes output much cleaner. It
2396centers the output and wraps long lines more than most. Handles
2397@samp{&reg;}.
2398@c -------------------------
2399@item @samp{nil} 1
2400This choice obviously requires an external browser. Like
2401@samp{w3m-standalone}, it works out of the box. With this setting,
2402HTML messages have a button for the body part which you can view with
2403@kbd{K v} (@code{mh-folder-toggle-mime-part}).
2404@c -------------------------
2405@item @samp{w3} 0
2406This choice does not require an external program as all of the
2407rendering is done in lisp. You do need to get the package separately.
2408This browser is @strong{slow}, and doesn't appear to have been updated
2409since 2001 and the author hasn't responded to my emails. It displays
2410unknown tags instead of hiding them, so you get to see all the
2411Microsoft crap in certain messages. Tends to make multi-column tables
2412wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2413can follow links, but you have to find them first as they are not
2414highlighted. Performs well on single-column tables and handles escapes
2415such as @samp{&reg;}.
2416@c -------------------------
2417@item @samp{html2text} 0
2418The @samp{html2text} browser requires an external program. I noticed
2419that it can do some nasty things with simple HTML mails (like filling
2420the entire message as if it were one paragraph, including signature).
2421On another message, it displayed half of the HTML tags for some
2422reason.
2423@end table
1024 2424
1025@node Draft Editing, Moving Mail, Sending Mail, Using mh-e 2425For a couple more sources of information about
1026@section Editing a Draft 2426@code{mm-text-html-renderer},
2427@ifinfo
2428@xref{Display Customization,,,emacs-mime}, and the documentation for
2429the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2430@end ifinfo
2431@ifnotinfo
2432see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2433Display Customization} in the @cite{The Emacs MIME Manual} and the the
2434documentation for the Gnus command @kbd{W h} (see section
2435@uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2436@cite{The Gnus Manual}).
2437@end ifnotinfo
1027 2438
1028@cindex editing draft 2439@node Digests, Reading PGP, HTML, Reading Mail
1029@cindex MH-Letter mode 2440@section Digests
1030@cindex modes, MH-Letter
1031 2441
1032When you edit a message that you want to send (called a @dfn{draft} in 2442@cindex digests
1033this case), the mode used is MH-Letter. This mode provides 2443@findex mh-page-digest
1034several commands in addition to the normal Emacs editing commands to 2444@findex mh-page-digest-backwards
1035help you edit your draft. 2445@kindex @key{BS}
2446@kindex @key{SPC}
2447@kindex D @key{BS}
2448@kindex D @key{SPC}
2449
2450A digest is a message that contains other messages. Special MH-E
2451commands let you read digests conveniently. You can use @key{SPC} and
2452@key{BS} to page through the digest as if it were a normal message,
2453but if you wish to skip to the next message in the digest, use
2454@kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2455use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2456
2457@cindex @command{burst}
2458@cindex MH commands, @command{burst}
2459@cindex MH-Folder Show mode
2460@cindex modes, MH-Folder Show
2461@findex mh-burst-digest
2462@kindex D b
2463@kindex d
2464@kindex t
2465
2466Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2467command uses the MH command @command{burst}@footnote{See the section
2468@uref{@value{MH-BOOK-HOME}/burdig.htm, Bursting Messages} in the MH
2469book.} to break out each message in the digest into its own message.
2470Using this command, you can quickly delete unwanted messages, like
2471this: Once the digest is split up, toggle out of MH-Folder Show mode
2472with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2473and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2474to quickly delete messages that you don't want to read (based on the
2475@samp{Subject:} header field). You can also burst the digest to reply
2476directly to the people who posted the messages in the digest. One
2477problem you may encounter is that the @samp{From:} header fields are
2478preceded with a @samp{>} so that your reply can't create the
2479@samp{To:} field correctly. In this case, you must correct the
2480@samp{To:} field yourself. This is described later (@pxref{Editing
2481Drafts}).
2482
2483@node Reading PGP, Printing, Digests, Reading Mail
2484@section Signed and Encrypted Messages
2485
2486@cindex GPG
2487@cindex GnuPG
2488@cindex Gnus
2489@cindex OpenPGP
2490@cindex PGP
2491@cindex RFC 3156
2492@cindex encrypted messages
2493@cindex security
2494@cindex signed messages
2495
2496You can read encrypted or signed PGP or GPG messages with
2497MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2498@cite{MIME Security with OpenPGP} is documented in
2499@uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2500MH-E can also decrypt old-style PGP messages that are not in MIME
2501format.}. This section assumes that you already have a good
2502understanding of GPG and have set up your keys appropriately.
2503
2504If someone sends you a signed message, here is what you'll see:
1036 2505
1037@table @kbd 2506@smallexample
1038@item C-c C-y 2507@group
1039Insert contents of message to which you're replying (@code{mh-yank-cur-msg}). 2508[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2509This is a signed message.
1040 2510
1041@item C-c C-i 2511[[End of PGP Signed Part]]
1042Insert a message from a folder (@code{mh-insert-letter}). 2512@end group
2513@end smallexample
1043 2514
1044@item C-c C-f C-t 2515@cindex keychain
1045Move to @samp{To:} header field (@code{mh-to-field}). 2516@cindex key server
2517@cindex signed messages
1046 2518
1047@item C-c C-f C-c 2519If the key for the given signature is not in your keychain, you'll be
1048Move to @samp{cc:} header field (@code{mh-to-field}). 2520given the opportunity to fetch the key from a key server and verify
2521the key. If the message is really large, the verification process can
2522take a long time. You can press @kbd{C-g} at any time to
2523cancel@footnote{Unfortunately in the current version, the validation
2524process doesn't display a message so it appears that MH-E has hung. We
2525hope that this will be fixed in the future.}.
1049 2526
1050@item C-c C-f C-s 2527If the signature doesn't check out, you might see something like this:
1051Move to @samp{Subject:} header field (@code{mh-to-field}).
1052 2528
1053@item C-c C-f C-f 2529@smallexample
1054Move to @samp{From:} header field (@code{mh-to-field}). 2530@group
2531[[PGP Signed Part:Failed]]
2532This is a signed message.
2533This is garbage added after the signature was made.
1055 2534
1056@item C-c C-f C-b 2535[[End of PGP Signed Part]]
1057Move to @samp{Bcc:} header field (@code{mh-to-field}). 2536@end group
2537@end smallexample
1058 2538
1059@item C-c C-f C-f 2539@cindex decrypting messages
1060Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
1061 2540
1062@item C-c C-f C-d 2541If someone sends you an encrypted message, MH-E will ask for your
1063Move to @samp{Dcc:} header field (@code{mh-to-field}). 2542passphrase to decrypt the message. You should see something like this:
1064 2543
1065@item C-c C-w 2544@smallexample
1066Display expanded recipient list (@code{mh-check-whom}). 2545@group
2546[[PGP Encrypted Part:OK]]
1067 2547
1068@item C-c C-s 2548[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
1069Insert signature in message (@code{mh-insert-signature}). 2549This is the secret message.
1070 2550
1071@item C-c C-m C-f 2551[[End of PGP Signed Part]]
1072Include forwarded message (@sc{mime}) (@code{mh-mhn-compose-forw}).
1073 2552
1074@item C-c C-m C-e 2553[[End of PGP Encrypted Part]]
1075Include anonymous ftp reference (@sc{mime}) (@code{mh-mhn-compose-anon-ftp}). 2554@end group
2555@end smallexample
1076 2556
1077@item C-c C-m C-t 2557If there is a problem decrypting the message, the button will say:
1078Include anonymous ftp reference to compressed tar file (@sc{mime})
1079(@code{mh-mhn-compose-external-compressed-tar}).
1080 2558
1081@item C-c C-m C-i 2559@smallexample
1082Include binary, image, sound, etc. (@sc{mime}) 2560[[PGP Encrypted Part:Failed]]
1083(@code{mh-mhn-compose-insertion}). 2561@end smallexample
1084 2562
1085@item C-c C-e 2563You can read the contents of this button using the methods described in
1086Run through @code{mhn} before sending (@code{mh-edit-mhn}). 2564@ref{Viewing Attachments}. If the message were corrupted, you'd see
2565this:
1087 2566
1088@item C-c C-m C-u 2567@smallexample
1089Undo effects of @code{mhn} (@code{mh-revert-mhn-edit}). 2568[[PGP Encrypted Part:Failed]
2569Invalid base64 data]
2570@end smallexample
1090 2571
1091@item C-c C-c 2572If your passphrase were incorrect, you'd see something like this:
1092Save draft and send message (@code{mh-send-letter}).
1093 2573
1094@item C-c C-q 2574@smallexample
1095Quit editing and delete draft message (@code{mh-fully-kill-draft}). 2575[GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
1096@end table 2576[GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2577[GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2578[GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2579gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2580 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2581gpg: public key decryption failed: bad passphrase
2582[GNUPG:] BEGIN_DECRYPTION
2583[GNUPG:] DECRYPTION_FAILED
2584gpg: decryption failed: secret key not available
2585[GNUPG:] END_DECRYPTION
2586
2587gpg exited abnormally: '2'
2588@end smallexample
1097 2589
1098@menu 2590@vindex mh-show-pgg-bad
1099* Editing Textual:: 2591@vindex mh-show-pgg-good
1100* Editing MIME:: 2592@vindex mh-show-pgg-unknown
1101* Sending Message::
1102* Killing Draft::
1103@end menu
1104 2593
1105@node Editing Textual, Editing MIME, Draft Editing, Draft Editing 2594The appearance of the buttons is controlled by the faces
1106@subsection Editing Textual Messages 2595@code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2596@code{mh-show-pgg-unknown} depending on the validity of the signature.
2597The latter is used whether the signature is unknown or untrusted.
1107 2598
1108The following sections show you how to edit a draft. 2599@cindex @samp{pgg} customization group
1109The commands described here are also applicable to messages that have 2600@cindex PGG
1110multimedia components. 2601@cindex customization group, @samp{pgg}
1111 2602
1112@menu 2603The @samp{pgg} customization group may have some settings which may
1113* Inserting Letter:: 2604interest you.
1114* Inserting Messages:: 2605@iftex
1115* Header:: 2606See @cite{The PGG Manual}.
1116* Recipients:: 2607@end iftex
1117* Signature:: 2608@ifinfo
1118@end menu 2609@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2610@end ifinfo
2611@ifhtml
2612See
2613@uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2614@cite{The PGG Manual}}.
2615@end ifhtml
1119 2616
1120@node Inserting Letter, Inserting Messages, Editing Textual, Editing Textual 2617@node Printing, Files and Pipes, Reading PGP, Reading Mail
1121@subsubsection Inserting letter to which you're replying 2618@section Printing Your Mail
1122 2619
1123@cindex inserting messages 2620@cindex printing
1124@findex @code{mh-yank-cur-msg} 2621@findex mh-ps-print-msg
2622@findex mh-ps-print-msg-file
2623@kindex P f
2624@kindex P p
2625
2626To print messages in MH-E, use the command @kbd{P p}
2627(@code{mh-ps-print-msg}). You can print all the messages in a range
2628(as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2629@pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2630(@code{mh-ps-print-msg-file}). This command will print inline text
2631attachments but will not decrypt messages. However, when a message is
2632displayed in an MH-Show buffer, then that buffer is used verbatim for
2633printing with the caveat that only text attachments, if opened inline,
2634are printed. Therefore, encrypted messages can be printed by showing
2635and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2636use the options @code{mh-lpr-command-format} or
2637@code{mh-print-background-flag}, described below.
2638
2639@findex mh-ps-print-toggle-color
2640@kindex P C
2641@vindex ps-print-color-p
2642
2643Colors are emulated on black-and-white printers with shades of gray.
2644This might produce illegible output, even if your screen colors only
2645use shades of gray. If this is the case, try using the command @kbd{P
2646C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2647color, and a black and white representation of the colors and see
2648which works best. You change this setting permanently by customizing
2649the option @code{ps-print-color-p}.
2650
2651@findex mh-ps-print-toggle-faces
2652@kindex P F
2653
2654Another related function is the command @kbd{P F}
2655(@code{mh-ps-print-toggle-faces}). This command toggles between using
2656faces and not. When faces are enabled, the printed message will look
2657very similar to the message in the MH-Show buffer.
2658
2659@cindex ps-print package
2660@cindex Emacs, packages, ps-print
2661
2662MH-E uses the @samp{ps-print} package to do the printing, so you can
2663customize the printing further by going to the @samp{ps-print}
2664customization group.
2665
2666@cindex @command{lpr}
2667@cindex @command{mhl}
2668@cindex MH commands, @command{mhl}
2669@cindex Unix commands, @command{lpr}
2670@findex mh-print-msg
2671@kindex P l
2672
2673An alternative to using the @samp{ps-print} package is the command
2674@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2675@i{l}pr). You can print all the messages in a range. The message is
2676formatted with @command{mhl}@footnote{See the section
2677@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
2678book.} and printed with the @command{lpr} command.
2679
2680@vindex mh-lpr-command-format
2681@vindex mh-print-background-flag
2682
2683The command @kbd{P l} uses two options. The option
2684@code{mh-lpr-command-format} contains the Unix command line which
2685performs the actual printing. The string can contain one escape,
2686@samp{%s}, which is replaced by the name of the folder and the message
2687number and is useful for print job names. The default setting is
2688@samp{"lpr -J '%s'"}. I use @samp{"mpage -h'%s' -b Letter -H1of -mlrtb
2689-P"} which produces a nice header and adds a bit of margin so the text
2690fits within my printer's margins. Normally messages are printed in the
2691foreground. If this is slow on your system, you may elect to turn on
2692the option @code{mh-print-background-flag} to print in the background.
2693If you do this, do not delete the message until it is printed or else
2694the output may be truncated. These options are not used by the
2695commands @kbd{P p} or @kbd{P f}.
2696
2697@node Files and Pipes, Navigating, Printing, Reading Mail
2698@section Files and Pipes
2699
2700@cindex files
2701@cindex pipes
2702
2703@findex mh-refile-or-write-again
2704@findex mh-write-msg-to-file
2705@kindex !
2706@kindex >
2707
2708MH-E does offer a couple of commands that are not a part of MH@. The
2709first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2710a file. You are prompted for the filename. If the file already exists,
2711the message is appended to it. You can also write the message to the
2712file without the header by specifying a prefix argument (such as
2713@kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2714can be made with the command @kbd{!}
2715(@code{mh-refile-or-write-again}).
2716
2717@findex mh-pipe-msg
2718@kindex |
1125 2719
1126It is often useful to insert a snippet of text from a letter that 2720You can also pipe the message through a Unix shell command with the
1127someone mailed to provide some context for your reply. The command 2721command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
1128@kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by yanking a portion of 2722command through which you wish to run your message. If you give a
1129text from the message to which you're replying and inserting @samp{> } 2723prefix argument to this command, the message header is included in the
1130before each line. 2724text passed to the command (the contrived example @kbd{C-u | lpr}
2725would be done with the @kbd{l} command instead).
1131 2726
1132@cindex mark 2727@cindex @command{shar}
1133@cindex Emacs, mark 2728@cindex @command{uuencode}
1134@cindex point 2729@cindex Unix commands, @command{shar}
1135@cindex Emacs, point 2730@cindex Unix commands, @command{uuencode}
1136@cindex region 2731@findex mh-store-msg
1137@cindex Emacs, region 2732@kindex X s
2733@vindex mh-store-default-directory
2734
2735If the message is a shell archive @command{shar} or has been run
2736through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2737extract the body of the message. The default directory for extraction
2738is the current directory; however, you have a chance to specify a
2739different extraction directory. The next time you use this command,
2740the default directory is the last directory you used. If you would
2741like to change the initial default directory, customize the option
2742@code{mh-store-default-directory}, change the value from
2743@samp{Current} to @samp{Directory}, and then enter the name of the
2744directory for storing the content of these messages.
2745
2746@findex mh-store-buffer
2747
2748By the way, @kbd{X s} calls the Emacs Lisp function
2749@code{mh-store-buffer}. I mention this because you can use it directly
2750if you're editing a buffer that contains a file that has been run
2751through @command{uuencode} or @command{shar}. For example, you can
2752extract the contents of the current buffer in your home directory by
2753typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
1138 2754
1139You can control how much text is included when you run this command. If 2755@node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
1140you run this command right away, without entering the buffer containing 2756@section Navigating
1141the message to you, this command will yank the entire message, as is,
1142into your reply. @footnote{If you'd rather have the header cleaned up,
1143use @kbd{C-u r} instead of @kbd{r} when replying (see @ref{Replying}).}
1144If you enter the buffer containing the message sent to you and move the
1145cursor to a certain point and return to your reply and run @kbd{C-c
1146C-y}, then the text yanked will range from that point to the end of the
1147message. Finally, the most common action you'll perform is to enter the
1148message sent to you, move the cursor to the beginning of a paragraph or
1149phrase, set the @dfn{mark} with @kbd{C-SPC} or @kbd{C-@@}, and move the
1150cursor to the end of the paragraph or phrase. The cursor position is
1151called the @dfn{point}, and the space between the mark and point is
1152called the @dfn{region}. Having done that, @kbd{C-c C-y} will insert
1153the region you selected.
1154
1155@node Inserting Messages, Header, Inserting Letter, Editing Textual
1156@subsubsection Inserting messages
1157 2757
1158@cindex inserting messages 2758@cindex moving between messages
1159@findex @code{mh-insert-letter} 2759@cindex navigation
2760@findex mh-first-msg
2761@findex mh-goto-msg
2762@findex mh-last-msg
2763@findex mh-next-undeleted-msg
2764@findex mh-next-unread-msg
2765@findex mh-previous-undeleted-msg
2766@findex mh-previous-unread-msg
2767@kindex M-<
2768@kindex M->
2769@kindex M-n
2770@kindex M-p
2771@kindex g
2772@kindex n
2773@kindex p
2774
2775To move on to the next message, use the command @kbd{n}
2776(@code{mh-next-undeleted-msg}); use @kbd{p}
2777(@code{mh-previous-undeleted-msg}) to read the previous message. To
2778move to the next unread message, use @kbd{M-n}
2779(@code{mh-next-unread-msg}); use @kbd{M-p}
2780(@code{mh-previous-unread-msg}) to move to the previous unread
2781message. These commands can be given a prefix argument to specify how
2782many messages to skip (for example, @kbd{5 n}). You can also move to a
2783specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
2784message number either before or after typing @kbd{g}. In the latter
2785case, Emacs prompts you. Finally, you can go to the first or last
2786message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
2787(@code{mh-last-msg}) respectively.
1160 2788
1161Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}). 2789@cindex MH-Folder mode
1162This command prompts you for the folder and message number and inserts 2790@cindex modes, MH-Folder
1163the message, indented by @samp{> }. Certain undesirable header fields 2791@findex next-line
1164are removed before insertion. If given a prefix argument (like @kbd{C-u 2792@findex previous-line
1165C-c C-i}), the header is left intact, the message is not indented, and 2793@kindex C-n
1166@samp{> } is not inserted before each line. 2794@kindex C-p
2795
2796You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
2797and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
2798the MH-Folder window. These commands can be used in conjunction with
2799@key{RET} to look at deleted or refiled messages.
2800
2801@cindex deleting messages
2802@findex mh-delete-msg
2803@kindex d
2804
2805To mark a message for deletion, use the command @kbd{d}
2806(@code{mh-delete-msg}). A @samp{D} is placed by the message in the
2807scan window, and the next undeleted message is displayed. If the
2808previous command had been @kbd{p}, then the next message displayed is
2809the first undeleted message previous to the message just deleted. Use
2810@kbd{n} to force subsequent @kbd{d} commands to move forward to the
2811next undeleted message after deleting the message under the cursor.
2812You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
2813frombob @key{RET}}, @pxref{Ranges}).
2814
2815@findex mh-delete-msg-no-motion
2816@kindex C-d
2817
2818The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
2819message (or messages in range) for deletion but leaves the cursor at
2820the current message in case you wish to perform other operations on
2821the message.
2822
2823@findex mh-delete-subject
2824@findex mh-delete-subject-or-thread
2825@kindex k
2826
2827And to delete more messages faster, you can use @kbd{k}
2828(@code{mh-delete-subject-or-thread}) to delete all the messages with
2829the same subject as the current message. This command puts these
2830messages in a sequence named @samp{subject}. You can undo this action
2831by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
2832specifying the @samp{subject} sequence. However, if the buffer is
2833displaying a threaded view of the folder then @kbd{k} behaves like
2834@kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
2835
2836@findex mh-execute-commands
2837@kindex x
2838
2839However you mark a message for deletion, the command @kbd{x}
2840(@code{mh-execute-commands}) actually carries out the deletion
2841(@pxref{Folders}).
2842
2843@vindex mh-delete-msg-hook
1167 2844
1168@node Header, Recipients, Inserting Messages, Editing Textual 2845The hook @code{mh-delete-msg-hook} is called after you mark a message
1169@subsubsection Editing the header 2846for deletion. For example, a past maintainer of MH-E used this once
2847when he kept statistics on his mail usage.
1170 2848
1171@cindex editing header 2849@node Miscellaneous Commands and Options, , Navigating, Reading Mail
1172@findex @code{mh-to-field} 2850@section Miscellaneous Commands and Options
1173 2851
1174Because the header is part of the message, you can edit the header 2852This section contains a few more miscellaneous commands and options.
1175fields as you wish. However, several convenience functions exist to
1176help you create and edit them. For example, the command @kbd{C-c C-f
1177C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
1178cursor to the @samp{To:} header field, creating it if necessary. The
1179functions to move to the @samp{cc:}, @samp{Subject:}, @samp{From:},
1180@samp{Bcc:}, and @samp{Dcc:} header fields are similar.
1181 2853
1182@findex @code{mh-to-fcc} 2854@cindex editing message
2855@findex mh-modify
2856@kindex M
1183 2857
1184One function behaves differently from the others, namely, @kbd{C-c C-f 2858There are times when you need to edit a message. For example, you may
1185C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This function 2859need to fix a broken Content-Type header field. You can do this with
1186will prompt you for the folder name in which to file a copy of the draft. 2860the command @kbd{M} (@code{mh-modify}). It displays the raw message in
2861an editable buffer. When you are done editing, save and kill the
2862buffer as you would any other.
1187 2863
1188Be sure to leave a row of dashes or a blank line between the header and 2864@vindex mh-do-not-confirm-flag
1189the body of the message.
1190 2865
1191@node Recipients, Signature, Header, Editing Textual 2866Commands such as @code{mh-pack-folder} prompt to confirm whether to
1192@subsubsection Checking recipients 2867process outstanding moves and deletes or not before continuing.
2868Turning on the option @code{mh-do-not-confirm-flag} means that these
2869actions will be performed---which is usually desired but cannot be
2870retracted---without question@footnote{In previous versions of MH-E,
2871this option suppressed the confirmation in @code{mh-kill-folder}.
2872Since this kept most users from setting this option,
2873@code{mh-kill-folder} was modified in version 6.0 to always ask for
2874confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
2875@xref{Folders}.}.
1193 2876
1194@cindex checking recipients 2877@cindex MH-Folder mode
1195@cindex @code{whom} 2878@cindex modes, MH-Folder
1196@cindex MH commands, @code{whom} 2879@vindex mh-summary-height
1197@findex @code{mh-check-whom}
1198 2880
1199The @kbd{C-c C-w} (@code{mh-check-whom}) command expands aliases so you 2881The option @code{mh-summary-height} controls the number of scan lines
1200can check the actual address(es) in the alias. A new buffer is created 2882displayed in the MH-Folder window, including the mode line. The
1201with the output of @code{whom}. 2883default value of this option is @samp{Automatic} which means that the
2884MH-Folder buffer will maintain the same proportional size if the frame
2885is resized. If you'd prefer a fixed height, then choose the
2886@samp{Fixed Size} option and enter the number of lines you'd like to
2887see.
1202 2888
1203@node Signature, , Recipients, Editing Textual 2889@vindex mh-bury-show-buffer-flag
1204@subsubsection Inserting your signature
1205 2890
1206@cindex inserting signature 2891Normally the buffer for displaying messages is buried at the bottom at
1207@cindex signature 2892the buffer stack. You may wish to disable this feature by turning off
1208@cindex @file{.signature} 2893the option @code{mh-bury-show-buffer-flag}. One advantage of not
1209@cindex files, @file{.signature} 2894burying the show buffer is that one can delete the show buffer more
1210@findex @code{mh-insert-signature} 2895easily in an electric buffer list because of its proximity to its
2896associated MH-Folder buffer. Try running @kbd{M-x
2897electric-buffer-list} to see what I mean.
1211 2898
1212You can insert your signature at the current cursor location with the 2899@cindex @file{.emacs}
1213@kbd{C-c C-s} (@code{mh-insert-signature}) command. The text of your 2900@cindex files, @file{.emacs}
1214signature is taken from the file @file{~/.signature}. 2901@cindex reading mail
1215 2902
1216@node Editing MIME, Sending Message, Editing Textual, Draft Editing 2903Before we leave this section, I'll include a function that I use as a
1217@subsection Editing Multimedia Messages 2904front end to MH-E@footnote{Stephen Gildea's favorite binding is
2905@kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
2906working window configuration, which may be quite involved---windows
2907filled with source, compilation output, man pages, and other
2908documentation---and your MH-E window configuration. Like the rest of
2909the customization described in this section, simply add the following
2910code to @file{~/.emacs}.
1218 2911
1219@cindex MIME 2912@iftex
1220@cindex multimedia mail 2913@filbreak
1221@cindex @code{mhn} 2914@end iftex
1222@cindex MH commands, @code{mhn}
1223 2915
1224mh-e has the capability to create multimedia messages. It uses the 2916@findex mh-rmail, example
1225@sc{mime} (Multipurpose Internet Mail Extensions) protocol. The
1226@sc{mime} protocol allows you to incorporate images, sound, video,
1227binary files, and even commands that fetch a file with @samp{ftp} when
1228your recipient reads the message! If you were to create a multimedia
1229message with plain MH commands, you would use @code{mhn}. Indeed, the
1230mh-e @sc{mime} commands merely insert @code{mhn} directives which are
1231later expanded by @code{mhn}.
1232
1233Each of the mh-e commands for editing multimedia messages or for
1234incorporating multimedia objects is prefixed with @kbd{C-c C-m} .
1235
1236@cindex content types
1237@cindex MIME, content types
1238
1239Several @sc{mime} objects are defined. They are called @dfn{content
1240types}. The table in @ref{Customizing Draft Editing} contains a list of
1241the content types that mh-e currently knows about. Several of the mh-e
1242commands fill in the content type for you, whereas others require you to
1243enter one. Most of the time, it should be obvious which one to use
1244(e.g., use @kbd{image/jpeg} to include a @sc{jpeg} image). If not, you
1245can refer to @sc{rfc} 1521,
1246@c Footnotes are very fragile. Hence the duplication.
1247@c The line break in the footnote was necessary since TeX wasn't creating one.
1248@ifclear html
1249@footnote{This @sc{rfc} (Request For Comments) is
1250available via the @sc{url} @*
1251@file{ftp://ds.internic.net/rfc/rfc1521.txt}.}
1252@end ifclear
1253@ifset html
1254@footnote{This @sc{rfc} (Request For Comments) is
1255available via the @sc{url} @*
1256@file{<A HREF="ftp://ds.internic.net/rfc/rfc1521.txt">ftp://ds.internic.net/rfc/rfc1521.txt</A>}.}
1257@end ifset
1258which defines the @sc{mime} protocol, for a list of valid content types.
1259 2917
1260@cindex content description 2918@smalllisp
1261@cindex MIME, content description 2919@group
2920(defvar my-mh-screen-saved nil
2921 "Set to non-@code{nil} when MH-E window configuration shown.")
2922(defvar my-normal-screen nil "Normal window configuration.")
2923(defvar my-mh-screen nil "MH-E window configuration.")
1262 2924
1263You are also sometimes asked for a @dfn{content description}. This is 2925(defun my-mh-rmail (&optional arg)
1264simply an optional brief phrase, in your own words, that describes the 2926 "Toggle between MH-E and normal screen configurations.
1265object. If you don't care to enter a content description, just press 2927With non-@code{nil} or prefix argument, @i{inc} mailbox as well
1266return and none will be included; however, a reader may skip over 2928when going into mail."
1267multimedia fields unless the content description is compelling. 2929 (interactive "P") ; @r{user callable function, P=prefix arg}
2930 (setq my-mh-screen-saved ; @r{save state}
2931 (cond
2932 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
2933 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
2934 ((or arg (null my-mh-screen-saved))
2935 (setq my-normal-screen (current-window-configuration))
2936 (if (or arg (null (get-buffer "+inbox")))
2937 (mh-rmail)
2938 (set-window-configuration my-mh-screen))
2939 t) ; @r{set my-mh-screen-saved to @code{t}}
2940 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
2941 (t
2942 (setq my-mh-screen (current-window-configuration))
2943 (set-window-configuration my-normal-screen)
2944 nil)))) ; @r{set my-mh-screen-saved to nil}
1268 2945
1269Remember: you can always add @code{mhn} directives by hand. 2946(global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
1270 2947
1271@menu 2948@i{Starting MH-E}
1272* Forwarding MIME::
1273* FTP::
1274* Tar::
1275* Other MIME Objects::
1276* Sending MIME::
1277@end menu
1278 2949
1279@node Forwarding MIME, FTP, Editing MIME, Editing MIME 2950@end group
1280@subsubsection Forwarding multimedia messages 2951@end smalllisp
1281 2952
1282@findex @code{mh-mhn-compose-forw} 2953If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
2954@code{nil} (meaning a non-MH-E window configuration), the current
2955window configuration is saved, either the @samp{+inbox} buffer is
2956displayed or @code{mh-rmail} is run, and the MH-E window configuration
2957is shown. Otherwise, the MH-E window configuration is saved and the
2958original configuration is displayed.
1283 2959
1284Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m C-f} 2960@node Folders, Sending Mail, Reading Mail, Top
1285(@code{mh-mhn-compose-forw}). You are prompted for a content 2961@chapter Organizing Your Mail with Folders
1286description, the name of the folder in which the messages to forward are
1287located, and the messages' numbers.
1288 2962
1289@node FTP, Tar, Forwarding MIME, Editing MIME 2963@cindex folders
1290@subsubsection Including an ftp reference 2964@cindex using folders
1291 2965
1292@cindex @code{ftp} 2966This chapter discusses the things you can do with folders within MH-E.
1293@cindex Unix commands, @code{ftp} 2967The commands in this chapter are also found in the @samp{Folder} and
1294@cindex MIME, @code{ftp} 2968@samp{Message} menus.
1295@findex @code{mh-mhn-compose-anon-ftp}
1296 2969
1297You can even have your message initiate an @code{ftp} transfer when the 2970@table @kbd
1298recipient reads the message. To do this, use the @kbd{C-c C-m C-e} 2971@kindex ?
1299(@code{mh-mhn-compose-anon-ftp}) command. You are prompted for the 2972@findex mh-help
1300remote host and pathname, the content type, and the content description. 2973@item ?
2974Display cheat sheet for the MH-E commands (@code{mh-help}).
2975@c -------------------------
2976@kindex !
2977@findex mh-refile-or-write-again
2978@item !
2979Repeat last output command (@code{mh-refile-or-write-again}).
2980@c -------------------------
2981@cindex @samp{Message > Copy Message to Folder...} menu item
2982@cindex menu item, @samp{Message > Copy Message to Folder...}
2983@kindex c
2984@findex mh-copy-msg
2985@item c
2986Copy range to folder (@code{mh-copy-msg}).
2987@c -------------------------
2988@kindex F ?
2989@findex mh-prefix-help
2990@item F ?
2991Display cheat sheet for the commands of the current prefix in
2992minibuffer (@code{mh-prefix-help}).
2993@c -------------------------
2994@kindex F '
2995@findex mh-index-ticked-messages
2996@item F '
2997Display ticked messages (@code{mh-index-ticked-messages}).
2998@c -------------------------
2999@kindex F c
3000@findex mh-catchup
3001@item F c
3002Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3003@c -------------------------
3004@kindex F k
3005@findex mh-kill-folder
3006@item F k
3007Remove folder (@code{mh-kill-folder}).
3008@c -------------------------
3009@cindex @samp{Folder > List Folders} menu item
3010@cindex menu item, @samp{Folder > List Folders}
3011@kindex F l
3012@findex mh-list-folders
3013@item F l
3014List all folders (@code{mh-list-folders}).
3015@c -------------------------
3016@cindex @samp{Folder > View New Messages} menu item
3017@cindex menu item, @samp{Folder > View New Messages}
3018@kindex F n
3019@findex mh-index-new-messages
3020@item F n
3021Display unseen messages (@code{mh-index-new-messages}).
3022@c -------------------------
3023@cindex @samp{Folder > Pack Folder} menu item
3024@cindex menu item, @samp{Folder > Pack Folder}
3025@kindex F p
3026@findex mh-pack-folder
3027@item F p
3028Pack folder (@code{mh-pack-folder}).
3029@c -------------------------
3030@kindex F q
3031@findex mh-index-sequenced-messages
3032@item F q
3033Display messages in any sequence (@code{mh-index-sequenced-messages}).
3034@c -------------------------
3035@cindex @samp{Folder > Rescan Folder} menu item
3036@cindex menu item, @samp{Folder > Rescan Folder}
3037@kindex F r
3038@findex mh-rescan-folder
3039@item F r
3040Rescan folder (@code{mh-rescan-folder}).
3041@c -------------------------
3042@cindex @samp{Folder > Search...} menu item
3043@cindex menu item, @samp{Folder > Search...}
3044@kindex F s
3045@findex mh-search
3046@item F s
3047Search your MH mail (@code{mh-search}).
3048@c -------------------------
3049@cindex @samp{Folder > Sort Folder} menu item
3050@cindex menu item, @samp{Folder > Sort Folder}
3051@kindex F S
3052@findex mh-sort-folder
3053@item F S
3054Sort folder (@code{mh-sort-folder}).
3055@c -------------------------
3056@kindex F u
3057@findex mh-undo-folder
3058@item F u
3059Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3060@c -------------------------
3061@cindex @samp{Folder > Visit a Folder...} menu item
3062@cindex menu item, @samp{Folder > Visit a Folder...}
3063@kindex F v
3064@findex mh-visit-folder
3065@item F v
3066Visit folder (@code{mh-visit-folder}).
3067@c -------------------------
3068@cindex @samp{Message > Refile Message} menu item
3069@cindex menu item, @samp{Message > Refile Message}
3070@kindex o
3071@findex mh-refile-msg
3072@item o
3073Refile (output) range into folder (@code{mh-refile-msg}).
3074@c -------------------------
3075@cindex @samp{Folder > Quit MH-E} menu item
3076@cindex menu item, @samp{Folder > Quit MH-E}
3077@kindex q
3078@findex mh-quit
3079@item q
3080Quit the current MH-E folder (@code{mh-quit}).
3081@c -------------------------
3082@cindex @samp{Folder > Toggle Show/Folder} menu item
3083@cindex menu item, @samp{Folder > Toggle Show/Folder}
3084@kindex t
3085@findex mh-toggle-showing
3086@item t
3087Toggle between MH-Folder and MH-Folder Show modes
3088(@code{mh-toggle-showing}).
3089@c -------------------------
3090@cindex @samp{Message > Undo Delete/Refile} menu item
3091@cindex menu item, @samp{Message > Undo Delete/Refile}
3092@kindex u
3093@findex mh-undo
3094@item u
3095Undo pending deletes or refiles in range (@code{mh-undo}).
3096@c -------------------------
3097@cindex @samp{Message > Execute Delete/Refile} menu item
3098@cindex menu item, @samp{Message > Execute Delete/Refile}
3099@kindex x
3100@findex mh-execute-commands
3101@item x
3102Process outstanding delete and refile requests
3103(@code{mh-execute-commands}).
3104@end table
1301 3105
1302@node Tar, Other MIME Objects, FTP, Editing MIME 3106@cindex @samp{mh-folder} customization group
1303@subsubsection Including tar files 3107@cindex customization group, @samp{mh-folder}
3108
3109The @samp{mh-folder} customization group is used to tune these
3110commands.
3111
3112@vtable @code
3113@item mh-new-messages-folders
3114Folders searched for the @samp{unseen} sequence (default:
3115@code{Inbox}).
3116@c -------------------------
3117@item mh-ticked-messages-folders
3118Folders searched for @code{mh-tick-seq} (default: @code{t}).
3119@c -------------------------
3120@item mh-large-folder
3121The number of messages that indicates a large folder (default: 200).
3122@c -------------------------
3123@item mh-recenter-summary-flag
3124On means to recenter the summary window (default: @samp{off}).
3125@c -------------------------
3126@item mh-recursive-folders-flag
3127On means that commands which operate on folders do so recursively
3128(default: @samp{off}).
3129@c -------------------------
3130@item mh-sortm-args
3131Additional arguments for @command{sortm} (default: @code{nil}).
3132@end vtable
3133
3134The following hooks are available.
3135
3136@vtable @code
3137@item mh-after-commands-processed-hook
3138Hook run by @kbd{x} after performing outstanding refile and delete
3139requests (default: @code{nil}).
3140@c -------------------------
3141@item mh-before-commands-processed-hook
3142Hook run by @kbd{x} before performing outstanding refile and delete
3143requests (default: @code{nil}).
3144@c -------------------------
3145@item mh-before-quit-hook
3146Hook run by q before quitting MH-E (default: @code{nil}).
3147@c -------------------------
3148@item mh-folder-mode-hook
3149Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3150@code{nil}).
3151@c -------------------------
3152@item mh-kill-folder-suppress-prompt-hook
3153Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3154@code{'mh-search-p}).
3155@c -------------------------
3156@item mh-quit-hook
3157Hook run by q after quitting MH-E (default: @code{nil}).
3158@c -------------------------
3159@item mh-refile-msg-hook
3160Hook run by o after marking each message for refiling (default:
3161@code{nil}).
3162@end vtable
3163
3164The following faces are available for customizing the appearance of
3165the MH-Folder buffer. @xref{Scan Line Formats}.
3166
3167@vtable @code
3168@item mh-folder-address
3169Recipient face.
3170@c -------------------------
3171@item mh-folder-body
3172Body text face.
3173@c -------------------------
3174@item mh-folder-cur-msg-number
3175Current message number face.
3176@c -------------------------
3177@item mh-folder-date
3178Date face.
3179@c -------------------------
3180@item mh-folder-deleted
3181Deleted message face.
3182@c -------------------------
3183@item mh-folder-followup
3184@samp{Re:} face.
3185@c -------------------------
3186@item mh-folder-msg-number
3187Message number face.
3188@c -------------------------
3189@item mh-folder-refiled
3190Refiled message face.
3191@c -------------------------
3192@vindex mh-scan-format-nmh
3193@vindex mh-scan-sent-to-me-sender-regexp
3194@item mh-folder-sent-to-me-hint
3195Fontification hint face in messages sent directly to us. The detection
3196of messages sent to us is governed by the scan format
3197@code{mh-scan-format-nmh} and regular expression
3198@code{mh-scan-sent-to-me-sender-regexp}.
3199@c -------------------------
3200@vindex mh-scan-format-nmh
3201@vindex mh-scan-sent-to-me-sender-regexp
3202@item mh-folder-scan-format
3203Sender face in messages sent directly to us. The detection of messages
3204sent to us is governed by the scan format @code{mh-scan-format-nmh}
3205and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3206@c -------------------------
3207@item mh-folder-subject
3208Subject face.
3209@c -------------------------
3210@item mh-folder-tick
3211Ticked message face.
3212@c -------------------------
3213@item mh-folder-to
3214@samp{To:} face.
3215@end vtable
3216
3217The hook @code{mh-folder-mode-hook} is called when visiting a new
3218folder in MH-Folder mode. This could be used to set your own key
3219bindings, for example:
3220
3221@vindex mh-folder-mode-hook, example
3222
3223@smalllisp
3224@group
3225(defvar my-mh-init-done nil
3226 "Non-@code{nil} when one-time MH-E settings made.")
1304 3227
1305@cindex @code{tar} 3228(defun my-mh-folder-mode-hook ()
1306@cindex Unix commands, @code{tar} 3229 "Hook to set key bindings in MH-Folder mode."
1307@cindex MIME, @code{tar} 3230 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
1308@cindex @code{ftp} 3231 (progn
1309@cindex Unix commands, @code{ftp} 3232 (local-set-key "//" 'my-search-msg)
1310@cindex MIME, @code{ftp} 3233 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
1311@findex @code{mh-mhn-compose-external-compressed-tar} 3234 (setq my-mh-init-done t))))
1312 3235
1313If the remote file (@pxref{FTP}) is a compressed tar file, you can use 3236(add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
1314@kbd{C-c C-m C-t} (@code{mh-mhn-compose-external-compressed-tar}).
1315Then, in addition to retrieving the file via anonymous @emph{ftp}, the
1316file will also be uncompressed and untarred. You are prompted for the
1317remote host and pathname and the content description. The pathname
1318should contain at least one @samp{/} (slash), because the pathname is
1319broken up into directory and name components.
1320 3237
1321@node Other MIME Objects, Sending MIME, Tar, Editing MIME 3238(defun my-search-msg ()
1322@subsubsection Including other multimedia objects 3239 "Search for a regexp in the current message."
3240 (interactive) ; @r{user function}
3241 (save-window-excursion
3242 (other-window 1) ; @r{go to next window}
3243 (isearch-forward-regexp))) ; @r{string search; hit return}
3244 ; @r{ when done}
1323 3245
1324@cindex images 3246@i{Create additional key bindings via mh-folder-mode-hook}
1325@cindex MIME, images
1326@cindex sound
1327@cindex MIME, sound
1328@cindex video
1329@cindex MIME, video
1330@findex @code{mh-mhn-compose-insertion}
1331 3247
1332Images, sound, and video can be inserted in your message with the 3248@end group
1333@kbd{C-c C-m C-i} (@code{mh-mhn-compose-insertion}) command. You are 3249@end smalllisp
1334prompted for the filename containing the object, the content type, and a 3250
1335content description of the object. 3251@cindex @command{folder}
3252@cindex @command{refile}
3253@cindex MH commands, @command{folder}
3254@cindex MH commands, @command{refile}
3255@findex mh-refile-msg
3256@kindex o
3257@vindex mh-refile-msg-hook
3258
3259MH-E has analogies for each of the MH @command{folder} and
3260@command{refile} commands@footnote{See the sections
3261@uref{@value{MH-BOOK-HOME}/fol.htm#Youfol, Your Current Folder:
3262folder} and @uref{@value{MH-BOOK-HOME}/fol.htm#Movref, Moving and
3263Linking Messages: refile} in the MH book.}. To refile a message in
3264another folder, use the command @kbd{o} (@code{mh-refile-msg})
3265(mnemonic: ``output''). You are prompted for the folder name
3266(@pxref{Folder Selection}). Note that this command can also be used to
3267create folders. If you specify a folder that does not exist, you will
3268be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3269after a message is marked to be refiled.
1336 3270
1337@node Sending MIME, , Other MIME Objects, Editing MIME 3271If you are refiling several messages into the same folder, you can use
1338@subsubsection Readying multimedia messages for sending 3272the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3273last refile or write (see the description of @kbd{>}
3274(@code{mh-write-msg-to-file} in @ref{Files and Pipes}). You can use a
3275range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3276@key{RET}}, @pxref{Ranges}).
1339 3277
1340When you are finished editing a @sc{mime} message, it might look like this: 3278@cindex expunging refiles and deletes
3279@cindex undoing refiles and deletes
1341 3280
1342@example 3281If you've deleted a message or refiled it, but changed your mind, you
1343@group 3282can cancel the action before you've executed it. Use @kbd{u}
1344@cartouche 3283(@code{mh-undo}) to undo a refile on or deletion of a single message.
1345 3 24Aug root received fax files on Wed Aug 24 11:00:13 3284You can also undo refiles and deletes for messages that are found in a
1346 4+ 24Aug To:wohler Test<<This is a test message to get the wh 3285given range (@pxref{Ranges}).
1347 3286
3287Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3288all refiles and deletes in the current folder.
1348 3289
3290If you've marked messages to be deleted or refiled and you want to go
3291ahead and delete or refile the messages, use @kbd{x}
3292(@code{mh-execute-commands}). Many MH-E commands that may affect the
3293numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3294you want to process refiles or deletes first and then either run
3295@kbd{x} for you or undo the pending refiles and deletes, which are
3296lost.
3297
3298The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3299before the commands are processed and
3300@code{mh-after-commands-processed-hook} after the commands are
3301processed. Variables that are useful with the former hook include
3302@code{mh-delete-list} and @code{mh-refile-list} which can be used to
3303see which changes will be made to the current folder,
3304@code{mh-current-folder}. Variables that are useful with the latter
3305hook include @code{mh-folders-changed}, which lists which folders were
3306affected by deletes and refiles. This list will always include the
3307current folder @code{mh-current-folder}.
3308
3309If you wish to copy a message to another folder, you can use the
3310command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3311to @command{refile}(1)). Like the command @kbd{o}, this command
3312prompts you for the name of the target folder and you can specify a
3313range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3314takes place immediately. The original copy remains in the current
3315folder.
1349 3316
3317@cindex MH-Folder Show mode
3318@cindex MH-Folder mode
3319@cindex junk mail
3320@cindex modes, MH-Folder
3321@cindex modes, MH-Folder Show
3322@cindex spam
1350 3323
3324The command @kbd{t} (@code{mh-toggle-showing}) switches between
3325MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3326this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3327the associated show buffer so that you can perform operations on the
3328messages quickly without reading them. This is an excellent way to
3329prune out your junk mail or to refile a group of messages to another
3330folder for later examination.
1351 3331
1352--%%-@{+inbox@} 4 msgs (1-4) (MH-Folder Show)--Bot------------------- 3332@cindex MH-Folder mode
1353To: wohler 3333@cindex MH-Show mode
1354cc: 3334@cindex modes, MH-Folder
1355Subject: Test of MIME 3335@cindex modes, MH-Show
1356-------- 3336@cindex moving between messages
1357#@@application/octet-stream [Nonexistent ftp test file] \ 3337@vindex mh-recenter-summary-flag
1358access-type=anon-ftp; site=berzerk.com; name=panacea.tar.gz; \
1359directory="/pub/"
1360#audio/basic [Test sound bite] /tmp/noise.au
1361--**-@{draft@} (MH-Letter)--All--------------------------------------
1362 3338
1363@end cartouche 3339When you use @kbd{t} to toggle between show mode and scan mode, the
1364@i{mh-e @sc{mime} draft} 3340MH-Show buffer is hidden and the MH-Folder buffer is left alone.
1365@end group 3341Setting @code{mh-recenter-summary-flag} to a non-@code{nil} value
1366@end example 3342causes the toggle to display as many scan lines as possible, with the
3343cursor at the middle. The effect of @code{mh-recenter-summary-flag} is
3344rather useful, but it can be annoying on a slow network connection.
1367 3345
1368@cindex @code{mhn} 3346When you want to read the messages that you have refiled into folders,
1369@cindex MH commands, @code{mhn} 3347use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
1370@findex @code{mh-edit-mhn} 3348folder. You are prompted for the folder name. The folder buffer will
3349show just unseen messages if there are any; otherwise, it will show
3350all the messages in the buffer as long there are fewer than
3351@code{mh-large-folder} messages. If there are more, then you are
3352prompted for a range of messages to scan. You can provide a prefix
3353argument in order to specify a range of messages to show when you
3354visit the folder (@pxref{Ranges}). In this case, regions are not used
3355to specify the range and @code{mh-large-folder} is ignored. Note that
3356this command can also be used to create folders. If you specify a
3357folder that does not exist, you will be prompted to create it.
3358
3359If you forget where you've refiled your messages, you can find them
3360using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3361
3362@cindex @command{procmail}
3363@cindex @command{rcvstore}
3364@cindex @samp{unseen} sequence
3365@cindex MH commands, @command{rcvstore}
3366@cindex Unix commands, @command{procmail}
3367@cindex sequence, @samp{unseen}
3368@cindex unseen messages, viewing
3369@findex mh-index-new-messages
3370@kindex F n
3371@vindex mh-new-messages-folders
3372
3373If you use a program such as @command{procmail} to use
3374@command{rcvstore} to file your incoming mail automatically, you can
3375display new, unseen, messages using the command @kbd{F n}
3376(@code{mh-index-new-messages}). All messages in the @samp{unseen}
3377sequence from the folders in @code{mh-new-messages-folders} are
3378listed. However, this list of folders can be overridden with a prefix
3379argument: with a prefix argument, enter a space-separated list of
3380folders, or nothing to search all folders.
3381
3382@cindex @samp{tick} sequence
3383@cindex sequence, @samp{tick}
3384@cindex ticked messages, viewing
3385
3386If you have ticked messages (@pxref{Sequences}), you can display them
3387using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3388messages in the @samp{tick} sequence from the folders in
3389@code{mh-ticked-messages-folders} are listed. With a prefix argument,
3390enter a space-separated list of folders, or nothing to search all
3391folders.
3392
3393@findex mh-index-sequenced-messages
3394@kindex F q
3395@vindex mh-new-messages-folders
3396
3397You can display messages in any sequence with the command @kbd{F q}
3398(@code{mh-index-sequenced-messages}). All messages from the folders in
3399@code{mh-new-messages-folders} in the sequence you provide are listed.
3400With a prefix argument, enter a space-separated list of folders at the
3401prompt, or nothing to search all folders.
3402
3403Set the options @code{mh-new-messages-folders} and
3404@code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3405@samp{+inbox} folder or @samp{All} to search all of the top level
3406folders. Otherwise, list the folders that should be searched with the
3407@samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3408
3409@cindex @samp{*MH-E Folders*}
3410@cindex buffers, @samp{*MH-E Folders*}
3411
3412Other commands you can perform on folders include: @kbd{F l}
3413(@code{mh-list-folders}), to place a listing of all the folders in
3414your mail directory in a buffer called @samp{*MH-E Folders*}
3415(@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3416a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3417date (see @command{sortm}(1) to see how to sort by other criteria);
3418@kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3419from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3420to rescan the folder, which is useful to grab all messages in your
3421@samp{+inbox} after processing your new mail for the first time. If
3422you don't want to rescan the entire folder, the commands @kbd{F r} or
3423@kbd{F p} will accept a range (@pxref{Ranges}).
3424
3425By default, operations on folders work only one level at a time. Set
3426@code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3427folders. This mostly means that you'll be able to see all your folders
3428when you press @key{TAB} when prompted for a folder name.
3429
3430@vindex mh-kill-folder-suppress-prompt-hooks
3431
3432The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
3433hook run at the beginning of the command @kbd{k}. The hook functions
3434are called with no arguments and should return a non-nil value to
3435suppress the normal prompt when you remove a folder. This is useful
3436for folders that are easily regenerated. The default value of
3437@code{mh-search-p} suppresses the prompt on folders generated by
3438searching.
3439
3440@sp 1
3441@center @strong{NOTE}
1371 3442
1372The lines added by the previous commands are @code{mhn} directives and 3443@quotation
1373need to be converted to @sc{mime} directives before sending. This is 3444Use this hook with care. If there is a bug in your hook which returns
1374accomplished by the command @kbd{C-c C-e} (@code{mh-edit-mhn}), which 3445@code{t} on @samp{+inbox} and you hit @kbd{k} by accident in the
1375runs @code{mhn} on the message. The following screen shows what those 3446@code{+inbox} folder, you will not be happy.
1376commands look like in full @sc{mime} format. You can see why mail user 3447@end quotation
1377agents are usually built to hide these details from the user. 3448@sp 1
1378 3449
1379@example 3450@cindex @command{sortm}
1380@group 3451@cindex @file{.mh_profile}
1381@cartouche 3452@cindex @samp{sortm:} MH profile component
1382To: wohler 3453@cindex MH commands, @command{sortm}
1383cc: 3454@cindex MH profile component, @samp{sortm:}
1384Subject: Test of MIME 3455@cindex files, @file{.mh_profile}
1385MIME-Version: 1.0
1386Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
1387Content-ID: <1623.777796162.0@@newt.com>
1388 3456
1389------- =_aaaaaaaaaa0 3457The option @code{mh-sortm-args} holds extra arguments to pass on to
1390Content-Type: message/external-body; access-type="anon-ftp"; 3458the command @command{sortm}@footnote{See the section
1391 site="berzerk.com"; name="panacea.tar.gz"; directory="/pub/" 3459@uref{@value{MH-BOOK-HOME}/sorsor.htm, Sorting Messages: sortm} in the
3460MH book.} when a prefix argument is used with @kbd{F S}. Normally
3461default arguments to @command{sortm} are specified in the MH profile.
3462This option may be used to provide an alternate view. For example,
3463@samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
1392 3464
1393Content-Type: application/octet-stream 3465@cindex exiting
1394Content-ID: <1623.777796162.1@@newt.com> 3466@cindex quitting
1395Content-Description: Nonexistent ftp test file 3467@findex mh-rmail
3468
3469When you want to quit using MH-E and go back to editing, you can use
3470the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3471current MH-E folder and restores the buffers that were present when
3472you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3473buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3474(@pxref{Miscellaneous}). You can later restore your MH-E session by
3475selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3476again.
1396 3477
1397------- =_aaaaaaaaaa0 3478@vindex mh-before-quit-hook
1398Content-Type: audio/basic 3479@vindex mh-quit-hook
1399Content-ID: <1623.777796162.2@@newt.com>
1400Content-Description: Test sound bite
1401Content-Transfer-Encoding: base64
1402 3480
1403Q3JlYXRpdmUgVm9pY2UgRmlsZRoaAAoBKREBQh8AgwCAgH9/f35+fn59fX5+fn5+f39/f39/f3 3481The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
1404f4B/f39/f39/f39/f39/f39+f39+f39/f39/f4B/f39/fn5/f39/f3+Af39/f39/gH9/f39/fn 3482called by @kbd{q} (@code{mh-quit}). The former one is called before
1405-----@{draft@} (MH-Letter)--Top-------------------------------------- 3483the quit occurs, so you might use it to perform any MH-E operations;
3484you could perform some query and abort the quit or call
3485@code{mh-execute-commands}, for example. The latter is not run in an
3486MH-E context, so you might use it to modify the window setup. For
3487example, if the window configuration was saved as in the example in
3488@ref{Miscellaneous Commands and Options}, you would also want to set
3489@code{mh-quit-hook} to the following:
1406 3490
1407@end cartouche 3491@c XXX Replace this with my example for killing the mail buffers.
1408@i{mh-e @sc{mime} draft ready to send}
1409@end group
1410@end example
1411 3492
1412@findex @code{mh-revert-mhn-edit} 3493@vindex mh-quit-hook, example
1413 3494
1414This action can be undone by running @kbd{C-c C-m C-u} 3495@smalllisp
1415(@code{mh-revert-mhn-edit}). It does this by reverting to a backup 3496@group
1416file. You are prompted to confirm this action, but you can avoid the 3497(defun my-mh-quit-hook ()
1417confirmation by adding an argument (for example, @kbd{C-u C-c C-m C-u}). 3498 "Clear window configuration variables as the MH window is gone."
3499 (setq my-mh-screen-saved nil)
3500 (setq my-mh-screen nil)
3501 (if my-normal-screen
3502 (set-window-configuration my-normal-screen))
3503 (setq my-normal-screen nil))
3504
3505@i{Clean up window setup in mh-quit-hook}
3506@end group
3507@end smalllisp
1418 3508
1419@node Sending Message, Killing Draft, Editing MIME, Draft Editing 3509@cindex folders, renaming
1420@subsection Sending a Message 3510@cindex renaming folders
3511@findex dired-do-rename
3512@kindex R
1421 3513
1422@cindex sending mail 3514You can use dired to manipulate the folders themselves. For example, I
1423@findex @code{mh-send-letter} 3515renamed my @samp{+out} folder to the more common @samp{+outbox} by
3516running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3517moving my cursor to @samp{out} and using the command @kbd{R}
3518(@code{dired-do-rename}).
1424 3519
1425When you are all through editing a message, you send it with the 3520@node Sending Mail, Editing Drafts, Folders, Top
1426@kbd{C-c C-c} (@code{mh-send-letter}) command. You can give an argument 3521@chapter Sending Mail
1427(as in @kbd{C-u C-c C-c}) to monitor the first stage of the delivery.
1428 3522
1429@node Killing Draft, , Sending Message, Draft Editing 3523@cindex sending mail
1430@subsection Killing the Draft 3524@findex mh-smail
1431 3525
1432@cindex killing draft 3526You can send a mail message in several ways. You can call @kbd{M-x
1433@findex @code{mh-fully-kill-draft} 3527mh-smail} directly, or from the command line like this:
1434 3528
1435If for some reason you are not happy with the draft, you can kill it 3529@cindex starting from command line
1436instead with @kbd{C-c C-q} (@code{mh-fully-kill-draft}). Emacs then
1437kills the draft buffer and deletes the draft message.
1438 3530
1439@node Moving Mail, Searching, Draft Editing, Using mh-e 3531@example
1440@section Moving Your Mail Around 3532$ @kbd{emacs -f mh-smail}
3533@end example
1441 3534
1442@cindex processing mail 3535@findex goto-address-at-point
3536@vindex mail-user-agent
1443 3537
1444This section covers how messages and folders can be moved about or 3538There are some commands that need to send a mail message, such as
1445manipulated. Messages may be incorporated into your @file{+inbox}, 3539@code{goto-address-at-point}. You can configure Emacs to have these
1446deleted, and refiled. Messages containing @code{shar} or 3540commands use MH-E by setting the option @code{mail-user-agent} to
1447@code{uuencode} output can be stored. Folders can be visited, sorted, 3541@samp{Emacs interface to MH}.
1448packed, or deleted. Here's a list of the available commands to do these
1449things:
1450 3542
1451@c Stephen thinks that ? should be documented here, since it also shows 3543From within MH-E's MH-Folder mode, other methods of sending mail are
1452@c which folders a message will be refiled to. XXX 3544available as well. These can also be found in the @samp{Message} menu.
1453 3545
1454@table @kbd 3546@table @kbd
1455@item i 3547@cindex @samp{Message > Edit Message Again} menu item
1456Incorporate new mail into folder (@code{mh-inc-folder}). 3548@cindex menu item, @samp{Message > Edit Message Again}
3549@kindex e
3550@findex mh-edit-again
3551@item e
3552Edit a message to send it again (@code{mh-edit-again}).
3553@c -------------------------
3554@cindex @samp{Message > Re-edit a Bounced Message} menu item
3555@cindex menu item, @samp{Message > Re-edit a Bounced Message}
3556@kindex E
3557@findex mh-extract-rejected-mail
3558@item E
3559Edit a message that was returned by the mail system
3560(@code{mh-extract-rejected-mail}).
3561@c -------------------------
3562@cindex @samp{Message > Forward Message...} menu item
3563@cindex menu item, @samp{Message > Forward Message...}
3564@kindex f
3565@findex mh-forward
3566@item f
3567Forward message (@code{mh-forward}).
3568@c -------------------------
3569@cindex @samp{Message > Reply to Message...} menu item
3570@cindex menu item, @samp{Message > Reply to Message...}
3571@kindex r
3572@findex mh-reply
3573@item r
3574Reply to a message (@code{mh-reply}).
3575@c -------------------------
3576@cindex @samp{Message > Compose a New Message} menu item
3577@cindex menu item, @samp{Message > Compose a New Message}
3578@kindex s
3579@findex mh-send
3580@item s
3581Compose a message (@code{mh-send}).
3582@c -------------------------
3583@cindex @samp{Message > Redistribute Message...} menu item
3584@cindex menu item, @samp{Message > Redistribute Message...}
3585@kindex M-d
3586@findex mh-redistribute
3587@item M-d
3588Redistribute a message (@code{mh-redistribute}).
3589@c -------------------------
3590@findex mh-smail
3591@item M-x mh-smail
3592Compose a message with the MH mail system.
3593@c -------------------------
3594@findex mh-smail-other-window
3595@item M-x mh-smail-other-window
3596Compose a message with the MH mail system in other window.
3597@end table
1457 3598
1458@item d 3599@cindex @samp{mh-sending-mail} customization group
1459Delete message (@code{mh-delete-msg}). 3600@cindex customization group, @samp{mh-sending-mail}
1460 3601
1461@item C-d 3602In addition, several options from the @samp{mh-sending-mail}
1462Delete message, don't move to next message (@code{mh-delete-msg-no-motion}). 3603customization group are useful when sending mail or replying to mail.
3604They are summarized in the following table.
1463 3605
1464@item M-s 3606@vtable @code
1465Find messages that meet search criteria (@code{mh-search-folder}). 3607@item mh-compose-forward-as-mime-flag
3608On means that messages are forwarded as attachments (default:
3609@samp{on}).
3610@c -------------------------
3611@item mh-compose-letter-function
3612Hook run when starting a new draft (default: @code{nil}).
3613@c -------------------------
3614@item mh-compose-prompt-flag
3615On means prompt for header fields when composing a new draft (default:
3616@samp{off}).
3617@c -------------------------
3618@item mh-forward-subject-format
3619Format string for forwarded message subject (default: @samp{"%s:
3620%s"}).
3621@c -------------------------
3622@item mh-insert-x-mailer-flag
3623On means append an @samp{X-Mailer:} header field to the header
3624(default: @samp{on}).
3625@c -------------------------
3626@item mh-redist-full-contents-flag
3627On means the @command{dist} command needs entire letter for
3628redistribution (default: @samp{off}).
3629@c -------------------------
3630@item mh-reply-default-reply-to
3631Sets the person or persons to whom a reply will be sent (default:
3632@samp{Prompt}).
3633@c -------------------------
3634@item mh-reply-show-message-flag
3635On means the MH-Show buffer is displayed using @kbd{r}
3636(@code{mh-reply}) (default: @samp{on}).
3637@end vtable
3638
3639The following hooks are available.
3640
3641@vtable @code
3642@item mh-forward-hook
3643Hook run by @code{mh-forward} on a forwarded letter (default:
3644@code{nil}).
3645@c -------------------------
3646@item mh-letter-mode-hook
3647Hook run by @code{mh-letter-mode} on a new letter (default:
3648@code{nil}).
3649@end vtable
1466 3650
1467@item o 3651The functions and options introduced here are explained in more detail
1468Output (refile) message to folder (@code{mh-refile-msg}). 3652in the following sections.
1469 3653
1470@item c 3654@menu
1471Copy message to folder (@code{mh-copy-msg}). 3655* Composing::
3656* Replying::
3657* Forwarding::
3658* Redistributing::
3659* Editing Again::
3660@end menu
1472 3661
1473@item C-o 3662@node Composing, Replying, Sending Mail, Sending Mail
1474Output (write) message to file (@code{mh-write-msg-to-file}). 3663@section Composing
1475 3664
1476@item ! 3665@cindex @file{.emacs}
1477Repeat last output command (@code{mh-refile-or-write-again}). 3666@cindex MH-Folder mode
3667@cindex composing mail
3668@cindex draft
3669@cindex files, @file{.emacs}
3670@cindex modes, MH-Folder
3671@cindex sending mail
3672@findex mh-smail
3673@findex mh-smail-other-window
1478 3674
1479@item l 3675Outside of an MH-Folder buffer, you must call either @kbd{M-x
1480Print message with @code{lpr} (@code{mh-print-msg}). 3676mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
3677The former command always creates a two-window layout with the current
3678buffer on top and the draft on the bottom. Use the latter command if
3679you would rather preserve the window layout. You may find adding the
3680following key bindings to @file{~/.emacs} useful:
1481 3681
1482@item | 3682@smalllisp
1483Pipe message through shell command (@code{mh-pipe-msg}). 3683(global-set-key "\C-xm" 'mh-smail)
3684(global-set-key "\C-x4m" 'mh-smail-other-window)
3685@end smalllisp
1484 3686
1485@item M-n 3687@cindex MH-Letter mode
1486Unpack message created with @code{uudecode} or @code{shar} 3688@cindex draft folder
1487(@code{mh-store-msg}). 3689@cindex modes, MH-Letter
3690@findex mh-send
3691@kindex m
1488 3692
1489@item M-l 3693From within a MH-Folder buffer, you can simply use the command @kbd{m}
1490List all folders (@code{mh-list-folders}). 3694(@code{mh-send}). However you invoke @code{mh-send}, your letter
3695appears in an Emacs buffer whose mode is MH-Letter (see the Figure in
3696@ref{Sending Mail Tour} to see what the buffer looks like). MH-Letter
3697mode allows you to edit your message, to check the validity of the
3698recipients, to insert attachments and other messages into your
3699message, and to send the message. We'll go more into depth about
3700editing a @dfn{draft}@footnote{I highly recommend that you use a
3701@dfn{draft folder} so that you can edit several drafts in parallel. To
3702do so, create a folder named @samp{+drafts} for example, and add the
3703profile component @samp{Draft-Folder: drafts} (see
3704@code{mh-profile}(5)).} (a message you're composing) in just a moment
3705(@pxref{Editing Drafts}).
3706
3707@vindex mh-compose-prompt-flag
3708
3709If you prefer to be prompted for the recipient and subject fields
3710before the MH-Letter buffer appears, turn on the option
3711@code{mh-compose-prompt-flag}.
3712
3713@cindex @samp{X-Mailer:} header field
3714@cindex header field, @samp{X-Mailer:}
3715@vindex mh-insert-x-mailer-flag
3716
3717MH-E adds an @samp{X-Mailer:} header field to the header that includes
3718the version of MH-E and Emacs that you are using. If you don't want to
3719participate in our marketing, you can turn off the option
3720@code{mh-insert-x-mailer-flag}.
3721
3722@cindex @command{repl}
3723@cindex @file{components}
3724@cindex MH commands, @command{repl}
3725@cindex Mail mode
3726@cindex files, @file{components}
3727@cindex modes, Mail
3728@vindex mail-mode-hook
3729@vindex mh-letter-mode-hook
3730@vindex text-mode-hook
1491 3731
1492@item M-f 3732Two hooks are provided to run commands on your freshly created draft.
1493Visit folder (@code{mh-visit-folder}). 3733The first hook, @code{mh-letter-mode-hook}, allows you to do some
3734processing before editing a letter@footnote{Actually, because
3735MH-Letter mode inherits from Mail mode, the hooks
3736@code{text-mode-hook} and @code{mail-mode-hook} are run (in that
3737order) before @code{mh-letter-mode-hook}.}. For example, you may wish
3738to modify the header after @command{repl} has done its work, or you
3739may have a complicated @file{components} file and need to tell MH-E
3740where the cursor should go. Here's an example of how you would use
3741this hook. You can add the hook using @code{add-hook} or by running
3742@kbd{M-x customize-option @key{RET} mh-letter-mode-hook
3743@key{RET}}---all of the other hooks are set in a similar fashion.
3744
3745@findex mh-insert-signature, example
3746
3747@smalllisp
3748@group
3749(defvar letter-mode-init-done-flag nil
3750 "Non-nil means one-time MH-E settings have been made.")
1494 3751
1495@item M-r 3752(defun my-mh-letter-mode-hook ()
1496Regenerate scan lines (@code{mh-rescan-folder}). 3753 "Prepare letter for editing."
3754 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
3755 (local-set-key "\C-ctb" 'add-enriched-text)
3756 (local-set-key "\C-cti" 'add-enriched-text)
3757 (local-set-key "\C-ctf" 'add-enriched-text)
3758 (local-set-key "\C-cts" 'add-enriched-text)
3759 (local-set-key "\C-ctB" 'add-enriched-text)
3760 (local-set-key "\C-ctu" 'add-enriched-text)
3761 (local-set-key "\C-ctc" 'add-enriched-text)
3762 (setq letter-mode-init-done t))
3763 (save-excursion
3764 (goto-char (point-max)) ; @r{go to end of message to}
3765 (mh-insert-signature))) ; @r{insert signature}
1497 3766
1498@item M-x mh-sort-folder 3767(add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
1499Sort folder.
1500 3768
1501@item M-p 3769@i{Prepare draft for editing via mh-letter-mode-hook}
1502Pack folder (@code{mh-pack-folder}).
1503 3770
1504@item M-k 3771@end group
1505Remove folder (@code{mh-kill-folder}). 3772@end smalllisp
1506 3773
1507@item x 3774The function, @code{add-enriched-text} is defined in the example in
1508Execute pending refiles and deletes (@code{mh-execute-commands}). 3775@ref{Adding Attachments}.
1509 3776
1510@item u 3777@vindex mh-compose-letter-function
1511Undo pending refile or delete (@code{mh-undo}).
1512 3778
1513@item M-u 3779The second hook, a function really, is
1514Undo all pending refiles and deletes (@code{mh-undo-folder}). 3780@code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
3781is called just before editing a new message; however, it is the last
3782function called before you edit your message. The consequence of this
3783is that you can write a function to write and send the message for
3784you. This function is passed three arguments: the contents of the
3785@samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
1515 3786
1516@item q 3787@node Replying, Forwarding, Composing, Sending Mail
1517Quit (@code{mh-quit}). 3788@section Replying to Mail
1518@end table
1519 3789
1520@menu 3790@cindex @command{mhl}
1521* Incorporating:: 3791@cindex @file{mhl.reply}
1522* Deleting:: 3792@cindex MH commands, @command{mhl}
1523* Organizing:: 3793@cindex files, @file{mhl.reply}
1524* Printing:: 3794@cindex replying
1525* Files and Pipes:: 3795@findex mh-reply
1526* Finishing Up:: 3796@kindex r
1527@end menu
1528 3797
1529@node Incorporating, Deleting, Moving Mail, Moving Mail 3798To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
1530@subsection Incorporating Your Mail 3799command.
1531 3800
1532@cindex incorporating 3801When you reply to a message, you are first prompted with @samp{Reply
1533@findex @code{mh-inc-folder} 3802to whom?}. You have several choices here.
1534 3803
1535If at any time you receive new mail, incorporate the new mail into your 3804@smallexample
1536@samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note that 3805@group
1537@kbd{i} will display the @samp{+inbox} buffer, even if there isn't any 3806@b{Response} @b{Reply Goes To}
1538new mail. You can incorporate mail from any file into the current
1539folder by specifying a prefix argument; you'll be prompted for the name
1540of the file to use (for example, @kbd{C-u i ~/mbox @key{RET}}).
1541 3807
1542@cindex Emacs, notification of new mail 3808@kbd{from} @r{The person who sent the message. This is the default,}
1543@cindex notification of new mail 3809 @r{so @key{RET} is sufficient.}
1544@cindex new mail
1545@cindex @file{.emacs}
1546@cindex files, @file{.emacs}
1547 3810
1548Emacs can notify you when you have new mail by displaying @samp{Mail} in 3811@kbd{to} @r{Replies to the sender, plus all recipients in the}
1549the mode line. To enable this behavior, and to have a clock in the mode 3812 @r{@samp{To:} header field.}
1550line besides, add the following to @file{~/.emacs}:
1551 3813
1552@findex @code{display-time} 3814@kbd{all}
3815@kbd{cc} @r{Forms a reply to the sender, plus all recipients.}
3816@end group
3817@end smallexample
1553 3818
1554@lisp 3819@cindex @command{repl}
1555(display-time) 3820@cindex MH commands, @command{repl}
1556@end lisp
1557 3821
1558@node Deleting, Organizing, Incorporating, Moving Mail 3822Depending on your answer, @command{repl}@footnote{See the section
1559@subsection Deleting Your Mail 3823@uref{@value{MH-BOOK-HOME}/reprep.htm, Replying to Messages: repl} in
3824the MH book.} is given a different argument to form your reply.
3825Specifically, a choice of @kbd{from} or none at all runs @samp{repl
3826-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
3827either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}.
1560 3828
1561@cindex deleting 3829@cindex MH-Letter mode
1562@findex @code{mh-delete-msg} 3830@cindex MH-Show mode
1563@findex @code{mh-delete-msg-no-motion} 3831@cindex draft
3832@cindex modes, MH-Letter
3833@cindex modes, MH-Show
1564 3834
1565To mark a message for deletion, use the @kbd{d} (@code{mh-delete-msg}) 3835Two windows are then created. One window contains the message to which
1566command. A @samp{D} is placed by the message in the scan window, and 3836you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
1567the next message is displayed. If the previous command had been 3837(@pxref{Editing Drafts}), is in the other window.
1568@kbd{p}, then the next message displayed is the message previous to the
1569message just deleted. If you specify a prefix argument, you will be
1570prompted for a sequence (@pxref{Sequences}) to delete (for example,
1571@kbd{C-u d frombob RET}). The @kbd{x} command actually carries out the
1572deletion (@pxref{Finishing Up}). @kbd{C-d}
1573(@code{mh-delete-msg-no-motion}) marks the message for deletion but
1574leaves the cursor at the current message in case you wish to perform
1575other operations on the message.
1576 3838
1577@node Organizing, Printing, Deleting, Moving Mail 3839If you supply a prefix argument (as in @kbd{C-u r}), the message you
1578@subsection Organizing Your Mail with Folders 3840are replying to is inserted in your reply after having first been run
3841through @command{mhl} with the format file @file{mhl.reply}. See
3842@command{mhl}(1) or the section
3843@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
3844book to see how you can modify the default @file{mhl.reply} file.
1579 3845
1580@cindex using folders 3846@vindex mh-yank-behavior
1581@cindex @code{folder}
1582@cindex MH commands, @code{folder}
1583@cindex @code{refile}
1584@cindex MH commands, @code{refile}
1585@findex @code{mh-refile-msg}
1586 3847
1587mh-e has analogies for each of the MH @code{folder} and @code{refile} 3848Alternatively, you can customize the option @code{mh-yank-behavior}
1588commands. To refile a message in another folder, use the @kbd{o} 3849and choose one of its @samp{Automatically} variants to do the same
1589(@code{mh-refile-msg}) (mnemonic: ``output'') command. You are prompted 3850thing. @xref{Inserting Letter}. If you do so, the prefix argument has
1590for the folder name. 3851no effect.
1591 3852
1592@findex @code{mh-refile-or-write-again} 3853Another way to include the message automatically in your draft is to
3854use @samp{repl: -filter repl.filter} in your MH profile.
1593 3855
1594If you are refiling several messages into the same folder, you can use 3856If you include the message automatically, you can hide the MH-Show
1595the @kbd{!} (@code{mh-refile-or-write-again}) command to repeat the last 3857buffer by turning off the option @code{mh-reply-show-message-flag}.
1596refile or write (see the description of @kbd{C-o} in @ref{Files and
1597Pipes}). Or, place the messages into a sequence (@ref{Sequences}) and
1598specify a prefix argument to @kbd{o}, in which case you'll be prompted
1599for the name of the sequence (for example, @kbd{C-u o search RET}).
1600 3858
1601@findex @code{mh-copy-msg} 3859If you wish to customize the header or other parts of the reply draft,
3860please see @command{repl}(1) and @code{mh-format}(5).
1602 3861
1603If you wish to copy a message to another folder, you can use the @kbd{c} 3862@vindex mh-reply-default-reply-to
1604(@code{mh-copy-msg}) command (see the @code{-link} argument to
1605@code{refile}(1)). You are prompted for a folder, and you can specify a
1606prefix argument if you want to copy a sequence into another folder. In
1607this case, you are then prompted for the sequence. Note that unlike the
1608@kbd{o} command, the copy takes place immediately. The original copy
1609remains in the current folder.
1610 3863
1611@findex @code{mh-visit-folder} 3864The @code{mh-reply-default-reply-to} option is set to @samp{Prompt} by
3865default so that you are prompted for the recipient of a reply. If you
3866find that most of the time that you specify @kbd{cc} when you reply to
3867a message, set this option to @samp{cc}. Other choices include
3868@samp{from}, @samp{to}, or @samp{all}. You can always edit the
3869recipients in the draft.
1612 3870
1613When you want to read the messages that you have refiled into folders, 3871@node Forwarding, Redistributing, Replying, Sending Mail
1614use the @kbd{M-f} (@code{mh-visit-folder}) command to visit the folder. 3872@section Forwarding Mail
1615You are prompted for the folder name.
1616
1617@findex @code{mh-list-folders}
1618@findex @code{mh-kill-folder}
1619@findex @code{mh-visit-folder}
1620@findex @code{mh-sort-folder}
1621@findex @code{mh-pack-folder}
1622@findex @code{mh-rescan-folder}
1623
1624Other commands you can perform on folders include: @kbd{M-l}
1625(@code{mh-list-folders}), to list all the folders in your mail
1626directory; @kbd{M-k} (@code{mh-kill-folder}), to remove a folder;
1627@kbd{M-x mh-sort-folder}, to sort the messages by date (see
1628@code{sortm}(1) to see how to sort by other criteria); @kbd{M-p}
1629(@code{mh-pack-folder}), to pack a folder, removing gaps from the
1630numbering sequence; and @kbd{M-r} (@code{mh-rescan-folder}), to rescan
1631the folder, which is useful to grab all messages in your @file{+inbox}
1632after processing your new mail for the first time. If you don't want to
1633rescan the entire folder, give @kbd{M-r} or @kbd{M-p} a prefix argument
1634and you'll be prompted for a range of messages to display (for instance,
1635@kbd{C-u M-r last:50 RET}).
1636
1637@node Printing, Files and Pipes, Organizing, Moving Mail
1638@subsection Printing Your Mail
1639 3873
1640@cindex printing 3874@cindex @command{forw}
1641@cindex @code{mhl} 3875@cindex MH commands, @command{forw}
1642@cindex MH commands, @code{mhl} 3876@cindex draft
1643@cindex @code{lpr} 3877@cindex forwarding
1644@cindex Unix commands, @code{lpr} 3878@findex mh-forward
1645@findex @code{mh-print-msg} 3879@kindex f
1646 3880@vindex mh-forward-hook
1647Printing mail is simple. Enter @kbd{l} (@code{mh-print-msg}) (for 3881
1648@i{l}ine printer or @i{l}pr). The message is formatted with @code{mhl} 3882To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
1649and printed with the @code{lpr} command. You can print all the messages 3883are prompted for the @samp{To:} and @samp{cc:} recipients. You are
1650in a sequence by specifying a prefix argument, in which case you are 3884given a draft to edit that looks like it would if you had run the MH
1651prompted for the name of the sequence (as in @kbd{C-u l frombob RET}). 3885command @command{forw}@footnote{See the section
1652 3886@uref{@value{MH-BOOK-HOME}/forfor.htm, Forwarding Messages: forw} in
1653@node Files and Pipes, Finishing Up, Printing, Moving Mail 3887the MH book.}. You can then add some text (@pxref{Editing Drafts}).
1654@subsection Files and Pipes 3888You can forward several messages by using a range (@pxref{Ranges}).
1655 3889All of the messages in the range are inserted into your draft. The
1656@cindex using files 3890hook @code{mh-forward-hook} is called on the draft.
1657@cindex using pipes
1658@findex @code{mh-write-msg-to-file}
1659
1660mh-e does offer a couple of commands that are not a part of MH@. The
1661first one, @kbd{C-o} (@code{mh-write-msg-to-file}), writes a message to
1662a file (think of the @kbd{o} as in "output"). You are prompted for the
1663filename. If the file already exists, the message is appended to it.
1664You can also write the message to the file without the header by
1665specifying a prefix argument (such as @kbd{C-u C-o /tmp/foobar RET}).
1666Subsequent writes to the same file can be made with the @kbd{!}
1667command.
1668 3891
1669@findex @code{mh-pipe-msg} 3892@cindex @file{.mh_profile}
3893@cindex @samp{forw:} MH profile component
3894@cindex MH profile component, @samp{forw:}
3895@cindex files, @file{.mh_profile}
3896@vindex mh-compose-forward-as-mime-flag
3897
3898By default, the option @code{mh-compose-forward-as-mime-flag} is on
3899which means that the forwarded messages are included as attachments.
3900If you would prefer to forward your messages verbatim (as text,
3901inline), then turn off this option. Forwarding messages verbatim works
3902well for short, textual messages, but your recipient won't be able to
3903view any non-textual attachments that were in the forwarded message.
3904Be aware that if you have @samp{forw: -mime} in your MH profile, then
3905forwarded messages will always be included as attachments regardless
3906of the settings of @code{mh-compose-forward-as-mime-flag}.
3907
3908@vindex mh-forward-subject-format
3909
3910The format of the @samp{Subject:} header field for forwarded messages
3911is controlled by the option @code{mh-forward-subject-format}. This
3912option is a string which includes two escapes (@samp{%s}). The first
3913@samp{%s} is replaced with the sender of the original message, and the
3914second one is replaced with the original @samp{Subject:}. The default
3915value of @samp{"%s: %s"} takes a message with the header:
1670 3916
1671You can also pipe the message through a Unix shell command with the 3917@smallexample
1672@kbd{|} (@code{mh-pipe-msg}) command. You are prompted for the 3918@group
1673Unix command through which you wish to run your message. If you 3919To: Bill Wohler <wohler@@stop.mail-abuse.org>
1674give an argument to this command, the message header is included in the 3920Subject: Re: 49er football
1675text passed to the command (the contrived example @kbd{C-u | lpr} 3921From: Greg DesBrisay <gd@@stop.mail-abuse.org>
1676would be done with the @kbd{l} command instead). 3922@end group
3923@end smallexample
1677 3924
1678@cindex @code{shar} 3925and creates a subject header field of:
1679@cindex Unix commands, @code{shar}
1680@cindex @code{uuencode}
1681@cindex Unix commands, @code{uuencode}
1682@findex @code{mh-store-msg}
1683 3926
1684If the message is a shell archive @code{shar} or has been run through 3927@smallexample
1685@code{uuencode} use @kbd{M-n} (@code{mh-store-msg}) to extract the body 3928Subject: Greg DesBrisay: Re: 49er football
1686of the message. The default directory for extraction is the current 3929@end smallexample
1687directory, and you have a chance to specify a different extraction
1688directory. The next time you use this command, the default directory is
1689the last directory you used.
1690 3930
1691@node Finishing Up, , Files and Pipes, Moving Mail 3931@node Redistributing, Editing Again, Forwarding, Sending Mail
1692@subsection Finishing Up 3932@section Redistributing Your Mail
1693 3933
1694@cindex expunging refiles and deletes 3934@cindex @command{dist}
1695@findex @code{mh-undo} 3935@cindex MH commands, @command{dist}
1696@findex @code{mh-undo-folder} 3936@cindex redistributing
3937@findex mh-redistribute
3938@kindex M-d
3939
3940The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
3941to forwarding mail, but it does not allow you to edit the message, nor
3942does it add your name to the @samp{From:} header field. It appears to
3943the recipient as if the message had come from the original sender.
3944When you run this command, you are prompted for the recipients.
3945
3946For more information on redistributing messages, see
3947@command{dist}(1). Also investigate the command @kbd{e}
3948(@code{mh-edit-again}) for another way to redistribute messages
3949(@pxref{Editing Again}).
3950
3951@cindex @command{send}
3952@cindex MH commands, @command{send}
3953@vindex mh-redist-full-contents-flag
3954
3955The option @code{mh-redist-full-contents-flag} must be turned on if
3956@command{dist}@footnote{See the section
3957@uref{@value{MH-BOOK-HOME}/disdis.htm, Distributing Messages with
3958dist} in the MH book.} requires the whole letter for redistribution,
3959which is the case if @command{send}@footnote{See the section
3960@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
3961in the MH book.} is compiled with the @sc{berk} option (which many
3962people abhor). If you find that MH will not allow you to redistribute
3963a message that has been redistributed before, turn off this option.
3964
3965@node Editing Again, , Redistributing, Sending Mail
3966@section Editing Old Drafts and Bounced Messages
1697 3967
1698If you've deleted a message or refiled it, but changed your mind, you 3968@cindex @file{draft}
1699can cancel the action before you've executed it. Use @kbd{u} 3969@cindex files, @file{draft}
1700(@code{mh-undo}) to undo a refile on or deletion of a single message. 3970@cindex re-editing drafts
1701You can also undo refiles and deletes for messages that belong to a 3971@findex mh-edit-again
1702given sequence by specifying a prefix argument. You'll be prompted for 3972@kindex e
1703the name of the sequence (as in @kbd{C-u u frombob RET}).
1704Alternatively, you can use @kbd{M-u} (@code{mh-undo-folder}) to undo all
1705refiles or deletes in the current folder.
1706 3973
1707@findex @code{mh-execute-commands} 3974If you don't complete a draft for one reason or another, and if the
3975draft buffer is no longer available, you can pick your draft up again
3976with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
3977folder, your last @file{draft} file will be used. If you use draft
3978folders, you'll need to visit the draft folder with @kbd{F v drafts
3979@key{RET}}, use @kbd{n} to move to the appropriate message, and then
3980use @kbd{e} to prepare the message for editing.
1708 3981
1709If you've marked messages to be deleted or refiled and you want to go 3982The @kbd{e} command can also be used to take messages that were sent
1710ahead and delete or refile the messages, use @kbd{x} 3983to you and to send them to more people.
1711(@code{mh-execute-commands}). Many mh-e commands that may affect the
1712numbering of the messages (such as @kbd{M-r} or @kbd{M-p}) will ask if you
1713want to process refiles or deletes first and then either run @kbd{x} for
1714you or undo the pending refiles and deletes, which are lost.
1715
1716@findex @code{mh-rmail}
1717@findex @code{mh-quit}
1718
1719When you want to quit using mh-e and go back to editing, you can use the
1720@kbd{q} (@code{mh-quit}) command. This buries the buffers of the
1721current mh-e folder and restores the buffers that were present when you
1722first ran @kbd{M-x mh-rmail}. You can later restore your mh-e session
1723by selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
1724again.
1725 3984
1726@node Searching, Sequences, Moving Mail, Using mh-e 3985@cindex Mailer-Daemon
1727@section Searching Through Messages 3986@findex mh-extract-rejected-mail
3987@kindex E
1728 3988
1729@cindex searching 3989Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
1730@findex @code{mh-search-folder} 3990complained that your mail wasn't posted for some reason or another. In
3991this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
3992the message for editing by removing the @i{Mailer-Daemon} envelope and
3993unneeded header fields. Fix whatever addressing problem you had, and
3994send the message again with @kbd{C-c C-c}.
1731 3995
1732You can search a folder for messages to or from a particular person or 3996@node Editing Drafts, Aliases, Sending Mail, Top
1733about a particular subject. In fact, you can also search for messages 3997@chapter Editing a Draft
1734containing selected strings in any arbitrary header field or any string
1735found within the messages. Use the @kbd{M-s} (@code{mh-search-folder})
1736command. You are first prompted for the name of the folder to search
1737and then placed in the following buffer in MH-Pick mode:
1738 3998
1739@example 3999@cindex MH-Letter mode
1740@group 4000@cindex draft
1741@cartouche 4001@cindex editing draft
1742From: # 4002@cindex modes, MH-Letter
1743To:
1744Cc:
1745Date:
1746Subject:
1747--------
1748 4003
4004When you edit a message that you want to send (called a @dfn{draft} in
4005this case), the mode used is MH-Letter. This mode provides several
4006commands in addition to the normal Emacs editing commands to help you
4007edit your draft. These can also be found in the @samp{Letter} menu.
1749 4008
4009@table @kbd
4010@kindex @key{SPC}
4011@findex mh-letter-complete-or-space
4012@item @key{SPC}
4013Perform completion or insert space (@code{mh-letter-complete-or-space}).
4014@c -------------------------
4015@kindex M-@key{TAB}
4016@findex mh-letter-complete
4017@item M-@key{TAB}
4018Perform completion on header field or word preceding point
4019(@code{mh-letter-complete}).
4020@c -------------------------
4021@kindex , (comma)
4022@findex mh-letter-confirm-address
4023@item , (comma)
4024Flash alias expansion (@code{mh-letter-confirm-address}).
4025@c -------------------------
4026@kindex @key{TAB}
4027@findex mh-letter-next-header-field-or-indent
4028@item @key{TAB}
4029Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4030@c -------------------------
4031@kindex S-@key{TAB}
4032@findex mh-letter-previous-header-field
4033@item S-@key{TAB}
4034Cycle to the previous header field
4035(@code{mh-letter-previous-header-field}).
4036@c -------------------------
4037@kindex C-c ?
4038@findex mh-help
4039@item C-c ?
4040Display cheat sheet for the MH-E commands (@code{mh-help}).
4041@c -------------------------
4042@cindex @samp{Letter > Send This Draft} menu item
4043@cindex menu item, @samp{Letter > Send This Draft}
4044@kindex C-c C-c
4045@findex mh-send-letter
4046@item C-c C-c
4047Save draft and send message (@code{mh-send-letter}).
4048@c -------------------------
4049@kindex C-c C-d
4050@findex mh-insert-identity
4051@item C-c C-d
4052Insert fields specified by the given identity
4053(@code{mh-insert-identity}). @xref{Identities}.
4054@c -------------------------
4055@cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4056@cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4057@kindex C-c C-e
4058@findex mh-mh-to-mime
4059@item C-c C-e
4060Compose @sc{mime} message from MH-style directives
4061(@code{mh-mh-to-mime}).
4062@c -------------------------
4063@kindex C-c C-f C-a
4064@kindex C-c C-f a
4065@findex mh-to-field
4066@item C-c C-f C-a
4067@itemx C-c C-f a
4068Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4069@c -------------------------
4070@kindex C-c C-f C-b
4071@kindex C-c C-f b
4072@item C-c C-f C-b
4073@itemx C-c C-f b
4074Move to @samp{Bcc:} header field (@code{mh-to-field}).
4075@c -------------------------
4076@kindex C-c C-f C-c
4077@kindex C-c C-f c
4078@item C-c C-f C-c
4079@itemx C-c C-f c
4080Move to @samp{Cc:} header field (@code{mh-to-field}).
4081@c -------------------------
4082@kindex C-c C-f C-d
4083@kindex C-c C-f d
4084@item C-c C-f C-d
4085@itemx C-c C-f d
4086Move to @samp{Dcc:} header field (@code{mh-to-field}).
4087@c -------------------------
4088@kindex C-c C-f C-f
4089@kindex C-c C-f f
4090@findex mh-to-fcc
4091@item C-c C-f C-f
4092@itemx C-c C-f f
4093Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4094@c -------------------------
4095@kindex C-c C-f C-l
4096@kindex C-c C-f l
4097@item C-c C-f C-l
4098@itemx C-c C-f l
4099Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4100@c -------------------------
4101@kindex C-c C-f C-m
4102@kindex C-c C-f m
4103@item C-c C-f C-m
4104@itemx C-c C-f m
4105Move to @samp{From:} header field (@code{mh-to-field}).
4106@c -------------------------
4107@kindex C-c C-f C-r
4108@kindex C-c C-f r
4109@item C-c C-f C-r
4110@itemx C-c C-f r
4111Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4112@c -------------------------
4113@kindex C-c C-f C-s
4114@kindex C-c C-f s
4115@item C-c C-f C-s
4116@itemx C-c C-f s
4117Move to @samp{Subject:} header field (@code{mh-to-field}).
4118@c -------------------------
4119@kindex C-c C-f C-t
4120@kindex C-c C-f t
4121@item C-c C-f C-t
4122@itemx C-c C-f t
4123Move to @samp{To:} header field (@code{mh-to-field}).
4124@c -------------------------
4125@cindex @samp{Letter > Insert a Message...} menu item
4126@cindex menu item, @samp{Letter > Insert a Message...}
4127@kindex C-c C-i
4128@findex mh-insert-letter
4129@item C-c C-i
4130Insert a message (@code{mh-insert-letter}).
4131@c -------------------------
4132@kindex C-c C-m C-e
4133@findex mh-mml-secure-message-encrypt
4134@item C-c C-m C-e
4135Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4136@c -------------------------
4137@cindex @samp{Letter > Compose Forward...} menu item
4138@cindex menu item, @samp{Letter > Compose Forward...}
4139@kindex C-c C-m C-f
4140@kindex C-c C-m f
4141@findex mh-compose-forward
4142@item C-c C-m C-f
4143@itemx C-c C-m f
4144Add tag to forward a message (@code{mh-compose-forward}).
4145@c -------------------------
4146@cindex @samp{Letter > Compose Get File (MH)...} menu item
4147@cindex menu item, @samp{Letter > Compose Get File (MH)...}
4148@kindex C-c C-m C-g
4149@kindex C-c C-m g
4150@findex mh-mh-compose-anon-ftp
4151@item C-c C-m C-g
4152@itemx C-c C-m g
4153Add tag to include anonymous ftp reference to a file
4154(@code{mh-mh-compose-anon-ftp}).
4155@c -------------------------
4156@cindex @samp{Letter > Compose Insertion...} menu item
4157@cindex menu item, @samp{Letter > Compose Insertion...}
4158@kindex C-c C-m C-i
4159@kindex C-c C-m i
4160@findex mh-compose-insertion
4161@item C-c C-m C-i
4162@itemx C-c C-m i
4163Add tag to include a file such as an image or sound
4164(@code{mh-compose-insertion}).
4165@c -------------------------
4166@cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4167@cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4168@kindex C-c C-m C-m
4169@kindex C-c C-m m
4170@findex mh-mml-to-mime
4171@item C-c C-m C-m
4172@itemx C-c C-m m
4173Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4174@c -------------------------
4175@kindex C-c C-m C-n
4176@kindex C-c C-m n
4177@findex mh-mml-unsecure-message
4178@item C-c C-m C-n
4179@itemx C-c C-m n
4180Remove any secure message tags (@code{mh-mml-unsecure-message}).
4181@c -------------------------
4182@kindex C-c C-m C-s
4183@findex mh-mml-secure-message-sign
4184@item C-c C-m C-s
4185Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4186@c -------------------------
4187@cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4188@cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4189@kindex C-c C-m C-t
4190@kindex C-c C-m t
4191@findex mh-mh-compose-external-compressed-tar
4192@item C-c C-m C-t
4193@itemx C-c C-m t
4194Add tag to include anonymous ftp reference to a compressed tar file
4195(@code{mh-mh-compose-external-compressed-tar}).
4196@c -------------------------
4197@cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4198@cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4199@kindex C-c C-m C-u
4200@kindex C-c C-m u
4201@findex mh-mh-to-mime-undo
4202@item C-c C-m C-u
4203@itemx C-c C-m u
4204Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4205@c -------------------------
4206@kindex C-c C-m C-x
4207@kindex C-c C-m x
4208@findex mh-mh-compose-external-type
4209@item C-c C-m C-x
4210@itemx C-c C-m x
4211Add tag to refer to a remote file
4212(@code{mh-mh-compose-external-type}).
4213@c -------------------------
4214@kindex C-c C-m e e
4215@findex mh-mml-secure-message-encrypt
4216@item C-c C-m e e
4217Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4218@c -------------------------
4219@kindex C-c C-m e s
4220@findex mh-mml-secure-message-signencrypt
4221@item C-c C-m e s
4222Add tag to encrypt and sign the message@*
4223(@code{mh-mml-secure-message-signencrypt}).
4224@c -------------------------
4225@kindex C-c C-m s e
4226@findex mh-mml-secure-message-signencrypt
4227@item C-c C-m s e
4228Add tag to encrypt and sign the message@*
4229(@code{mh-mml-secure-message-signencrypt}).
4230@c -------------------------
4231@kindex C-c C-m s s
4232@findex mh-mml-secure-message-sign
4233@item C-c C-m s s
4234Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4235@c -------------------------
4236@cindex @samp{Letter > Split Current Line} menu item
4237@cindex menu item, @samp{Letter > Split Current Line}
4238@kindex C-c C-o
4239@findex mh-open-line
4240@item C-c C-o
4241Insert a newline and leave point before it (@code{mh-open-line}).
4242@c -------------------------
4243@cindex @samp{Letter > Kill This Draft} menu item
4244@cindex menu item, @samp{Letter > Kill This Draft}
4245@kindex C-c C-q
4246@findex mh-fully-kill-draft
4247@item C-c C-q
4248Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4249@c -------------------------
4250@cindex @samp{Letter > Insert Signature} menu item
4251@cindex menu item, @samp{Letter > Insert Signature}
4252@kindex C-c C-s
4253@findex mh-insert-signature
4254@item C-c C-s
4255Insert signature in message (@code{mh-insert-signature}).
4256@c -------------------------
4257@kindex C-c C-t
4258@findex mh-letter-toggle-header-field-display
4259@item C-c C-t
4260Toggle display of header field at point
4261(@code{mh-letter-toggle-header-field-display}).
4262@c -------------------------
4263@cindex @samp{Letter > Check Recipient} menu item
4264@cindex menu item, @samp{Letter > Check Recipient}
4265@kindex C-c C-w
4266@findex mh-check-whom
4267@item C-c C-w
4268Verify recipients, showing expansion of any aliases
4269(@code{mh-check-whom}).
4270@c -------------------------
4271@cindex @samp{Letter > Yank Current Message} menu item
4272@cindex menu item, @samp{Letter > Yank Current Message}
4273@kindex C-c C-y
4274@findex mh-yank-cur-msg
4275@item C-c C-y
4276Insert the current message into the draft buffer
4277(@code{mh-yank-cur-msg}).
4278@c -------------------------
4279@kindex C-c M-d
4280@findex mh-insert-auto-fields
4281@item C-c M-d
4282Insert custom fields if recipient is found in
4283@code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4284@xref{Identities}.
4285@end table
1750 4286
4287@cindex @samp{mh-letter} customization group
4288@cindex customization group, @samp{mh-letter}
4289
4290Several options from the @samp{mh-letter} customization group are used
4291while editing a draft.
4292
4293@vtable @code
4294@item mh-compose-insertion
4295Type of @sc{mime} message tags in messages (default: @samp{MML} if
4296available; otherwise @samp{MH}).
4297@c -------------------------
4298@item mh-compose-skipped-header-fields
4299List of header fields to skip over when navigating in draft (default:
4300@code{'("From"} @code{"Organization"} @code{"References"}
4301@code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4302@code{"X-Image-URL"} @code{"X-Mailer")}.
4303@c -------------------------
4304@item mh-compose-space-does-completion-flag
4305On means @key{SPC} does completion in message header (default:
4306@samp{off}).
4307@c -------------------------
4308@item mh-delete-yanked-msg-window-flag
4309On means delete any window displaying the message (default: @samp{off}).
4310@c -------------------------
4311@item mh-extract-from-attribution-verb
4312Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4313(default: @samp{"wrote:"}).
4314@c -------------------------
4315@item mh-ins-buf-prefix
4316String to put before each line of a yanked or inserted message
4317(default: @samp{"> "}).
4318@c -------------------------
4319@item mh-letter-complete-function
4320Function to call when completing outside of address or folder fields
4321(default: @code{ispell-complete-word}).
4322@c -------------------------
4323@item mh-letter-fill-column
4324Fill column to use in MH-Letter mode (default: 72).
4325@c -------------------------
4326@item mh-mml-method-default
4327Default method to use in security tags (default: @samp{PGP (MIME)} if
4328support for it is available; otherwise @samp{None}).
4329@c -------------------------
4330@item mh-signature-file-name
4331Source of user's signature (default: @samp{"~/.signature"}).
4332@c -------------------------
4333@item mh-signature-separator-flag
4334On means a signature separator should be inserted (default:
4335@samp{on}).
4336@c -------------------------
4337@item mh-x-face-file
4338File containing X-Face or Face header field to insert in outgoing mail.
4339(default: @samp{"~/.face"}).
4340@c -------------------------
4341@item mh-yank-behavior
4342Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4343@samp{Body With Attribution}).
4344@end vtable
4345
4346The following hooks are available.
4347
4348@vtable @code
4349@item mail-citation-hook
4350Hook for modifying a citation just inserted in the mail buffer
4351(default: @code{nil}).
4352@c -------------------------
4353@item mh-before-send-letter-hook
4354Hook run at the beginning of the @kbd{C-c C-c} command (default:
4355@samp{nil}).
4356@c -------------------------
4357@item mh-mh-to-mime-hook
4358Hook run on the formatted letter by @kbd{C-c C-e} (default:
4359@samp{nil}).
4360@c -------------------------
4361@item mh-insert-signature-hook
4362Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4363@code{nil}).
4364@end vtable
4365
4366The following face is available.
4367
4368@vtable @code
4369@item mh-letter-header-field
4370Editable header field value face in draft buffers.
4371@end vtable
4372
4373The commands and options introduced here are explained in more
4374detail in the following sections.
1751 4375
4376@menu
4377* Editing Message::
4378* Inserting Letter::
4379* Inserting Messages::
4380* Signature::
4381* Picture::
4382* Adding Attachments::
4383* Sending PGP::
4384* Checking Recipients::
4385* Sending Message::
4386* Killing Draft::
4387@end menu
1752 4388
4389@node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4390@section Editing the Message
4391
4392@cindex @samp{Bcc:} header field
4393@cindex @samp{Cc:} header field
4394@cindex @samp{Dcc:} header field
4395@cindex @samp{From:} header field
4396@cindex @samp{Mail-Followup-To:} header field
4397@cindex @samp{Mail-Reply-To:} header field
4398@cindex @samp{Reply-To:} header field
4399@cindex @samp{Subject:} header field
4400@cindex @samp{To:} header field
4401@cindex editing header
4402@cindex header field, @samp{Bcc:}
4403@cindex header field, @samp{Cc:}
4404@cindex header field, @samp{Dcc:}
4405@cindex header field, @samp{From:}
4406@cindex header field, @samp{Mail-Followup-To:}
4407@cindex header field, @samp{Mail-Reply-To:}
4408@cindex header field, @samp{Reply-To:}
4409@cindex header field, @samp{Subject:}
4410@cindex header field, @samp{To:}
4411@findex mh-to-field
4412@kindex C-c C-f C-t
4413@kindex C-c C-f t
1753 4414
4415Because the header is part of the message, you can edit the header
4416fields as you wish. However, several convenience commands exist to
4417help you create and edit them. For example, the command @kbd{C-c C-f
4418C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4419cursor to the @samp{To:} header field, creating it if necessary. The
4420commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4421@samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4422@samp{Bcc:}, and @samp{Dcc:} header fields are similar.
1754 4423
4424@findex mh-to-fcc
4425@kindex C-c C-f C-f
4426@kindex C-c C-f f
4427
4428One command behaves differently from the others, namely, @kbd{C-c C-f
4429C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4430will prompt you for the folder name in which to file a copy of the
4431draft. @xref{Folder Selection}.
4432
4433@findex indent-relative
4434@findex mh-letter-next-header-field-or-indent
4435@findex mh-letter-previous-header-field
4436@kindex S-@key{TAB}
4437@kindex @key{TAB}
4438@vindex mh-compose-skipped-header-fields
4439@vindex mh-letter-header-field
4440
4441Within the header of the message, the command@* @key{TAB}
4442(@code{mh-letter-next-header-field-or-indent}) moves between fields
4443that are highlighted with the face @code{mh-letter-header-field},
4444skipping those fields listed in
4445@code{mh-compose-skipped-header-fields}. After the last field, this
4446command then moves point to the message body before cycling back to
4447the first field. If point is already past the first line of the
4448message body, then this command indents by calling
4449@code{indent-relative} with the given prefix argument. The command
4450@kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4451backwards between the fields and cycles to the body of the message
4452after the first field. Unlike the command @key{TAB}, it will always
4453take point to the last field from anywhere in the body.
4454
4455@cindex alias completion
4456@cindex completion
4457@cindex spell check
4458@findex ispell-complete-word
4459@findex mh-letter-complete
4460@findex mh-letter-complete-or-space
4461@findex mh-letter-confirm-address
4462@kindex , (comma)
4463@kindex M-@key{TAB}
4464@kindex @key{SPC}
4465@vindex mh-letter-complete-function
4466
4467If the field contains addresses (for example, @samp{To:} or
4468@samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4469@kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4470completion (@pxref{Aliases}). In the body of the message,
4471@kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4472which is set to @samp{'ispell-complete-word} by default. The command
4473@kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4474that is passed to the @code{mh-letter-complete-function}. In addition,
4475turn on the option @code{mh-compose-space-does-completion-flag} to use
4476the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4477completion in the header as well; use a prefix argument to specify
4478more than one space. Addresses are separated by a comma; when you
4479press the comma, the command @code{mh-letter-confirm-address} flashes
4480the alias expansion in the minibuffer if
4481@code{mh-alias-flash-on-comma} is turned on.
4482
4483@kindex C-c C-t
4484@findex mh-letter-toggle-header-field-display
4485@c XXX Document the replacement for the inaccessible 'long argument.
4486
4487Use the command @kbd{C-c C-t}
4488@code{mh-letter-toggle-header-field-display} to display truncated
4489header fields. This command is a toggle so entering it again will hide
4490the field. This command takes a prefix argument: if negative then the
4491field is hidden, if positive then the field is displayed (for example,
4492@kbd{C-u C-c C-t}).
4493
4494Be sure to leave a row of dashes or a blank line between the header
4495and the body of the message.
4496
4497@vindex mh-letter-fill-column
4498
4499The body of the message is edited as you would edit any Emacs buffer
4500although there are a few commands and options to assist you. You can
4501change the fill column in MH-Letter mode with the option
4502@code{mh-letter-fill-column}. By default, this option is 72 to allow
4503others to quote your message without line wrapping.
4504
4505@cindex filling paragraphs
4506@cindex paragraphs, filling
4507@findex fill-paragraph
4508@kindex M-q
4509@vindex mh-ins-buf-prefix
4510
4511You'll often include messages that were sent from user agents that
4512haven't yet realized that paragraphs consist of more than a single
4513line. This makes for long lines that wrap in an ugly fashion. You'll
4514find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4515quoted messages, even if they are nested, just as long as all of the
4516quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4517Letter}). For example, let's assume you have the following in your
4518draft:
1755 4519
4520@example
4521@group
4522> Hopefully this gives you an idea of what I'm currently doing. I'm \
4523not sure yet whether I'm completely satisfied with my setup, but \
4524it's worked okay for me so far.
4525@end group
4526@end example
1756 4527
1757--**-Emacs: pick-pattern (MH-Pick)------All-------------------------- 4528Running @kbd{M-q} on this paragraph produces:
1758 4529
1759@end cartouche 4530@example
1760@i{Pick window} 4531@group
4532> Hopefully this gives you an idea of what I'm currently doing. I'm not
4533> sure yet whether I'm completely satisfied with my setup, but it's
4534> worked okay for me so far.
1761@end group 4535@end group
1762@end example 4536@end example
1763 4537
1764@cindex @code{pick} 4538@findex mh-open-line
1765@cindex MH commands, @code{pick} 4539@findex open-line
4540@kindex C-c C-o
4541@kindex C-o
1766 4542
1767Edit this template by entering your search criteria in an appropriate 4543The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
1768header field that is already there, or create a new field yourself. If 4544command @kbd{C-o} (@code{open-line}) in that it inserts a newline
1769the string you're looking for could be anywhere in a message, then place 4545after point. It differs in that it also inserts the right number of
1770the string underneath the row of dashes. The @kbd{M-s} command uses the 4546quoting characters and spaces so that the next line begins in the same
1771MH command @code{pick} to do the real work, so read @code{pick}(1) to 4547column as it was. This is useful when breaking up paragraphs in
1772find out more about how to enter the criteria. 4548replies. For example, if this command was used when point was after
1773 4549the first period in the paragraph above, the result would be this:
1774There are no semantics associated with the search criteria---they are
1775simply treated as strings. Case is ignored when all lowercase is used,
1776and regular expressions (a la @code{ed}) are available. It is all right
1777to specify several search criteria. What happens then is that a logical
1778@emph{and} of the various fields is performed. If you prefer a logical
1779@emph{or} operation, run @kbd{M-s} multiple times.
1780
1781As an example, let's say that we want to find messages from Ginnean
1782about horseback riding in the Kosciusko National Park (Australia) during
1783January, 1994. Normally we would start with a broad search and narrow
1784it down if necessary to produce a manageable amount of data, but we'll
1785cut to the chase and create a fairly restrictive set of criteria as
1786follows:
1787 4550
1788@example 4551@example
1789@group 4552@group
1790From: ginnean 4553> Hopefully this gives you an idea of what I'm currently doing.
1791To: 4554
1792Cc: 4555> I'm not
1793Date: Jan 1994 4556> sure yet whether I'm completely satisfied with my setup, but it's
1794Subject: horse.*kosciusko 4557> worked okay for me so far.
1795--------
1796@end group 4558@end group
1797@end example 4559@end example
1798 4560
1799@findex @code{mh-to-field} 4561@node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4562@section Inserting Letter to Which You're Replying
1800 4563
1801As with MH-Letter mode, MH-Pick provides commands like 4564@cindex inserting messages
1802@kbd{C-c C-f C-t} to help you fill in the blanks. 4565@cindex replying to messages
4566@cindex yanking messages
4567@findex mh-yank-cur-msg
4568@kindex C-c C-y
1803 4569
1804@table @kbd 4570It is often useful to insert a snippet of text from a letter that
1805@item C-c C-f C-t 4571someone mailed to provide some context for your reply. The command
1806Move to @samp{To:} header field (@code{mh-to-field}). 4572@kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4573attribution, yanking a portion of text from the message to which
4574you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4575before each line.
1807 4576
1808@item C-c C-f C-c 4577@example
1809Move to @samp{cc:} header field (@code{mh-to-field}). 4578@group
4579Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
1810 4580
1811@item C-c C-f C-s 4581> Hopefully this gives you an idea of what I'm currently doing. I'm not
1812Move to @samp{Subject:} header field (@code{mh-to-field}). 4582> sure yet whether I'm completely satisfied with my setup, but it's
4583> worked okay for me so far.
4584@end group
4585@end example
1813 4586
1814@item C-c C-f C-f 4587@vindex mh-extract-from-attribution-verb
1815Move to @samp{From:} header field (@code{mh-to-field}).
1816 4588
1817@item C-c C-f C-b 4589The attribution consists of the sender's name and email address
1818Move to @samp{Bcc:} header field (@code{mh-to-field}). 4590followed by the content of the option
4591@code{mh-extract-from-attribution-verb}. This option can be set to
4592@samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4593the @samp{Custom String} menu item to enter your own verb.
1819 4594
1820@item C-c C-f C-f 4595@vindex mh-ins-buf-prefix
1821Move to @samp{Fcc:} header field (@code{mh-to-field}).
1822 4596
1823@item C-c C-f C-d 4597The prefix @samp{"> "} is the default setting for the option
1824Move to @samp{Dcc:} header field (@code{mh-to-field}). 4598@code{mh-ins-buf-prefix}. I suggest that you not modify this option
4599since it is used by many mailers and news readers: messages are far
4600easier to read if several included messages have all been indented by
4601the same string. This prefix is not inserted if you use one of the
4602supercite flavors of @code{mh-yank-behavior} or you have added a
4603@code{mail-citation-hook} as described below.
1825 4604
1826@item C-c C-c 4605@vindex mh-delete-yanked-msg-window-flag
1827Execute the search (@code{mh-do-pick-search}).
1828@end table
1829 4606
1830@findex @code{mh-do-pick-search} 4607You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4608option to delete the window containing the original message after
4609yanking it to make more room on your screen for your reply.
1831 4610
1832To perform the search, type @kbd{C-c C-c} (@code{mh-do-pick-search}). 4611@vindex mh-yank-behavior
1833The selected messages are placed in the @i{search} sequence, which you 4612@cindex Emacs, packages, supercite
1834can use later in forwarding (@pxref{Forwarding}), printing 4613@cindex supercite package
1835(@pxref{Printing}), or narrowing your field of view (@pxref{Sequences}). 4614
1836Subsequent searches are appended to the @i{search} sequence. If, 4615You can control how the message to which you are replying is yanked
1837however, you wish to start with a clean slate, first delete the 4616into your reply using @code{mh-yank-behavior}. To include the entire
1838@i{search} sequence (how to do this is discussed in @ref{Sequences}). 4617message, including the entire header, use @samp{Body and
4618Header}@footnote{If you'd rather have the header cleaned up, use
4619@kbd{C-u r} instead of @kbd{r} when replying
4620(@pxref{Replying}).}@footnote{In the past you would use this setting
4621and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4622is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4623Use @samp{Body} to yank just the body without the header. To yank only
4624the portion of the message following the point, set this option to
4625@samp{Below Point}.
4626
4627Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4628full-bodied, full-featured, citation package that comes standard with
4629Emacs.} to pass the entire message and header through supercite.
4630
4631If the @samp{Body With Attribution} setting is used, then the message
4632minus the header is yanked and a simple attribution line is added at
4633the top using the value of the option
4634@code{mh-extract-from-attribution-verb}. This is the default.
4635
4636If the @samp{Invoke supercite} or @samp{Body With Attribution}
4637settings are used, the @samp{-noformat} argument is passed to the
4638@command{repl} program to override a @samp{-filter} or @samp{-format}
4639argument. These settings also have @samp{Automatically} variants that
4640perform the action automatically when you reply so that you don't need
4641to use @kbd{C-c C-y} at all. Note that this automatic action is only
4642performed if the show buffer matches the message being replied to.
4643People who use the automatic variants tend to turn on the option
4644@code{mh-delete-yanked-msg-window-flag} as well so that the show
4645window is never displayed.
4646
4647If the show buffer has a region, the option @code{mh-yank-behavior} is
4648ignored unless its value is one of @samp{Attribution} variants in
4649which case the attribution is added to the yanked region.
4650
4651@findex trivial-cite
4652@vindex mail-citation-hook
4653
4654If this isn't enough, you can gain full control over the appearance of
4655the included text by setting @code{mail-citation-hook} to a function
4656that modifies it. This hook is ignored if the option
4657@code{mh-yank-behavior} is set to one of the supercite flavors.
4658Otherwise, this option controls how much of the message is passed to
4659the hook. The function can find the citation between point and mark
4660and it should leave point and mark around the modified citation text
4661for the next hook function. The standard prefix
4662@code{mh-ins-buf-prefix} is not added if this hook is set.
4663
4664For example, if you use the hook function
4665@uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
4666@code{trivial-cite}} (which is NOT part of Emacs), set
4667@code{mh-yank-behavior} to @samp{Body and Header}.
4668
4669@node Inserting Messages, Signature, Inserting Letter, Editing Drafts
4670@section Inserting Messages
1839 4671
1840@cindex MH-Folder mode 4672@cindex inserting messages
1841@cindex modes, MH-Folder 4673@findex mh-insert-letter
4674@findex mh-yank-behavior
4675@kindex C-c C-i
4676@vindex mh-ins-buf-prefix
4677@vindex mh-invisible-header-fields-compiled
1842 4678
1843If you're searching in a folder that is already displayed in a 4679Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
1844MH-Folder buffer, only those messages contained in the buffer are 4680This command prompts you for the folder and message number, which
1845used for the search. Therefore, if you want to search in all messages, 4681defaults to the current message in that folder. It then inserts the
1846first kill the folder's buffer with @kbd{C-x k} or scan the entire 4682messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
1847folder with @kbd{M-r}. 4683@code{mh-yank-behavior} is set to one of the supercite flavors in
4684which case supercite is used to format the message. Certain
4685undesirable header fields (see
4686@code{mh-invisible-header-fields-compiled}) are removed before
4687insertion.
4688
4689If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
4690left intact, the message is not indented, and @samp{> } is not
4691inserted before each line. This command leaves the mark before the
4692letter and point after it.
4693
4694@node Signature, Picture, Inserting Messages, Editing Drafts
4695@section Inserting Your Signature
1848 4696
1849@node Sequences, Miscellaneous, Searching, Using mh-e 4697@cindex signature
1850@section Using Sequences 4698@findex mh-insert-signature
4699@kindex C-c C-s
1851 4700
1852@cindex sequences 4701You can insert your signature at the current cursor location with the
4702command @kbd{C-c C-s} (@code{mh-insert-signature}).
1853 4703
1854For the whole scoop on MH sequences, refer to @code{mh-sequence}(5). As 4704@cindex @file{.signature}
1855you've read, several of the mh-e commands can operate on a sequence, 4705@cindex files, @file{.signature}
1856which is a shorthand for a range or group of messages. For example, you 4706@cindex vCard
1857might want to forward several messages to a friend or colleague. Here's 4707@vindex mh-signature-file-name
1858how to manipulate sequences. 4708
4709By default, the text of your signature is taken from the file
4710@file{~/.signature}. You can read from other sources by changing the
4711option @code{mh-signature-file-name}. This file may contain a
4712@dfn{vCard} in which case an attachment is added with the vCard.
4713
4714@findex mh-signature-separator-p
4715@vindex mh-signature-separator
4716@vindex mh-signature-separator-regexp
4717
4718The option @code{mh-signature-file-name} may also be a symbol, in
4719which case that function is called. You may not want a signature
4720separator to be added for you; instead you may want to insert one
4721yourself. Options that you may find useful to do this include
4722@code{mh-signature-separator} (when inserting a signature separator)
4723and @code{mh-signature-separator-regexp} (for finding said separator).
4724The function @code{mh-signature-separator-p}, which reports @code{t}
4725if the buffer contains a separator, may be useful as well.
4726
4727@cindex signature separator
4728@vindex mh-signature-separator-flag
4729
4730A signature separator (@samp{"-- "}) will be added if the signature
4731block does not contain one and @code{mh-signature-separator-flag} is
4732on. It is not recommended that you change this option since various
4733mail user agents, including MH-E, use the separator to present the
4734signature differently, and to suppress the signature when replying or
4735yanking a letter into a draft.
4736
4737@vindex mh-insert-signature-hook
4738
4739The hook @code{mh-insert-signature-hook} is run after the signature is
4740inserted. Hook functions may access the actual name of the file or the
4741function used to insert the signature with
4742@code{mh-signature-file-name}.
4743
4744The signature can also be inserted using Identities.
4745@xref{Identities}.
4746
4747@node Picture, Adding Attachments, Signature, Editing Drafts
4748@section Inserting Your Picture
4749
4750@cindex @file{.face}
4751@cindex files, @file{.face}
4752@vindex mh-x-face-file
4753
4754You can insert your picture in the header of your mail message so that
4755recipients see your face in the @samp{From:} header field if their
4756mail user agent is sophisticated enough. In MH-E, this is done by
4757placing your image in the file named by the option
4758@code{mh-x-face-file} which is @file{~/.face} by default.
4759
4760@cindex @samp{Face:} header field
4761@cindex @samp{X-Face:} header field
4762@cindex @samp{X-Image-URL:} header field
4763@cindex header field, @samp{Face:}
4764@cindex header field, @samp{X-Face:}
4765@cindex header field, @samp{X-Image-URL:}
4766
4767If the file starts with either of the strings @samp{X-Face:},
4768@samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
4769message header verbatim. Otherwise it is assumed that the file
4770contains the value of the @samp{X-Face:} header field.
4771
4772@cindex @command{compface}
4773@cindex Unix commands, @command{compface}
4774
4775The @samp{X-Face:} header field, which is a low-resolution, black and
4776white image, can be generated using the
4777@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
4778@command{compface}} command. The @uref{http://www.dairiki.org/xface/,
4779@cite{Online X-Face Converter}} is a useful resource for quick
4780conversion of images into @samp{X-Face:} header fields.
4781
4782Use the @uref{http://quimby.gnus.org/circus/face/make-face,
4783@command{make-face}} script to convert a JPEG image to the higher
4784resolution, color, @samp{Face:} header field.
4785
4786The URL of any image can be used for the @samp{X-Image-URL:} field and
4787no processing of the image is required.
4788
4789To prevent the setting of any of these header fields, either set
4790@code{mh-x-face-file} to @code{nil}, or simply ensure that the file
4791defined by this option doesn't exist.
4792
4793@xref{Viewing}, to see how these header fields are displayed in MH-E.
4794
4795@node Adding Attachments, Sending PGP, Picture, Editing Drafts
4796@section Adding Attachments
4797
4798@cindex @command{mhbuild}
4799@cindex @command{mhn}
4800@cindex MH commands, @command{mhbuild}
4801@cindex MH commands, @command{mhn}
4802@cindex MIME
4803@cindex multimedia mail
1859 4804
1860@table @kbd 4805MH-E has the capability to create multimedia messages. It uses the
1861@item % 4806@sc{mime} (Multipurpose Internet Mail Extensions)
1862Put message in a sequence (@code{mh-put-msg-in-seq}). 4807protocol@footnote{@sc{mime} is defined in
4808@uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
4809@sc{mime} protocol allows you to incorporate images, sound, video,
4810binary files, and even commands that fetch a file with @samp{ftp} when
4811your recipient reads the message!
4812
4813If you were to create a multimedia message with plain MH commands, you
4814would insert @command{mhbuild} or @command{mhn} directives (henceforth
4815called @dfn{MH-style directives} into your draft and use the
4816@command{mhbuild} command in nmh or @command{mhn} command in MH and
4817GNU mailutils to expand them. MH-E works in much the same way,
4818although it provides a handful of commands prefixed with @kbd{C-c C-m}
4819to insert the directives so you don't need to remember the syntax of
4820them. Remember: you can always add MH-style directives by
4821hand@footnote{See the section
4822@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
4823the MH book.}.
4824
4825@cindex MIME Meta Language (MML)
4826@cindex MML
4827@vindex mh-compose-insertion
4828
4829In addition to MH-style directives, MH-E also supports MML (@sc{mime}
4830Meta Language) tags@footnote{
4831@ifinfo
4832@c Although the third argument should default to the
4833@c first, makeinfo goes to the wrong Info file without it being
4834@c different--it seems to be getting our own Composing node.
4835@xref{Composing,,Composing with MML,emacs-mime}.
4836@end ifinfo
4837@ifnotinfo
4838See the section Composing in
4839@uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
4840Manual}}.
4841@end ifnotinfo
4842}. The option @code{mh-compose-insertion} can be used to choose
4843between them. By default, this option is set to @samp{MML} if it is
4844supported since it provides a lot more functionality. This option can
4845also be set to @samp{MH} if MH-style directives are preferred.
4846
4847@cindex media types
4848@cindex MIME, media types
4849
4850The MH-E @sc{mime} commands require a @dfn{media type} for each body
4851part or attachment. For example, a PDF document is of type
4852@samp{application/pdf} and an HTML document is of type
4853@samp{text/html}. Some commands fill in the media type for you,
4854whereas others require you to enter one.
4855
4856@cindex @command{file}
4857@cindex @file{/etc/mime.types}
4858@cindex Unix commands, @command{file}
4859@cindex files, @file{/etc/mime.types}
4860@findex mailcap-mime-types
4861
4862In the cases where MH-E can do so, it will determine the media type
4863automatically. It uses the @command{file} command to do this. Failing
4864that, the Emacs function @code{mailcap-mime-types} is used to provide
4865a list from which to choose. This function usually reads the file
4866@file{/etc/mime.types}.
4867
4868Whether the media type is chosen automatically, or you choose it from
4869a list, use the type that seems to match best the file that you are
4870including. In the case of binaries, the media type
4871@samp{application/x-executable} can be useful. If you can't find an
4872appropriate media type, use @samp{text/plain} for text messages and
4873@samp{application/octet-stream} for everything else.
1863 4874
1864@item ? 4875@cindex content description
1865Display sequences that message belongs to (@code{mh-msg-is-in-seq}). 4876@cindex MIME, content description
1866 4877
1867@item M-q 4878You are also sometimes asked for a @dfn{content description}. This is
1868List all sequences in folder (@code{mh-list-sequences}). 4879simply an optional brief phrase, in your own words, that describes the
4880object. If you don't care to enter a content description, just press
4881return and none will be included; however, a reader may skip over
4882multimedia fields unless the content description is compelling.
1869 4883
1870@item M-% 4884You can also create your own @sc{mime} body parts. In the following
1871Remove message from sequence (@code{mh-delete-msg-from-seq}). 4885example, I describe how you can create and edit a @samp{text/enriched}
4886body part to liven up your plain text messages with boldface,
4887underlining, and italics. I include an Emacs function which inserts
4888enriched text tags.
1872 4889
1873@item M-# 4890@smalllisp
1874Delete sequence (@code{mh-delete-seq}). 4891@group
4892(defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
4893 ("u" . "underline")
4894 ("s" . "smaller") ("B" . "bigger")
4895 ("f" . "fixed")
4896 ("c" . "center"))
4897 "Alist of (final-character . tag) choices for add-enriched-text.
4898Additional types can be found in RFC 1563.")
1875 4899
1876@item C-x n 4900(defun add-enriched-text (begin end)
1877Restrict display to messages in sequence (@code{mh-narrow-to-seq}). 4901 "Add enriched text tags around region.
4902The tag used comes from the list enriched-text-types and is
4903specified by the last keystroke of the command. When called from Lisp,
4904arguments are BEGIN and END@."
4905 (interactive "r")
4906 ;; @r{Set type to the tag indicated by the last keystroke.}
4907 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
4908 enriched-text-types))))
4909 (save-restriction ; @r{restores state from narrow-to-region}
4910 (narrow-to-region begin end) ; @r{narrow view to region}
4911 (goto-char (point-min)) ; @r{move to beginning of text}
4912 (insert "<" type ">") ; @r{insert beginning tag}
4913 (goto-char (point-max)) ; @r{move to end of text}
4914 (insert "</" type ">")))) ; @r{insert terminating tag}
4915@i{Emacs function for entering enriched text}
1878 4916
1879@item C-x w 4917@end group
1880Remove restriction; display all messages (@code{mh-widen}). 4918@end smalllisp
1881 4919
1882@item M-x mh-update-sequences 4920To use the function @code{add-enriched-text}, first add it to
1883Push mh-e's state out to MH@. 4921@file{~/.emacs} and create key bindings for it (@pxref{Composing}).
1884@end table
1885 4922
1886@cindex @code{pick} 4923Then, in your plain text message, set the mark with @kbd{C-@@} or
1887@cindex MH commands, @code{pick} 4924@kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
1888@findex @code{mh-put-msg-in-seq} 4925b}. This adds @samp{<bold>} where you set the mark and adds
4926@samp{</bold>} at the location of your cursor, giving you something
4927like: @samp{You should be <bold>very</bold>}.
1889 4928
1890To place a message in a sequence, use @kbd{%} (@code{mh-put-msg-in-seq}) 4929Before sending this message, use @kbd{C-c C-m C-m}
1891to do it manually, or use the MH command @code{pick} or the mh-e version 4930(@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
1892of @code{pick} (@ref{Searching}) which create a sequence automatically. 4931(@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
1893Give @kbd{%} a prefix argument and you can add all the messages in one 4932MIME header fields. Then replace @samp{text/plain} with
1894sequence to another sequence (for example, @kbd{C-u % SourceSequence 4933@samp{text/enriched} in the @samp{Content-Type:} header field.
1895RET}).
1896 4934
1897@cindex MH-Folder mode 4935You may also be interested in investigating @code{sgml-mode}.
1898@cindex modes, MH-Folder
1899@findex @code{mh-narrow-to-seq}
1900@findex @code{mh-widen}
1901 4936
1902Once you've placed some messages in a sequence, you may wish to narrow 4937@subheading Including Files
1903the field of view to just those messages in the sequence you've created.
1904To do this, use @kbd{C-x n} (@code{mh-narrow-to-seq}). You are prompted
1905for the name of the sequence. What this does is show only those
1906messages that are in the selected sequence in the MH-Folder buffer. In
1907addition, it limits further mh-e searches to just those messages. When
1908you want to widen the view to all your messages again, use @kbd{C-x w}
1909(@code{mh-widen}).
1910 4938
1911@findex @code{mh-msg-is-in-seq} 4939@cindex MIME, images
1912@findex @code{mh-list-sequences} 4940@cindex MIME, sound
4941@cindex MIME, video
4942@cindex attachments, inserting
4943@cindex images
4944@cindex sound
4945@cindex video
4946@findex mh-compose-insertion
4947@kindex C-c C-m C-i
4948@kindex C-c C-m i
4949
4950Binaries, images, sound, and video can be inserted in your message
4951with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
4952are prompted for the filename containing the object, the media type if
4953it cannot be determined automatically, and a content description. If
4954you're using MH-style directives, you will also be prompted for
4955additional attributes.
4956
4957@subheading Forwarding Multimedia Messages
4958
4959@findex mh-compose-forward
4960@kindex C-c C-m C-f
4961@kindex C-c C-m f
4962
4963Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
4964C-f} (@code{mh-compose-forward}). You are prompted for a content
4965description, the name of the folder in which the messages to forward
4966are located, and a range of messages, which defaults to the current
4967message in that folder. @xref{Ranges}.
4968
4969@subheading Including an FTP Reference
4970
4971@cindex @command{ftp}
4972@cindex MIME, @command{ftp}
4973@cindex Unix commands, @command{ftp}
4974@findex mh-mh-compose-anon-ftp
4975@kindex C-c C-m C-g
4976@kindex C-c C-m g
4977
4978You can have your message initiate an @command{ftp} transfer when the
4979recipient reads the message. To do this, use the command @kbd{C-c C-m
4980C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
4981host and filename, the media type, and the content description.
4982
4983@subheading Including tar Files
4984
4985@cindex @command{ftp}
4986@cindex @command{tar}
4987@cindex MIME, @command{ftp}
4988@cindex MIME, @command{tar}
4989@cindex Unix commands, @command{ftp}
4990@cindex Unix commands, @command{tar}
4991@findex mh-mh-compose-external-compressed-tar
4992@kindex C-c C-m C-t
4993@kindex C-c C-m t
4994
4995If the remote file is a compressed tar file, you can use @kbd{C-c C-m
4996C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
4997to retrieving the file via anonymous @emph{ftp} as per the command
4998@kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
4999be uncompressed and untarred. You are prompted for the remote host and
5000filename and the content description.
5001
5002@subheading Including Other External Files
5003
5004@findex mh-mh-compose-external-type
5005@kindex C-c C-m C-x
5006@kindex C-c C-m x
5007
5008The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5009a general utility for referencing external files. In fact, all of the
5010other commands that insert tags to access external files call this
5011command. You are prompted for the access type, remote host and
5012filename, and content type. If you provide a prefix argument, you are
5013also prompted for a content description, attributes, parameters, and a
5014comment.
5015
5016@subheading Previewing Multimedia Messages
1913 5017
1914You can see which sequences a message is in with the @kbd{?} 5018When you are finished editing a @sc{mime} message, it might look like this:
1915(@code{mh-msg-is-in-seq}) command.
1916@c Doesn't work:
1917@c use a prefix argument to query a
1918@c message other than the current one (as in @kbd{C-u ? 42 RET}). XXX
1919Or, you can list all sequences in a selected folder (default is current
1920folder) with @kbd{M-q} (@code{mh-list-sequences}).
1921 5019
1922@findex @code{mh-delete-msg-from-seq} 5020@cartouche
1923@findex @code{mh-delete-seq} 5021@smallexample
50223 t08/24 root received fax files on Wed Aug 24 11:00:
50234+t08/24 To:wohler Test<<This is a test message to get the
1924 5024
1925If you want to remove a message from a sequence, use @kbd{M-%}
1926(@code{mh-delete-msg-from-seq}), and if you want to delete an entire
1927sequence, use @kbd{M-#} (@code{mh-delete-seq}). In the latter case you
1928are prompted for the sequence to delete. Note that this deletes only
1929the sequence, not the messages in the sequence. If you want to delete
1930the messages, use @kbd{C-u d} (see @ref{Deleting} above).
1931 5025
1932@cindex @code{mark}
1933@cindex MH commands, @code{mark}
1934 5026
1935@findex @code{mh-update-sequences}
1936 5027
1937Two sequences are maintained internally by mh-e and pushed out to MH
1938when you type either the @kbd{x} or @kbd{q} command. They are the
1939sequence specified by your @samp{Unseen-Sequence:} profile entry and
1940@i{cur}. However, you can also just update MH's state with the command
1941@kbd{M-x mh-update-sequences}. See @ref{Customizing Viewing} for an
1942example of how this command might be used.
1943 5028
1944With the exceptions of @kbd{C-x n} and @kbd{C-x w}, the underlying MH 5029--:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot---------------
1945command dealing with sequences is @code{mark}. 5030To: wohler
5031cc:
5032Subject: Test of MIME
5033--------
5034Here is the SETI@@Home logo:
1946 5035
1947@node Miscellaneous, , Sequences, Using mh-e 5036<#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
1948@section Miscellaneous Commands 5037disposition=inline description="SETI@@home logo">
5038<#/part>
5039--:** @{draft@} (MH-Letter)--L8--All----------------------------------
1949 5040
1950@findex @code{mh-version} 5041@end smallexample
5042@end cartouche
5043@i{MH-E @sc{mime} draft}
1951 5044
1952One other command worth noting is @kbd{M-x mh-version}. You can 5045@findex mh-mml-to-mime
1953compare the version this command prints to the latest release 5046@kindex C-c C-m C-m
1954(@pxref{Getting mh-e}). The output of @kbd{M-x mh-version} should 5047@kindex C-c C-m m
1955always be included with any bug report you submit (@pxref{Bug Reports}).
1956 5048
1957@node Customizing mh-e, Odds and Ends, Using mh-e, Top 5049Typically, you send a message with attachments just like any other
1958@chapter Customizing mh-e 5050message (@pxref{Sending Message}).
1959 5051
1960Until now, we've talked about the mh-e commands as they work ``out of the 5052However, you may take a sneak preview of the @sc{mime} encoding if you
1961box.'' Of course, it is also possible to reconfigure mh-e 5053wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
1962to fit the needs of even the most demanding user. 5054The following screen shows the @sc{mime} encoding specified by the
1963The following sections describe all of the 5055tags. You can see why mail user agents are usually built to hide these
1964customization variables, show the defaults, and make recommendations for 5056details from the user.
1965customization. The outline of this chapter is identical to that of
1966@ref{Using mh-e}, to make it easier to find the variables you'd need to
1967modify to affect a particular command.
1968 5057
1969However, when customizing your mail environment, first try to change 5058@cartouche
1970what you want in MH, and only change mh-e if changing MH is not 5059@smallexample
1971possible. That way you will get the same behavior inside and outside 5060To: wohler
1972GNU Emacs. Note that mh-e does not provide hooks for customizations 5061cc:
1973that can be done in MH; this omission is intentional. 5062Subject: Test of MIME
5063MIME-Version: 1.0
5064Content-Type: multipart/mixed; boundary="=-=-="
5065--------
5066--=-=-=
1974 5067
1975@cindex @file{.emacs} 5068Here is the SETI@@Home logo:
1976@cindex files, @file{.emacs}
1977 5069
1978Many string or integer variables are easy enough to modify using Emacs
1979Lisp. Any such modifications should be placed in a file called
1980@file{.emacs} in your home directory (that is, @file{~/.emacs}). For
1981example, to modify the variable that controls printing, you could add:
1982 5070
1983@vindex @code{mh-lpr-command-format}, example 5071--=-=-=
5072Content-Type: image/x-xpm
5073Content-Disposition: inline; filename=setiathome.xpm
5074Content-Transfer-Encoding: base64
5075Content-Description: SETI@@home logo
1984 5076
1985@lisp 5077LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2NCAy
1986(setq mh-lpr-command-format "nenscript -G -r -2 -i'%s'") 5078--:-- @{draft@} (MH-Letter)--L2--Top----------------------------------
1987@end lisp
1988 5079
1989@ref{Customizing Printing} talks more about this variable. 5080@end smallexample
5081@end cartouche
5082@i{MH-E @sc{mime} draft ready to send}
5083
5084This action can be undone by running @kbd{C-_} (@code{undo}).
5085
5086@cindex @command{mhbuild}
5087@cindex @command{mhn}
5088@cindex MH commands, @command{mhbuild}
5089@cindex MH commands, @command{mhn}
5090@findex mh-mh-to-mime
5091@findex mh-mh-to-mime-undo
5092@kindex C-c C-e
5093@kindex C-c C-m C-u
5094@kindex C-c C-m u
5095
5096If you're using MH-style directives, use @kbd{C-c C-e}
5097(@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5098command @command{mhbuild} (@command{mhn}) on the message which expands
5099the tags@footnote{See the section
5100@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
5101the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5102(@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5103file. You are prompted to confirm this action, but you can avoid the
5104confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5105C-u}).
5106
5107@vindex mh-mh-to-mime-args
5108
5109If you wish to pass additional arguments to @command{mhbuild}
5110(@command{mhn}) to affect how it builds your message, use the option
5111@code{mh-mh-to-mime-args}. For example, you can build a consistency
5112check into the message by setting @code{mh-mh-to-mime-args} to
5113@samp{-check}. The recipient of your message can then run
5114@samp{mhbuild -check} on the message---@command{mhbuild}
5115(@command{mhn}) will complain if the message has been corrupted on the
5116way. The command @kbd{C-c C-e} (@code{mh-mh-to-mime}) only consults
5117this option when given a prefix argument (as in @kbd{C-u C-c C-e}).
5118
5119@vindex mh-mh-to-mime-hook
5120
5121The hook @code{mh-mh-to-mime-hook} is called after the message has
5122been formatted by @kbd{C-c C-e} (@code{mh-mh-to-mime})
5123
5124@node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5125@section Signing and Encrypting Messages
5126
5127@cindex signing messages
5128@cindex encrypting messages
5129@cindex RFC 3156
5130
5131MH-E can sign and encrypt messages as defined in
5132@uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5133should choose to sign or encrypt your message, use one of the
5134following commands to do so any time before sending your message.
5135
5136@findex mh-mml-secure-message-encrypt
5137@findex mh-mml-secure-message-sign
5138@findex mh-mml-secure-message-signencrypt
5139@kindex C-c C-m C-e
5140@kindex C-c C-m C-s
5141@kindex C-c C-m e e
5142@kindex C-c C-m e s
5143@kindex C-c C-m s e
5144@kindex C-c C-m s s
5145
5146The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5147inserts the following tag:
1990 5148
1991@cindex setting variables 5149@example
1992@cindex Emacs, setting variables 5150<#secure method=pgpmime mode=sign>
5151@end example
1993 5152
1994Variables can also hold Boolean values. In Emacs Lisp, the Boolean 5153This is used to sign your message digitally. Likewise, the command
1995values are @code{nil}, which means false, and @code{t}, which means true. 5154@kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
1996Usually, variables are turned off by setting their value to @code{nil}, as 5155following tag:
1997in
1998 5156
1999@vindex @code{mh-bury-show-buffer}, example 5157@example
5158<#secure method=pgpmime mode=encrypt>
5159@end example
2000 5160
2001@lisp 5161This is used to encrypt your message. Finally, the command @kbd{C-c
2002(setq mh-bury-show-buffer nil) 5162C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
2003@end lisp 5163following tag:
2004 5164
2005which keeps the MH-Show buffer at the top of the buffer stack. 5165@example
2006To turn a variable on, you use 5166<#secure method=pgpmime mode=signencrypt>
5167@end example
2007 5168
2008@lisp 5169@findex mh-mml-unsecure-message
2009(setq mh-bury-show-buffer t) 5170@kindex C-c C-m C-n
2010@end lisp 5171@kindex C-c C-m n
2011 5172
2012which places the MH-Show buffer at the bottom of the buffer 5173This is used to sign and encrypt your message. In each of these cases,
2013stack. However, the text says to turn on a variable by setting it to a 5174a proper multipart message is created for you when you send the
2014@emph{non-@code{nil}} value, because sometimes values other than @code{t} are 5175message. Use the command @kbd{C-c C-m C-n}
2015meaningful (for example, see @code{mhl-formfile}, described in 5176(@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
2016@ref{Customizing Viewing}). Other variables, such as hooks, involve a 5177argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
2017little more Emacs Lisp programming expertise. 5178possible security methods (see @code{mh-mml-method-default}).
2018 5179
2019You can also ``preview'' the effects of changing variables before 5180@vindex mh-mml-method-default
2020committing the changes to @file{~/.emacs}. Variables can be changed in
2021the current Emacs session by using @kbd{M-x set-variable}.
2022 5181
2023@c XXX Stephen says: would be easier to just call them functions, which 5182The option @code{mh-mml-method-default} is used to select between a
2024@c you mostly do. 5183variety of mail security mechanisms. The default is @samp{PGP (MIME)}
2025In general, @dfn{commands} in this text refer to Emacs Lisp functions. 5184if it is supported; otherwise, the default is @samp{None}. Other
2026Programs outside of Emacs are specifically called MH commands, shell 5185mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
2027commands, or Unix commands.
2028 5186
2029@cindex Emacs, Emacs Lisp manual 5187@cindex @samp{pgg} customization group
2030@cindex Emacs, online help 5188@cindex PGG
2031@cindex online help 5189@cindex customization group, @samp{pgg}
2032@cindex Emacs, info
2033@cindex info
2034 5190
2035I hope I've included enough examples here to get you well on your way. 5191The @samp{pgg} customization group may have some settings which may
2036If you want to explore Emacs Lisp further, a programming manual does 5192interest you.
2037exist,
2038@c Yes, some of the stuff in the following sections is redundant, but
2039@c TeX barfs if the @ifs are inside the @footnote.
2040@iftex 5193@iftex
2041@footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available 5194See @cite{The PGG Manual}.
2042online in the Info system by typing @kbd{C-h i m Emacs Lisp RET}. If
2043not, you can order a printed manual, which has the desirable side-effect
2044of helping to support the Free Software Foundation which made all this
2045great software available. You can find an order form by running
2046@kbd{C-h C-d}, or you can request an order form from
2047@i{gnu@@gnu.org}.}
2048@end iftex 5195@end iftex
2049@ifinfo 5196@ifinfo
2050@footnote{Perhaps you can find the online version of @ref{Top, The GNU 5197@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2051Emacs Lisp Reference Manual, , elisp, GNU Emacs Lisp Reference Manual}.
2052If not, you can order a printed manual, which has the desirable
2053side-effect of helping to support the Free Software Foundation which
2054made all this great software available. You can find an order form by
2055running @kbd{C-h C-d}, or you can request an order form from
2056@i{gnu@@gnu.org}.}
2057@end ifinfo 5198@end ifinfo
2058and you can look at the code itself for examples. Look in the Emacs 5199@ifhtml
2059Lisp directory on your system (such as @file{/usr/local/lib/emacs/lisp}) 5200See
2060and find all the @file{mh-*.el} files there. When calling mh-e and 5201@uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2061other Emacs Lisp functions directly from Emacs Lisp code, you'll need to 5202@cite{The PGG Manual}}.
2062know the correct arguments. Use the online help for this. For example, 5203@end ifhtml
2063try @kbd{C-h f mh-execute-commands RET}. If you write your own 5204
2064functions, please do not prefix your symbols (variables and functions) 5205@cindex @samp{Fcc:} header field
2065with @code{mh-}. This prefix is reserved for the mh-e package. To 5206@cindex header field, @samp{Fcc:}
2066avoid conflicts with existing mh-e symbols, use a prefix like @code{my-} 5207@vindex pgg-encrypt-for-me
2067or your initials. 5208
2068 5209In particular, I turn on the option @code{pgg-encrypt-for-me} so that
2069@menu 5210all messages I encrypt are encrypted with my public key as well. If
2070* Customizing Reading:: 5211you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
2071* Customizing Sending:: 5212field, this setting is vital so that you can read the mail you write!
2072* Customizing Draft Editing:: 5213
2073* Customizing Moving Mail:: 5214@node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
2074* Customizing Searching:: 5215@section Checking Recipients
2075@end menu 5216
5217@cindex @samp{*MH-E Recipients*}
5218@cindex @command{whom}
5219@cindex MH commands, @command{whom}
5220@cindex buffers, @samp{*MH-E Recipients*}
5221@cindex checking recipients
5222@cindex recipients, checking
5223@findex mh-check-whom
5224@kindex C-c C-w
5225
5226The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5227you can check the actual address(es) in the alias. A new buffer named
5228@samp{*MH-E Recipients*} is created with the output of @command{whom}
5229(@pxref{Miscellaneous})@footnote{See the section
5230@uref{@value{MH-BOOK-HOME}/senove.htm#WhaPro, What now? -- and the
5231whatnow Program} in the MH book.}.
5232
5233@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5234@section Sending a Message
5235
5236@cindex @samp{*MH-E Mail Delivery*}
5237@cindex buffers, @samp{*MH-E Mail Delivery*}
5238@cindex sending mail
5239@findex mh-send-letter
5240@kindex C-c C-c
2076 5241
2077@node Customizing Reading, Customizing Sending, Customizing mh-e, Customizing mh-e 5242When you are all through editing a message, you send it with the
2078@section Reading Your Mail 5243command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5244argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5245delivery; this output can be found in a buffer called @samp{*MH-E Mail
5246Delivery*} (@pxref{Miscellaneous}).
2079 5247
2080@cindex reading mail 5248@cindex sending mail
2081@cindex @file{.emacs} 5249@cindex spell check
2082@cindex files, @file{.emacs} 5250@vindex mh-before-send-letter-hook
2083 5251
2084I'll start out by including a function that I use as a front end to 5252The hook @code{mh-before-send-letter-hook} is run at the beginning of
2085mh-e. @footnote{Stephen Gildea's favorite binding is 5253the command @kbd{C-c C-c}. For example, if you want to check your
2086@kbd{(global-set-key "\C-cr" 'mh-rmail)}.} It toggles between your 5254spelling in your message before sending, add the function
2087working window configuration, which may be quite involved---windows 5255@code{ispell-message}.
2088filled with source, compilation output, man pages, and other
2089documentation---and your mh-e window configuration. Like the rest of
2090the customization described in this chapter, simply add the following
2091code to @file{~/.emacs}. Don't be intimidated by the size of this
2092example; most customizations are only one line.
2093 5256
2094@iftex 5257@cindex @command{send}
2095@filbreak 5258@cindex MH commands, @command{send}
2096@end iftex 5259@vindex mh-send-prog
2097 5260
2098@findex @code{mh-rmail}, example 5261In case the MH @command{send} program@footnote{See the section
5262@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
5263in the MH book.} is installed under a different name, use
5264@code{mh-send-prog} to tell MH-E the name.
2099 5265
2100@lisp 5266@node Killing Draft, , Sending Message, Editing Drafts
2101@group 5267@section Killing the Draft
2102@i{Starting mh-e}
2103 5268
2104(defvar my-mh-screen-saved nil 5269@cindex killing draft
2105 "Set to non-@code{nil} when mh-e window configuration shown.") 5270@findex kill-buffer
2106(defvar my-normal-screen nil "Normal window configuration.") 5271@findex mh-fully-kill-draft
2107(defvar my-mh-screen nil "mh-e window configuration.") 5272@kindex C-c C-q
5273@kindex C-x k
2108 5274
2109(defun my-mh-rmail (&optional arg) 5275If for some reason you are not happy with the draft, you can use the
2110 "Toggle between mh-e and normal screen configurations. 5276command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
2111With non-@code{nil} or prefix argument, @i{inc} mailbox as well 5277buffer and delete the draft message. Use the command @kbd{C-x k}
2112when going into mail." 5278(@code{kill-buffer}) if you don't want to delete the draft message.
2113 (interactive "P") ; @r{user callable function, P=prefix arg}
2114 (setq my-mh-screen-saved ; @r{save state}
2115 (cond
2116 ;; @r{Bring up mh-e screen if arg or normal window configuration.}
2117 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
2118 ((or arg (null my-mh-screen-saved))
2119 (setq my-normal-screen (current-window-configuration))
2120 (if (or arg (null (get-buffer "+inbox")))
2121 (mh-rmail)
2122 (set-window-configuration my-mh-screen))
2123 t) ; @r{set my-mh-screen-saved to @code{t}}
2124 ;; @r{Otherwise, save mh-e screen and restore normal screen.}
2125 (t
2126 (setq my-mh-screen (current-window-configuration))
2127 (set-window-configuration my-normal-screen)
2128 nil)))) ; @r{set my-mh-screen-saved to nil}
2129 5279
2130(global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x RET} 5280@node Aliases, Identities, Editing Drafts, Top
2131@end group 5281@chapter Aliases
2132@end lisp
2133 5282
2134If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} 5283@cindex aliases
2135is @code{nil} (meaning a non-mh-e window configuration), the current window
2136configuration is saved, either +inbox is displayed or @code{mh-rmail} is
2137run, and the mh-e window configuration is shown. Otherwise, the mh-e
2138window configuration is saved and the original configuration is
2139displayed.
2140 5284
2141Now to configure mh-e. The following table lists general mh-e variables 5285MH aliases are used in the same way in MH-E as they are in MH. Any
2142and variables that are used while reading mail. 5286alias listed as a recipient will be expanded when the message is sent.
2143@c XXX Seth wishes the descriptions to be more parallel. That is, 5287This chapter discusses other things you can do with aliases in MH-E.
2144@c some are actions, and some are objects. Hmmm.
2145 5288
2146@table @code 5289@cindex MH-Letter mode
2147@item mh-progs 5290@cindex modes, MH-Letter
2148Directory containing MH programs (default: dynamic).
2149 5291
2150@item mh-lib 5292The following commands are available in MH-Letter mode with the
2151Directory containing MH support files and programs (default: dynamic). 5293exception of @code{mh-alias-reload} which can be called from anywhere.
2152 5294
2153@item mh-do-not-confirm 5295@table @kbd
2154Don't confirm on non-reversible commands (default: @code{nil}). 5296@kindex @key{SPC}
5297@findex mh-letter-complete-or-space
5298@item @key{SPC}
5299Perform completion or insert space (@code{mh-letter-complete-or-space}).
5300@c -------------------------
5301@kindex M-@key{TAB}
5302@findex mh-letter-complete
5303@item M-@key{TAB}
5304Perform completion on header field or word preceding point
5305(@code{mh-letter-complete}).
5306@c -------------------------
5307@findex mh-alias-apropos
5308@item mh-alias-apropos
5309Show all aliases or addresses that match a regular expression.
5310@c -------------------------
5311@findex mh-alias-grab-from-field
5312@item mh-alias-grab-from-field
5313Add alias for the sender of the current message
5314@c -------------------------
5315@findex mh-alias-reload
5316@item mh-alias-reload
5317Reload MH aliases.
5318@end table
2155 5319
2156@item mh-summary-height 5320@cindex @samp{mh-alias} customization group
2157Number of scan lines to show (includes mode line) (default: 4). 5321@cindex customization group, @samp{mh-alias}
5322
5323The @samp{mh-alias} customization group contains options associated
5324with aliases.
5325
5326@vtable @code
5327@item mh-alias-completion-ignore-case-flag
5328On means don't consider case significant in MH alias completion
5329(default: @samp{on}).
5330@c -------------------------
5331@item mh-alias-expand-aliases-flag
5332On means to expand aliases entered in the minibuffer (default:
5333@samp{off}).
5334@c -------------------------
5335@item mh-alias-flash-on-comma
5336Specify whether to flash address or warn on translation (default: @samp{Flash
5337but Don't Warn If No Alias}).
5338@c -------------------------
5339@item mh-alias-insert-file
5340Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5341Profile Component}).
5342@c -------------------------
5343@item mh-alias-insertion-location
5344Specifies where new aliases are entered in alias files (default:
5345@samp{Alphabetical}).
5346@c -------------------------
5347@item mh-alias-local-users
5348If @samp{on}, local users are added to alias completion (default:
5349@samp{on}).
5350@c -------------------------
5351@item mh-alias-local-users-prefix
5352String prefixed to the real names of users from the password file
5353(default: @samp{"local."}.
5354@c -------------------------
5355@item mh-alias-passwd-gecos-comma-separator-flag
5356On means the GECOS field in the password file uses a comma separator
5357(default: @samp{on}).
5358@end vtable
5359
5360The following hook is available.
5361
5362@vtable @code
5363@item mh-alias-reloaded-hook
5364Hook run by @code{mh-alias-reload} after loading aliases (default:
5365@code{nil}).
5366@end vtable
5367
5368@heading Adding Addresses to Draft
5369
5370You can use aliases when you are adding recipients to a message.
5371
5372@findex minibuffer-complete
5373@kindex @key{TAB}
5374
5375In order to use minibuffer prompting for recipients and the subject
5376line in the minibuffer, turn on the option
5377@code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5378@key{TAB} (@code{minibuffer-complete}) command to complete aliases
5379(and optionally local logins) when prompted for the recipients. Turn
5380on the option @code{mh-alias-expand-aliases-flag} if you want these
5381aliases to be expanded to their respective addresses in the draft.
5382
5383Otherwise, you can complete aliases in the header of the draft with
5384@kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5385(@code{mh-letter-complete-or-space}).
5386
5387As MH ignores case in the aliases, so too does MH-E. However, you may
5388turn off the option @code{mh-alias-completion-ignore-case-flag} to
5389make case significant which can be used to segregate completion of
5390your aliases. You might use uppercase for mailing lists and lowercase
5391for people. For example, you might have:
2158 5392
2159@item mh-folder-mode-hook 5393@example
2160Functions to run in MH-Folder mode (default: @code{nil}). 5394mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5395MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5396@end example
2161 5397
2162@item mh-clean-message-header 5398When this option is turned off, if you were to type @kbd{M} in the
2163Remove extraneous headers (default: @code{nil}). 5399@samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5400if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5401you'd get Mark's address. Note that this option affects completion
5402only. If you were to enter @kbd{Mark.Baushke}, it would still be
5403identified with your @samp{mark.baushke} alias.
5404
5405To verify that the alias you've entered is valid, the alias will be
5406displayed in the minibuffer when you type a comma
5407(@code{mh-letter-confirm-address} or
5408@code{mh-alias-minibuffer-confirm-address} if the option
5409@code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5410behavior can be controlled with the option
5411@code{mh-alias-flash-on-comma} which provides three choices:
5412@samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5413Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5414
5415For another way to verify the alias expansion, see @ref{Checking
5416Recipients}.
5417
5418@heading Loading Aliases
5419
5420@cindex @command{ali}
5421@cindex @file{/etc/nmh/MailAliases}
5422@cindex @samp{Aliasfile:} MH profile component
5423@cindex MH commands, @command{ali}
5424@cindex MH profile component, @samp{Aliasfile:}
5425@cindex files, @file{/etc/nmh/MailAliases}
5426
5427MH-E loads aliases for completion and folder name hints from various
5428places. It uses the MH command @command{ali}@footnote{See the section
5429@uref{@value{MH-BOOK-HOME}/mh.htm, MH Aliases} in the MH book.} to
5430read aliases from the files listed in the profile component
5431@samp{Aliasfile:} as well as system-wide aliases (for example,
5432@file{/etc/nmh/MailAliases}).
5433
5434@cindex @file{/etc/passwd}
5435@cindex files, @file{/etc/passwd}
5436
5437In addition, aliases are created from @file{/etc/passwd} entries with
5438a user ID larger than a magical number, typically 200. This can be a
5439handy tool on a machine where you and co-workers exchange messages.
5440These aliases have the form @samp{local.@var{first.last}} if a real
5441name is present in the password file. Otherwise, the alias will have
5442the form @samp{local.@var{login}}.
5443
5444The prefix @samp{local.} can be modified via the option
5445@code{mh-alias-local-users-prefix}. This option can also be set to
5446@samp{Use Login}.
5447
5448For example, consider the following password file entry:
2164 5449
2165@item mh-invisible-headers 5450@example
2166Headers to hide (default: @samp{"^Received: \\| ^Message-Id: \\| 5451psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
2167^Remailed-\\| ^Via: \\| ^Mail-from: \\| ^Return-Path: \\| ^In-Reply-To: 5452@end example
2168\\| ^Resent-"}).
2169 5453
2170@item mh-visible-headers 5454The following settings of option @code{mh-alias-local-users-prefix}
2171Headers to display (default: @code{nil}). 5455will produce the associated aliases:
2172 5456
2173@item mhl-formfile 5457@table @code
2174Format file for @code{mhl} (default: @code{nil}). 5458@item "local."
5459local.peter.galbraith
5460@c -------------------------
5461@item ""
5462peter.galbraith
5463@c -------------------------
5464@item Use Login
5465psg
5466@end table
2175 5467
2176@item mh-show-hook 5468In the example above, commas are used to separate different values
2177Functions to run when showing message (default: @code{nil}). 5469within the so-called GECOS field. This is a fairly common usage.
5470However, in the rare case that the GECOS field in your password file
5471is not separated by commas and whose contents may contain commas, you
5472can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5473off.
5474
5475@cindex @samp{ypcat passwd}
5476@cindex NIS, obtaining local aliases from
5477
5478If you're on a system with thousands of users you don't know, and the
5479loading of local aliases slows MH-E down noticeably, then the local
5480alias feature can be disabled by turning off the option
5481@code{mh-alias-local-users}. This option also takes a string which is
5482executed to generate the password file. For example, use @samp{ypcat
5483passwd} to obtain the NIS password file.
5484
5485Since aliases are updated frequently, MH-E reloads aliases
5486automatically whenever an alias lookup occurs if an alias source has
5487changed. However, you can reload your aliases manually by calling the
5488command @kbd{M-x mh-alias-reload} directly. This command runs
5489@code{mh-alias-reloaded-hook} after the aliases have been loaded.
5490
5491@heading Adding Aliases
5492
5493In the past, you have manually added aliases to your alias file(s)
5494listed in your @samp{Aliasfile:} profile component. MH-E provides
5495other methods for maintaining your alias file(s).
5496
5497You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5498you for the alias and address that you would like to add. If the alias
5499exists already, you will have the choice of inserting the new alias
5500before or after the old alias. In the former case, this alias will be
5501used when sending mail to this alias. In the latter case, the alias
5502serves as an additional folder name hint when filing messages
5503(@pxref{Folder Selection}).
5504
5505Earlier, the alias prefix @samp{local} was presented. You can use
5506other prefixes to organize your aliases or disambiguate entries. You
5507might use prefixes for locales, jobs, or activities. For example, I
5508have:
2178 5509
2179@item mh-show-mode-hook 5510@example
2180Functions to run when showing message (default: @code{nil}). 5511; Work
5512attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5513isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5514...
5515; Sport
5516diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5517sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5518...
5519; Personal
5520ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5521...
5522@end example
2181 5523
2182@item mh-bury-show-buffer 5524Using prefixes instead of postfixes helps you explore aliases during
2183Leave show buffer at bottom of stack (default: @code{t}). 5525completion. If you forget the name of an old dive buddy, you can enter
5526@samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5527
5528An alias for the sender of the current message is added automatically
5529by clicking on the @samp{Grab From alias} tool bar button or by running
5530the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5531recipients of the current message are added by placing your cursor
5532over the desired recipient and giving the @kbd{M-x
5533mh-alias-add-address-under-point} command.
5534
5535The options @code{mh-alias-insert-file} and
5536@code{mh-alias-insertion-location} controls how and where these aliases
5537are inserted.
5538
5539The default setting of this option is @samp{Use Aliasfile Profile
5540Component}. This option can also hold the name of a file or a list a
5541file names. If this option is set to a list of file names, or the
5542@samp{Aliasfile:} profile component contains more than one file name,
5543MH-E will prompt for one of them.
5544
5545The option @code{mh-alias-insertion-location} is set to
5546@samp{Alphabetical} by default. If you organize your alias file in
5547other ways, then the settings @samp{Top} and @samp{Bottom} might be
5548more appropriate.
5549
5550@heading Querying Aliases
5551
5552@cindex regular expressions, @code{mh-alias-apropos}
5553
5554If you can't quite remember an alias, you can use @kbd{M-x
5555mh-alias-apropos} to show all aliases or addresses that match a
5556regular expression
5557@ifnothtml
5558(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5559GNU Emacs Manual}).
5560@end ifnothtml
5561@ifhtml
5562(see the section
5563@uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5564Syntax of Regular Expressions} in
5565@cite{The GNU Emacs Manual}).
5566@end ifhtml
5567
5568@node Identities, Speedbar, Aliases, Top
5569@chapter Identities
5570
5571@cindex identities
5572@cindex multiple personalities
5573
5574MH-E supports the concept of multiple personalities or identities.
5575This means that you can easily have a different header and signature
5576at home and at work.
5577
5578A couple of commands are used to insert identities in MH-Letter mode
5579which are also found in the @samp{Identity} menu.
2184 5580
2185@item mh-show-buffer-mode-line-buffer-id 5581@table @kbd
2186Name of show buffer in mode line (default: @samp{"@{show-%s@} %d"}). 5582@kindex C-c C-d
5583@findex mh-insert-identity
5584@item C-c C-d
5585Insert fields specified by given identity (@code{mh-insert-identity}).
5586@c -------------------------
5587@cindex @samp{Identity > Insert Auto Fields} menu item
5588@cindex menu item, @samp{Identity > Insert Auto Fields}
5589@kindex C-c M-d
5590@findex mh-insert-auto-fields
5591@item C-c M-d
5592Insert custom fields if recipient found in @code{mh-auto-fields-list}
5593(@code{mh-insert-auto-fields}).
2187@end table 5594@end table
2188 5595
2189@vindex @code{mh-progs} 5596@cindex @samp{mh-identity} customization group
2190@vindex @code{mh-lib} 5597@cindex customization group, @samp{mh-identity}
2191 5598
2192The two variables @code{mh-progs} and @code{mh-lib} are used to tell 5599The @samp{mh-identity} customization group contains the following
2193mh-e where the MH programs and supporting files are kept, respectively. 5600options.
2194mh-e does try to figure out where they are kept for itself by looking in
2195common places and in the user's @samp{PATH} environment variable, but if
2196it cannot find the directories, or finds the wrong ones, you should set
2197these variables. The name of the directory should be placed in double
2198quotes, and there should be a
2199trailing slash (@samp{/}). See the example in @ref{Getting Started}.
2200 5601
2201@vindex @code{mh-do-not-confirm} 5602@vtable @code
2202@findex @code{mh-kill-folder} 5603@item mh-auto-fields-list
5604List of recipients for which header lines are automatically inserted
5605(default: @code{nil}).
5606@c -------------------------
5607@item mh-auto-fields-prompt-flag
5608On means to prompt before sending if fields inserted (default:
5609@samp{on})
5610@c -------------------------
5611@item mh-identity-default
5612Default identity to use when @code{mh-letter-mode} is called (default:
5613@samp{None}).
5614@c -------------------------
5615@item mh-identity-handlers
5616Handler functions for fields in @code{mh-identity-list}.
5617@c -------------------------
5618@item mh-identity-list
5619List of identities (default: @code{nil}).
5620@end vtable
5621
5622Some of the common header fields that people change depending on the
5623context are the @samp{From:} and @samp{Organization:} fields, as well
5624as the signature.
5625
5626This is done by customizing the option @code{mh-identity-list}. In the
5627customization buffer for this option, click on the @samp{INS} button
5628and enter a label such as @samp{Home} or @samp{Work}. Then click on
5629the @samp{INS} button with the label @samp{Add at least one item
5630below}. The @samp{Value Menu} has the following menu items:
5631
5632@table @samp
5633@cindex header field, @samp{From:}
5634@cindex @samp{From:} header field
5635@item From Field
5636Specify an alternate @samp{From:} header field. You must include a
5637valid email address. A standard format is @samp{First Last
5638<login@@host.domain>}. If you use an initial with a period, then you
5639must quote your name as in @samp{"First I. Last"
5640<login@@host.domain>}.
5641@c -------------------------
5642@cindex header field, @samp{Organization:}
5643@cindex @samp{Organization:} header field
5644@item Organization Field
5645People usually list the name of the company where they work here.
5646@c -------------------------
5647@item Other Field
5648Set any arbitrary header field and value here. Unless the header field
5649is a standard one, precede the name of your field's label with
5650@samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
5651@c -------------------------
5652@item Attribution Verb
5653This value overrides the setting of
5654@code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
5655@c -------------------------
5656@cindex signature
5657@vindex mh-signature-file-name
5658@item Signature
5659Set your signature with this item. You can specify the contents of
5660@code{mh-signature-file-name}, a file, or a function.
5661@xref{Signature}.
5662@c -------------------------
5663@item GPG Key ID
5664Specify a different key to sign or encrypt messages.
5665@end table
2203 5666
2204If you never make mistakes, and you do not like confirmations for your 5667@cindex Identity menu
2205actions, you can set @code{mh-do-not-confirm} to a non-@code{nil} value to 5668@cindex menu, Identity
2206disable confirmation for unrecoverable commands such as @kbd{M-k} 5669
2207(@code{mh-kill-folder}) and @kbd{M-u} (@code{mh-undo-folder}). Here's 5670You can select the identities you have added via the menu called
2208how you set boolean values: 5671@samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
5672C-d} (@code{mh-insert-identity}). To clear the fields and signature
5673added by the identity, select the @samp{None} identity.
5674
5675@cindex @samp{Identity > Save as Default} menu item
5676@cindex menu item, @samp{Identity > Save as Default}
5677@cindex @samp{Identity > Set Default for Session} menu item
5678@cindex menu item, @samp{Identity > Set Default for Session}
5679@cindex @samp{Identity > Customize Identities} menu item
5680@cindex menu item, @samp{Identity > Customize Identities}
5681
5682The @samp{Identity} menu contains two other items to save you from
5683having to set the identity on every message. The menu item @samp{Set
5684Default for Session} can be used to set the default identity to the
5685current identity until you exit Emacs. The menu item @samp{Save as
5686Default} sets the option @code{mh-identity-default} to the current
5687identity setting. You can also customize the option
5688@code{mh-identity-default} in the usual fashion. If you find that you
5689need to add another identity, the menu item @samp{Customize
5690Identities} is available for your convenience.
5691
5692@cindex regular expressions, @code{mh-auto-fields-list}
5693
5694The option @code{mh-auto-fields-list} can also be used to set the
5695identity depending on the recipient to provide even more control. To
5696customize @code{mh-auto-fields-list}, click on the @samp{INS} button
5697and enter a regular expression for the recipient's address
5698@ifnothtml
5699(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5700GNU Emacs Manual}).
5701@end ifnothtml
5702@ifhtml
5703(see the section
5704@uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5705Syntax of Regular Expressions} in
5706@cite{The GNU Emacs Manual}).
5707@end ifhtml
5708Click on the @samp{INS} button with the @samp{Add at least one item
5709below} label. The @samp{Value Menu} contains the following menu items:
5710
5711@table @samp
5712@item Identity
5713Select an identity from those configured in @code{mh-identity-list}.
5714All of the information for that identity will be added if the
5715recipient matches.
5716@c -------------------------
5717@cindex @samp{Fcc:} header field
5718@cindex header field, @samp{Fcc:}
5719@item Fcc Field
5720Insert an @samp{Fcc:} header field with the folder you provide. When
5721you send the message, MH will put a copy of your message in this
5722folder.
5723@c -------------------------
5724@cindex @samp{Mail-Followup-To:} header field
5725@cindex header field, @samp{Mail-Followup-To:}
5726@item Mail-Followup-To Field
5727Insert an @samp{Mail-Followup-To:} header field with the recipients
5728you provide. If the recipient's mail user agent supports this header
5729field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
5730their replies will go to the addresses listed. This is useful if their
5731replies go both to the list and to you and you don't have a mechanism
5732to suppress duplicates. If you reply to someone not on the list, you
5733must either remove the @samp{Mail-Followup-To:} field, or ensure the
5734recipient is also listed there so that he receives replies to your
5735reply.
5736@c -------------------------
5737@item Other Field
5738Other header fields may be added using this menu item.
5739@end table
2209 5740
2210@lisp 5741These fields can only be added after the recipient is known. Because
2211(setq mh-do-not-confirm t) 5742you can continue to add recipients as you edit the draft, MH-E waits
2212@end lisp 5743until the message is sent to perform the auto-insertions. This seems
5744strange at first, but you'll get used to it. There are two ways to
5745help you feel that the desired fields are added. The first is the
5746action when the message is sent: if any fields are added
5747automatically, you are given a chance to see and to confirm these
5748fields before the message is actually sent. You can do away with this
5749confirmation by turning off the option
5750@code{mh-auto-fields-prompt-flag}. The second method is manual: once
5751the header contains one or more recipients, you may run the command
5752@kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
5753@samp{Identity -> Insert Auto Fields} menu item to insert these fields
5754manually. However, if you use this command, the automatic insertion
5755when the message is sent is disabled.
5756
5757You should avoid using the same header field in
5758@code{mh-auto-fields-list} and @code{mh-identity-list} definitions
5759that may apply to the same message as the result is undefined.
5760
5761The option @code{mh-identity-handlers} is used to change the way that
5762fields, signatures, and attributions in @code{mh-identity-list} are
5763added. To customize @code{mh-identity-handlers}, replace the name of
5764an existing handler function associated with the field you want to
5765change with the name of a function you have written. You can also
5766click on an @samp{INS} button and insert a field of your choice and
5767the name of the function you have written to handle it.
5768
5769The @samp{Field} field can be any field that you've used in your
5770@code{mh-identity-list}. The special fields @samp{:attribution-verb},
5771@samp{:signature}, or @samp{:pgg-default-user-id} are used for the
5772@code{mh-identity-list} choices @samp{Attribution Verb},
5773@samp{Signature}, and @samp{GPG Key ID} respectively.
5774
5775The handler associated with the @samp{:default} field is used when no
5776other field matches.
5777
5778The handler functions are passed two or three arguments: the field
5779itself (for example, @samp{From}), or one of the special fields (for
5780example, @samp{:signature}), and the action @samp{'remove} or
5781@samp{'add}. If the action is @samp{'add}, an additional argument
5782containing the value for the field is given.
5783
5784@node Speedbar, Menu Bar, Identities, Top
5785@chapter The Speedbar
5786
5787@cindex folder navigation
5788@cindex speedbar
5789
5790You can also use the speedbar
5791@ifnothtml
5792(@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
5793@end ifnothtml
5794@ifhtml
5795(see the section
5796@uref{http://www.gnu.org/software/emacs/manual/html_node/Speedbar.html,
5797Speedbar Frames} in @cite{The GNU Emacs Manual})
5798@end ifhtml
5799to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
5800@key{RET}}. You will see a new frame appear with all of your MH
5801folders. Folders with unseen messages appear in boldface. Click on a
5802folder name with @kbd{Mouse-2} to visit that folder in a similar
5803fashion to the command @kbd{F v} (@code{mh-visit-folder})
5804(@pxref{Folders}). Click on the @samp{+} icon to expand and view the
5805sub-folders of that folder.
5806
5807The speedbar can be manipulated with the keyboard as well. Use the
5808Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
5809the cursor over the desired folder and then use the shortcuts for the
5810menu items listed in the table below.
5811
5812@table @samp
5813@findex mh-speed-view
5814@item Visit Folder (@key{RET})
5815Visits the selected folder just as if you had used @kbd{F v}
5816(@code{mh-speed-view}).
5817@c -------------------------
5818@findex mh-speed-expand-folder
5819@item Expand Nested Folders (@kbd{+})
5820Expands the selected folder in the speedbar, exposing the children
5821folders inside it (@code{mh-speed-expand-folder}).
5822@c -------------------------
5823@findex mh-speed-contract-folder
5824@item Contract Nested Folders (@kbd{-})
5825Contracts or collapses the selected folder in the speedbar, hiding the
5826children folders inside it (@code{mh-speed-contract-folder}).
5827@c -------------------------
5828@findex mh-speed-refresh
5829@item Refresh Speedbar (@kbd{r})
5830Regenerates the list of folders in the speedbar. Run this command if
5831you've added or deleted a folder, or want to update the unseen message
5832count before the next automatic update (@code{mh-speed-refresh}).
5833@end table
2213 5834
2214@vindex @code{mh-summary-height} 5835You can click on @kbd{Mouse-3} to bring up a context menu that
5836contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
5837(@code{delete-frame}).
5838
5839@cindex @command{flists}
5840@cindex MH commands, @command{flists}
5841@cindex @samp{mh-speedbar} customization group
5842@cindex customization group, @samp{mh-speedbar}
5843
5844The MH-E speedbar uses the MH command @command{flists}@footnote{See
5845the section @uref{@value{MH-BOOK-HOME}/morseq.htm#flist, Searching for
5846Sequences with flist} in the MH book.} to generate the list of
5847folders. The @samp{mh-speedbar} customization group contains the
5848following option which controls how often the speedbar calls
5849@command{flists}.
5850
5851@vtable @code
5852@item mh-speed-update-interval
5853Time between speedbar updates in seconds (default: 60). Set to 0 to
5854disable automatic update.
5855@end vtable
5856
5857You can modify the appearance of the folders in the speedbar by
5858customizing the following faces.
5859
5860@vtable @code
5861@item mh-speedbar-folder
5862Basic folder face.
5863@c -------------------------
5864@item mh-speedbar-folder-with-unseen-messages
5865Folder face when folder contains unread messages.
5866@c -------------------------
5867@item mh-speedbar-selected-folder
5868Selected folder face.
5869@c -------------------------
5870@item mh-speedbar-selected-folder-with-unseen-messages
5871Selected folder face when folder contains unread messages.
5872@end vtable
5873
5874@node Menu Bar, Tool Bar, Speedbar, Top
5875@chapter The Menu Bar
5876
5877@cindex menu bar
5878
5879@cindex Folder menu
5880@cindex Identity menu
5881@cindex Letter menu
2215@cindex MH-Folder mode 5882@cindex MH-Folder mode
5883@cindex MH-Letter mode
5884@cindex MH-Search mode
5885@cindex Message menu
5886@cindex Search menu
5887@cindex Sequence menu
5888@cindex menu, Folder
5889@cindex menu, Identity
5890@cindex menu, Letter
5891@cindex menu, Message
5892@cindex menu, Search
5893@cindex menu, Sequence
2216@cindex modes, MH-Folder 5894@cindex modes, MH-Folder
5895@cindex modes, MH-Letter
5896@cindex modes, MH-Search
5897
5898For those of you who prefer to mouse and menu instead of using the
5899meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
5900functions. The MH-Folder buffer adds the @samp{Folder},
5901@samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
5902the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
5903the @samp{Search} menu. There's no need to list the actual items here,
5904as you can more easily see them for yourself, and the functions are
5905already described elsewhere in this manual.
5906
5907For a description of the menu bar, please
5908@ifnothtml
5909@xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
5910@end ifnothtml
5911@ifhtml
5912see the section
5913@uref{http://www.gnu.org/software/emacs/manual/html_node/Menu-Bar.html,
5914The Menu Bar} in @cite{The GNU Emacs Manual}.
5915@end ifhtml
5916
5917The Emacs manual describes how to get online help for a particular
5918menu item. You can also look up a menu item in the index of this
5919manual in two ways: all of the menu items are listed alphabetically,
5920and you can also browse all of the items under the index entry
5921@samp{menu item}.
5922
5923@node Tool Bar, Searching, Menu Bar, Top
5924@chapter The Tool Bar
5925
5926@cindex tool bar
5927@cindex @samp{mh-tool-bar} customization group
5928@cindex customization group, @samp{mh-tool-bar}
5929
5930Emacs also provides a graphical tool bar. For a description of the
5931tool bar, please
5932@ifnothtml
5933@xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
5934@end ifnothtml
5935@ifhtml
5936see the section
5937@uref{http://www.gnu.org/software/emacs/manual/html_node/Tool-Bars.html,
5938Tool Bars} in @cite{The GNU Emacs Manual}.
5939@end ifhtml
5940
5941MH-E adds several icons to this tool bar; you can modify the MH-E
5942aspects of the tool bar via the @samp{mh-tool-bar} customization group.
5943
5944@vtable @code
5945@item mh-tool-bar-folder-buttons
5946List of buttons to include in MH-Folder tool bar (default: a checklist
5947too long to list here).
5948@c -------------------------
5949@item mh-tool-bar-letter-buttons
5950List of buttons to include in MH-Letter tool bar (default: a checklist
5951too long to list here).
5952@c -------------------------
5953@item mh-tool-bar-search-function
5954Function called by the tool bar search button (default:
5955@code{mh-search}).
5956@c -------------------------
5957@item mh-xemacs-tool-bar-position
5958Tool bar location (default: @samp{Same As Default Tool Bar}).
5959@c -------------------------
5960@item mh-xemacs-use-tool-bar-flag
5961If on, use tool bar (default: on, if supported).
5962@end vtable
5963
5964In GNU Emacs, icons for some of MH-E's functions are added to the tool
5965bar. In XEmacs, you have the opportunity to create a separate tool bar for
5966the MH-E icons.
5967
5968In either case, you can select which of these functions you'd like to
5969see by customizing the options @code{mh-tool-bar-folder-buttons} and
5970@code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
5971customizes the tool bar in MH-Folder mode and the latter in MH-Letter
5972mode. Both of these options present you with a list of functions;
5973check the functions whose icons you want to see and clear the check
5974boxes for those you don't.
5975
5976The function associated with the searching icon can be set via the
5977option @code{mh-tool-bar-search-function}. By default, this is set to
5978@code{mh-search}. @xref{Searching}. You can also choose @samp{Other
5979Function} from the @samp{Value Menu} and enter a function of your own
5980choosing.
5981
5982XEmacs provides a couple of extra options. The first,
5983@code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
5984icons at all. By default, this option is turned on if the window
5985system supports tool bars. If your system doesn't support tool bars,
5986then you won't be able to turn on this option.
5987
5988The second extra option is @code{mh-xemacs-tool-bar-position} which
5989controls the placement of the tool bar along the four edges of the
5990frame. You can choose from one of @samp{Same As Default Tool Bar},
5991@samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
5992variable is set to anything other than @samp{Same As Default Tool Bar}
5993and the default tool bar is in a different location, then two tool
5994bars will be displayed: the MH-E tool bar and the default tool bar."
5995
5996@node Searching, Threading, Tool Bar, Top
5997@chapter Searching Through Messages
2217 5998
2218@c Prevent page break between paragraph and example. 5999@cindex searching
2219@need 2000
2220The variable @code{mh-summary-height} controls the number of scan lines
2221displayed in the MH-Folder window, including the mode line. The
2222default value of 4 means that 3 scan lines are displayed. Here's how
2223you set numerical values:
2224 6000
2225@lisp 6001@findex mh-search
2226(setq mh-summary-height 2) ; @r{only show the current scan line} 6002@kindex F s
2227@end lisp
2228 6003
2229@vindex @code{mh-bury-show-buffer} 6004Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
2230@cindex MH-Folder mode 6005helps you find messages that lie buried in your folders
2231@cindex modes, MH-Folder 6006(@pxref{Folders}). This chapter covers this command in more detail.
6007Several commands are used to compose the search criteria and to start
6008searching. A couple of them can be found in the @samp{Search} menu.
2232 6009
2233Normally the buffer for displaying messages is buried at the bottom at 6010@table @kbd
2234the buffer stack. You may wish to disable this feature by setting 6011@kindex C-c ?
2235@code{mh-bury-show-buffer} to @code{nil}. One advantage of not burying the 6012@findex mh-help
2236show buffer is that one can delete the show buffer more easily in an 6013@item C-c ?
2237electric buffer list because of its proximity to its associated 6014Display cheat sheet for the MH-E commands (@code{mh-help}).
2238MH-Folder buffer. Try running @kbd{M-x electric-buffer-list} to 6015@c -------------------------
2239see what I mean. 6016@cindex @samp{Search > Perform Search} menu item
2240 6017@cindex menu item, @samp{Search > Perform Search}
2241@vindex @code{mh-folder-mode-hook} 6018@kindex C-c C-c
2242@cindex MH-Folder mode 6019@findex mh-index-do-search
2243@cindex modes, MH-Folder 6020@item C-c C-c
6021Find messages using @code{mh-search-program}
6022(@code{mh-index-do-search}).
6023@c -------------------------
6024@cindex @samp{Search > Search with pick} menu item
6025@cindex menu item, @samp{Search > Search with pick}
6026@kindex C-c C-p
6027@findex mh-pick-do-search
6028@item C-c C-p
6029Find messages using @command{pick} (@code{mh-pick-do-search}).
6030@c -------------------------
6031@kindex C-c ?
6032@findex mh-help
6033@item C-c ?
6034Display cheat sheet for the MH-E commands (@code{mh-help}).
6035@c -------------------------
6036@kindex C-c C-f C-a
6037@kindex C-c C-f a
6038@findex mh-to-field
6039@item C-c C-f a
6040@itemx C-c C-f C-a
6041Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6042@c -------------------------
6043@kindex C-c C-f C-b
6044@kindex C-c C-f b
6045@item C-c C-f b
6046@itemx C-c C-f C-b
6047Move to @samp{Bcc:} header field (@code{mh-to-field}).
6048@c -------------------------
6049@kindex C-c C-f C-c
6050@kindex C-c C-f c
6051@item C-c C-f c
6052@itemx C-c C-f C-c
6053Move to @samp{Cc:} header field (@code{mh-to-field}).
6054@c -------------------------
6055@kindex C-c C-f C-d
6056@kindex C-c C-f d
6057@item C-c C-f d
6058@itemx C-c C-f C-d
6059Move to @samp{Dcc:} header field (@code{mh-to-field}).
6060@c -------------------------
6061@kindex C-c C-f C-f
6062@kindex C-c C-f f
6063@item C-c C-f f
6064@itemx C-c C-f C-f
6065Move to @samp{Fcc:} header field (@code{mh-to-field}).
6066@c -------------------------
6067@kindex C-c C-f C-l
6068@kindex C-c C-f l
6069@item C-c C-f l
6070@itemx C-c C-f C-l
6071Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6072@c -------------------------
6073@kindex C-c C-f C-m
6074@kindex C-c C-f m
6075@item C-c C-f m
6076@itemx C-c C-f C-m
6077Move to @samp{From:} header field (@code{mh-to-field}).
6078@c -------------------------
6079@kindex C-c C-f C-r
6080@kindex C-c C-f r
6081@item C-c C-f r
6082@itemx C-c C-f C-r
6083Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6084@c -------------------------
6085@kindex C-c C-f C-s
6086@kindex C-c C-f s
6087@item C-c C-f s
6088@itemx C-c C-f C-s
6089Move to @samp{Subject:} header field (@code{mh-to-field}).
6090@c -------------------------
6091@kindex C-c C-f C-t
6092@kindex C-c C-f t
6093@item C-c C-f t
6094@itemx C-c C-f C-t
6095Move to @samp{To:} header field (@code{mh-to-field}).
6096@end table
2244 6097
2245The hook @code{mh-folder-mode-hook} is called when a new folder is 6098Another few commands are available in the MH-Folder buffer resulting
2246created with MH-Folder mode. This could be used to set your own 6099from a search.
2247key bindings, for example:
2248 6100
2249@vindex @code{mh-folder-mode-hook}, example 6101@table @kbd
6102@kindex @key{TAB}
6103@findex mh-index-next-folder
6104@item @key{TAB}
6105Jump to the next folder marker (@code{mh-index-next-folder}).
6106@c -------------------------
6107@kindex S-@key{TAB}
6108@findex mh-index-previous-folder
6109@item S-@key{TAB}
6110Jump to the previous folder marker (@code{mh-index-previous-folder}).
6111@c -------------------------
6112@kindex v
6113@findex mh-index-visit-folder
6114@item v
6115Visit original folder from where the message at point was found
6116(@code{mh-index-visit-folder}).
6117@end table
2250 6118
2251@lisp 6119@cindex @samp{mh-search} customization group
2252@group 6120@cindex customization group, @samp{mh-search}
2253@i{Create additional key bindings via mh-folder-mode-hook}
2254 6121
2255(defvar my-mh-init-done nil "Non-@code{nil} when one-time mh-e settings made.") 6122There is one option from the @samp{mh-search} customization group used
6123in searching.
2256 6124
2257(defun my-mh-folder-mode-hook () 6125@vtable @code
2258 "Hook to set key bindings in MH-Folder mode." 6126@item mh-search-program
2259 (if (not my-mh-init-done) ; @r{only need to bind the keys once } 6127Search program that MH-E shall use (default: @samp{Auto-detect}).
2260 (progn 6128@end vtable
2261 (local-set-key "/" 'search-msg)
2262 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
2263 (setq my-mh-init-done t))))
2264 6129
2265;;; @r{Emacs 19} 6130The following hook is available.
2266(add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
2267;;; @r{Emacs 18}
2268;;; @r{(setq mh-folder-mode-hook (cons 'my-mh-folder-mode-hook}
2269;;; @r{mh-folder-mode-hook))}
2270 6131
2271(defun search-msg () 6132@vtable @code
2272 "Search for a regexp in the current message." 6133@item mh-search-mode-hook
2273 (interactive) ; @r{user function} 6134Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
2274 (save-window-excursion 6135@end vtable
2275 (other-window 1) ; @r{go to next window}
2276 (isearch-forward-regexp))) ; @r{string search; hit return (ESC}
2277 ; @r{in Emacs 18) when done}
2278@end group
2279@end lisp
2280 6136
2281@menu 6137The following face is available.
2282* Customizing Viewing::
2283* Customizing Moving Around::
2284@end menu
2285 6138
2286@node Customizing Viewing, Customizing Moving Around, Customizing Reading, Customizing Reading 6139@vtable @code
2287@subsection Viewing Your Mail 6140@item mh-search-folder
2288 6141Folder heading face in MH-Folder buffers created by searches.
2289@vindex @code{mh-clean-message-header} 6142@end vtable
2290@vindex @code{mh-invisible-headers}
2291@vindex @code{mh-visible-headers}
2292
2293Several variables control what displayed messages look like. Normally
2294messages are delivered with a handful of uninteresting header fields.
2295You can make them go away by setting @code{mh-clean-message-header} to a
2296non-@code{nil} value. The header can then be cleaned up in two ways. By
2297default, the header fields in @code{mh-invisible-headers} are removed.
2298On the other hand, you could set @code{mh-visible-headers} to the fields
2299that you would like to see. If this variable is set,
2300@code{mh-invisible-headers} is ignored. I suggest that you not set
2301@code{mh-visible-headers} since if you use this variable, you might miss
2302a lot of header fields that you'd rather not miss. As an example of how
2303to set a string variable, @code{mh-visible-headers} can be set to show a
2304minimum set of header fields (see (@ref{Regexps, , Syntax of Regular
2305Expressions, emacs, The GNU Emacs Manual}, for a description of the
2306special characters in this string):
2307 6143
2308@lisp 6144The command @kbd{F s} (@code{mh-search-folder}) helps you find
2309(setq mh-visible-headers "^From: \\|^Subject: \\|^Date: ") 6145messages in your entire corpus of mail. You can search for messages to
2310@end lisp 6146or from a particular person or about a particular subject. In fact,
6147you can also search for messages containing selected strings in any
6148arbitrary header field or any string found within the messages.
2311 6149
2312@cindex @code{mhl} 6150Out of the box, MH-E uses @command{pick} to find messages. With a
2313@cindex MH commands, @code{mhl} 6151little extra effort, you can set an indexing program which rewards you
2314@vindex @code{mhl-formfile} 6152with extremely quick results. The drawback is that sometimes the index
6153does not contain the words you're looking for. You can still use
6154@command{pick} in these situations.
2315 6155
2316Normally mh-e takes care of displaying messages itself (rather than 6156You are prompted for the folder to search. This can be @samp{all} to
2317calling an MH program to do the work). If you'd rather have @code{mhl} 6157search all folders. Note that the search works recursively on the
2318display the message (within mh-e), set the variable @code{mhl-formfile} 6158listed folder.
2319to a non-@code{nil} value. You can set this variable either to @code{t}
2320to use the default format file or to a filename if you have your own
2321format file (@code{mhl}(1) tells you how to write one). When writing
2322your own format file, use a nonzero value for @code{overflowoffset} to
2323ensure the header is RFC 822 compliant and parsable by mh-e.
2324@code{mhl} is always used for printing and forwarding; in this case, the
2325value of @code{mhl-formfile} is consulted if it is a filename.
2326 6159
2327@vindex @code{mh-show-mode-hook} 6160@cindex MH-Search mode
6161@cindex modes, MH-Search
2328 6162
2329Two hooks can be used to control how messages are displayed. The first 6163Next, an MH-Search buffer appears where you can enter search criteria.
2330hook, @code{mh-show-mode-hook}, is called early on in the process of
2331displaying of messages. It is used to perform some actions on the
2332contents of messages, such as highlighting the header fields. If you're
2333running Emacs 19 under the X Window System, the following example will
2334highlight the @samp{From:} and @samp{Subject:} header fields. This is a
2335very nice feature indeed.
2336 6164
2337@vindex @code{mh-show-mode-hook}, example 6165@cartouche
6166@smallexample
6167From: #
6168To:
6169Cc:
6170Date:
6171Subject:
6172--------
2338 6173
2339@lisp
2340@group
2341@i{Emphasize header fields in different fonts via mh-show-mode-hook}
2342 6174
2343(defvar my-mh-keywords
2344 '(("^From: \\(.*\\)" 1 'bold t)
2345 ("^Subject: \\(.*\\)" 1 'highlight t))
2346 "mh-e additions for font-lock-keywords.")
2347 6175
2348(defun my-mh-show-mode-hook ()
2349 "Hook to turn on and customize fonts."
2350 (font-lock-add-keywords nil my-mh-keywords))
2351 6176
2352(add-hook 'mh-show-mode-hook 'my-mh-show-mode-hook))
2353@end group
2354@end lisp
2355 6177
2356@vindex @code{mh-show-hook}
2357 6178
2358The second hook, @code{mh-show-hook}, is the last thing called after
2359messages are displayed. It's used to affect the behavior of mh-e in
2360general or when @code{mh-show-mode-hook} is too early. For example, if
2361you wanted to keep mh-e in sync with MH, you could use
2362@code{mh-show-hook} as follows:
2363 6179
2364@vindex @code{mh-show-hook}, example
2365 6180
2366@lisp
2367(add-hook 'mh-show-hook 'mh-update-sequences)
2368@end lisp
2369 6181
2370@vindex @code{mh-show-buffer-mode-line-buffer-id} 6182--:** search-pattern (MH-Search)--L1--All-----------------------------
2371@cindex MH-Show mode
2372@cindex modes, MH-Show
2373 6183
2374The function @code{mh-update-sequences} is documented in @ref{Finishing 6184@end smallexample
2375Up}. For those who like to modify their mode lines, use 6185@end cartouche
2376@code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in the 6186@i{Search window}
2377MH-Show buffers. Place the two escape strings @samp{%s} and @samp{%d},
2378which will display the folder name and the message number, respectively,
2379somewhere in the string in that order. The default value of
2380@samp{"@{show-%s@} %d"} yields a mode line of
2381 6187
2382@example 6188@cindex @command{pick}
2383-----@{show-+inbox@} 4 (MH-Show)--Bot-------------------------------- 6189@cindex MH commands, @command{pick}
2384@end example
2385 6190
2386@node Customizing Moving Around, , Customizing Viewing, Customizing Reading 6191Edit this template by entering your search criteria in an appropriate
2387@subsection Moving Around 6192header field that is already there, or create a new field yourself. If
6193the string you're looking for could be anywhere in a message, then
6194place the string underneath the row of dashes.
2388 6195
2389@cindex moving between messages 6196As an example, let's say that we want to find messages from Ginnean
2390@cindex MH-Show mode 6197about horseback riding in the Kosciusko National Park (Australia)
2391@cindex modes, MH-Show 6198during January, 1994. Normally we would start with a broad search and
2392@cindex MH-Folder mode 6199narrow it down if necessary to produce a manageable amount of data,
2393@cindex modes, MH-Folder 6200but we'll cut to the chase and create a fairly restrictive set of
2394@vindex @code{mh-recenter-summary-p} 6201criteria as follows:
2395 6202
2396When you use @kbd{t} (@code{mh-toggle-showing}) to toggle between show 6203@smallexample
2397mode and scan mode, the MH-Show buffer is hidden and the 6204@group
2398MH-Folder buffer is left alone. Setting 6205From: ginnean
2399@code{mh-recenter-summary-p} to a non-@code{nil} value causes the toggle to 6206To:
2400display as many scan lines as possible, with the cursor at the middle. 6207Cc:
2401The effect of @code{mh-recenter-summary-p} is rather useful, but it can 6208Date: Jan 1994
2402be annoying on a slow network connection. 6209Subject:
6210--------
6211horse
6212kosciusko
6213@end group
6214@end smallexample
2403 6215
2404@node Customizing Sending, Customizing Draft Editing, Customizing Reading, Customizing mh-e 6216As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
2405@section Sending Mail 6217C-t} (@code{mh-to-field}) to help you fill in the blanks.
6218@xref{Editing Message}.
2406 6219
2407@cindex sending mail 6220If you find that you do the same thing over and over when editing the
6221search template, you may wish to bind some shortcuts to keys. This can
6222be done with the variable @code{mh-search-mode-hook}, which is called
6223when @kbd{F s} is run on a new pattern.
6224
6225@cindex @samp{+mhe-index}
6226@cindex folders, @samp{+mhe-index}
6227@findex mh-index-do-search
6228@findex mh-index-next-folder
6229@findex mh-index-previous-folder
6230@findex mh-pick-do-search
6231@kindex @key{TAB}
6232@kindex C-c C-c
6233@kindex F s
6234@kindex S-@key{TAB}
6235@vindex mh-search-folder
6236
6237To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6238Sometimes you're searching for text that is either not indexed, or
6239hasn't been indexed yet. In this case you can override the default
6240method with the pick method by running the command @kbd{C-c C-p}
6241(@code{mh-pick-do-search}).
6242
6243The messages that are found are put in a temporary sub-folder of
6244@samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6245buffer is special because it displays messages from multiple folders;
6246each set of messages from a given folder has a heading with the folder
6247name. The appearance of the heading can be modified by customizing the
6248face @code{mh-search-folder}. You can jump back and forth between the
6249headings using the commands @kbd{@key{TAB}}
6250(@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6251(@code{mh-index-previous-folder}).
6252
6253In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6254used to visit the folder of the message at point. Initially, only the
6255messages that matched the search criteria are displayed in the folder.
6256While the temporary buffer has its own set of message numbers, the
6257actual messages numbers are shown in the visited folder. Thus, the
6258command @kbd{v} is useful to find the actual message number of an
6259interesting message, or to view surrounding messages with the command
6260@kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6261
6262Because this folder is temporary, you'll probably get in the habit of
6263killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6264@xref{Folders}.
6265
6266You can regenerate the results by running @kbd{F s} with a prefix
6267argument.
6268
6269@cindex @command{procmail}
6270@cindex Unix commands, @command{procmail}
6271@cindex @samp{X-MHE-Checksum:} header field
6272@cindex header field, @samp{X-MHE-Checksum:}
6273
6274Note: This command uses an @samp{X-MHE-Checksum:} header field to
6275cache the MD5 checksum of a message. This means that if an incoming
6276message already contains an @samp{X-MHE-Checksum:} field, that message
6277might not be found by this command. The following @command{procmail}
6278recipe avoids this problem by renaming the existing header field:
2408 6279
2409You may wish to start off by adding the following useful key bindings to 6280@smallexample
2410your @file{.emacs} file: 6281@group
6282:0 wf
6283| formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6284@end group
6285@end smallexample
2411 6286
2412@lisp 6287@xref{Limits}, for an alternative interface to searching.
2413(global-set-key "\C-xm" 'mh-smail) 6288
2414(global-set-key "\C-x4m" 'mh-smail-other-window) 6289@section Configuring Indexed Searches
2415@end lisp 6290
6291@cindex @command{grep}
6292@cindex @command{mairix}
6293@cindex @command{namazu}
6294@cindex @command{pick}
6295@cindex @command{swish++}
6296@cindex @command{swish-e}
6297@cindex Unix commands, @command{grep}
6298@cindex Unix commands, @command{mairix}
6299@cindex Unix commands, @command{namazu}
6300@cindex Unix commands, @command{pick}
6301@cindex Unix commands, @command{swish++}
6302@cindex Unix commands, @command{swish-e}
6303@findex mh-search
6304@kindex F s
6305@vindex mh-search-program
6306
6307The command @kbd{F s} (@code{mh-search}) runs the command defined by
6308the option @code{mh-search-program}. The default value is
6309@samp{Auto-detect} which means that MH-E will automatically choose one
6310of @command{swish++}, @command{swish-e}, @command{mairix},
6311@command{namazu}, @command{pick} and @command{grep} in that order. If,
6312for example, you have both @command{swish++} and @command{mairix}
6313installed and you want to use @command{mairix}, then you can set this
6314option to @samp{mairix}.
6315
6316The following sub-sections describe how to set up the various indexing
6317programs to use with MH-E.
6318
6319@subsection swish++
6320
6321@cindex @command{swish++}
6322@cindex Unix commands, @command{swish++}
6323
6324In the examples below, replace @file{/home/user/Mail} with the path to
6325your MH directory.
6326
6327First create the directory @file{/home/user/Mail/.swish++}. Then
6328create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6329following contents:
2416 6330
2417In addition, several variables are useful when sending mail or replying 6331@smallexample
2418to mail. They are summarized in the following table. 6332@group
6333IncludeMeta Bcc Cc Comments Content-Description From Keywords
6334IncludeMeta Newsgroups Resent-To Subject To
6335IncludeMeta Message-Id References In-Reply-To
6336IncludeFile Mail *
6337IndexFile /home/user/Mail/.swish++/swish++.index
6338@end group
6339@end smallexample
2419 6340
2420@table @code 6341Use the following command line to generate the swish index. Run this
2421@item mh-comp-formfile 6342daily from cron:
2422Format file for drafts (default: @samp{"components"}).
2423 6343
2424@item mh-repl-formfile 6344@smallexample
2425Format file for replies (default: @samp{"replcomps"}). 6345@group
6346find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6347 -o -path /home/user/Mail/.swish++ -prune \
6348 -o -name "[0-9]*" -print \
6349 | index -c /home/user/Mail/.swish++/swish++.conf -
6350@end group
6351@end smallexample
2426 6352
2427@item mh-letter-mode-hook 6353This command does not index the folders that hold the results of your
2428Functions to run in MH-Letter mode (default: @code{nil}). 6354searches in @samp{+mhe-index} since they tend to be ephemeral and the
6355original messages are indexed anyway.
2429 6356
2430@item mh-compose-letter-function 6357@cindex @command{index}
2431Functions to run when starting a new draft (default: @code{nil}). 6358@cindex Unix commands, @command{index}
6359@cindex @command{index++}
6360@cindex Unix commands, @command{index++}
2432 6361
2433@item mh-reply-default-reply-to 6362On some systems (Debian GNU/Linux, for example), use @command{index++}
2434Whom reply goes to (default: @code{nil}). 6363instead of @command{index}.
2435 6364
2436@item mh-forward-subject-format 6365@subsection swish
2437Format string for forwarded message subject (default: @samp{"%s: %s"}).
2438 6366
2439@item mh-redist-full-contents 6367@cindex @command{swish-e}
2440@code{send} requires entire message (default: @code{nil}). 6368@cindex Unix commands, @command{swish-e}
2441 6369
2442@item mh-new-draft-cleaned-headers 6370In the examples below, replace @file{/home/user/Mail} with the path to
2443Remove these header fields from re-edited draft. The default is: 6371your MH directory.
2444@example
2445"^Date:\\| ^Received:\\| ^Message-Id:\\| ^From:\\|
2446^Sender:\\| ^Delivery-Date:\\| ^Return-Path:".
2447@end example
2448@end table
2449 6372
2450@cindex @code{comp} 6373First create the directory @file{/home/user/Mail/.swish}. Then create
2451@cindex MH commands, @code{comp} 6374the file @file{/home/user/Mail/.swish/config} with the following
2452@vindex @code{mh-comp-formfile} 6375contents:
2453@cindex @file{components}
2454@cindex files, @file{components}
2455@cindex @code{repl}
2456@cindex MH commands, @code{repl}
2457@cindex @file{replcomps}
2458@cindex files, @file{replcomps}
2459@vindex @code{mh-repl-formfile}
2460
2461Since mh-e does not use @code{comp} to create the initial draft, you
2462need to set @code{mh-comp-formfile} to the name of your components file
2463if it isn't @file{components}. This is the name of the file that
2464contains the form for composing messages. If it does not contain an
2465absolute pathname, mh-e searches for the file first in your MH directory
2466and then in the system MH library directory (such as
2467@file{/usr/local/lib/mh}). Replies, on the other hand, are built using
2468@code{repl}. You can change the location of the field file from the
2469default of @file{replcomps} by modifying @code{mh-repl-formfile}.
2470
2471@vindex @code{mh-letter-mode-hook}
2472@cindex @code{repl}
2473@cindex MH commands, @code{repl}
2474@cindex @file{components}
2475@cindex files, @file{components}
2476 6376
2477Two hooks are provided to run commands on your freshly created draft. 6377@smallexample
2478The first hook, @code{mh-letter-mode-hook}, allows you to do some 6378@group
2479processing before editing a letter. For example, you may wish to modify 6379DefaultContents TXT*
2480the header after @code{repl} has done its work, or you may have a 6380IndexDir /home/user/Mail
2481complicated @file{components} file and need to tell mh-e where the 6381IndexFile /home/user/Mail/.swish/index
2482cursor should go. Here's an example of how you would use this hook---all 6382IndexName "Mail Index"
2483of the other hooks are set in this fashion as well. 6383IndexDescription "Mail Index"
6384IndexPointer "http://nowhere"
6385IndexAdmin "nobody"
6386#MetaNames automatic
6387IndexReport 3
6388FollowSymLinks no
6389UseStemming no
6390IgnoreTotalWordCountWhenRanking yes
6391WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6392BeginCharacters abcdefghijklmnopqrstuvwxyz
6393EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6394IgnoreLimit 50 1000
6395IndexComments 0
6396FileRules filename contains \D
6397FileRules pathname contains /home/user/Mail/.swish
6398FileRules pathname contains /home/user/Mail/mhe-index
6399FileRules filename is index
6400@end group
6401@end smallexample
2484 6402
2485@findex @code{mh-insert-signature}, example 6403This configuration does not index the folders that hold the results of
6404your searches in @samp{+mhe-index} since they tend to be ephemeral and
6405the original messages are indexed anyway.
2486 6406
2487@lisp 6407If there are any directories you would like to ignore, append lines
2488@group 6408like the following to @file{config}:
2489@i{Prepare draft for editing via mh-letter-mode-hook}
2490 6409
2491(defvar letter-mode-init-done nil 6410@smallexample
2492 "Non-@code{nil} when one-time mh-e settings have made.") 6411FileRules pathname contains /home/user/Mail/scripts
6412@end smallexample
2493 6413
2494(defun my-mh-letter-mode-hook () 6414@cindex @command{swish-e}
2495 "Hook to prepare letter for editing." 6415@cindex Unix commands, @command{swish-e}
2496 (if (not letter-mode-init-done) ; @r{only need to bind the keys once}
2497 (progn
2498 (local-set-key "\C-ctb" 'add-enriched-text)
2499 (local-set-key "\C-cti" 'add-enriched-text)
2500 (local-set-key "\C-ctf" 'add-enriched-text)
2501 (local-set-key "\C-cts" 'add-enriched-text)
2502 (local-set-key "\C-ctB" 'add-enriched-text)
2503 (local-set-key "\C-ctu" 'add-enriched-text)
2504 (local-set-key "\C-ctc" 'add-enriched-text)
2505 (setq letter-mode-init-done t)))
2506 (setq fill-prefix " ") ; @r{I find indented text easier to read}
2507 (save-excursion
2508 (goto-char (point-max)) ; @r{go to end of message to}
2509 (mh-insert-signature))) ; @r{insert signature}
2510 6416
2511(add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook) 6417Use the following command line to generate the swish index. Run this
2512@end group 6418daily from cron:
2513@end lisp
2514 6419
2515The function, @code{add-enriched-text} is defined in the example in 6420@smallexample
2516@ref{Customizing Editing MIME}. 6421 swish-e -c /home/user/Mail/.swish/config
6422@end smallexample
2517 6423
2518@vindex @code{mh-compose-letter-function} 6424@subsection mairix
2519 6425
2520The second hook, a function really, is 6426@cindex @command{mairix}
2521@code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it 6427@cindex Unix commands, @command{mairix}
2522is called just before editing a new message; however, it is the last
2523function called before you edit your message. The consequence of this
2524is that you can write a function to write and send the message for you.
2525This function is passed three arguments: the contents of the @samp{To:},
2526@samp{Subject:}, and @samp{cc:} header fields.
2527 6428
2528@menu 6429In the examples below, replace @file{/home/user/Mail} with the path to
2529* Customizing Replying:: 6430your MH directory.
2530* Customizing Forwarding::
2531* Customizing Redistributing::
2532* Customizing Old Drafts::
2533@end menu
2534 6431
2535@node Customizing Replying, Customizing Forwarding, Customizing Sending, Customizing Sending 6432First create the directory @file{/home/user/Mail/.mairix}. Then create
2536@subsection Replying to Mail 6433the file @file{/home/user/Mail/.mairix/config} with the following
6434contents:
2537 6435
2538@cindex replying 6436@smallexample
2539@vindex @code{mh-reply-default-reply-to} 6437@group
6438base=/home/user/Mail
2540 6439
2541If you find that most of the time that you specify @kbd{cc} when you 6440# List of folders that should be indexed. 3 dots at the end means there
2542reply to a message, set @code{mh-reply-default-reply-to} to @samp{cc}. 6441# are subfolders within the folder
2543This variable is normally set to @code{nil} so that you are prompted for 6442mh=archive...:inbox:drafts:news:sent:trash
2544the recipient of a reply. It can be set to one of @samp{from},
2545@samp{to}, or @samp{cc}; you are then no longer prompted for the
2546recipient(s) of your reply.
2547 6443
2548@node Customizing Forwarding, Customizing Redistributing, Customizing Replying, Customizing Sending 6444vfolder_format=raw
2549@subsection Forwarding Mail 6445database=/home/user/Mail/mairix/database
6446@end group
6447@end smallexample
2550 6448
2551@cindex forwarding 6449Use the following command line to generate the mairix index. Run this daily
2552@vindex @code{mh-forward-subject-format} 6450from cron:
2553 6451
2554When forwarding a message, the format of the @samp{Subject:} header 6452@smallexample
2555field can be modified by the variable @code{mh-forward-subject-format}. 6453mairix -f /home/user/Mail/.mairix/config
2556This variable is a string which includes two escapes (@samp{%s}). The 6454@end smallexample
2557first @samp{%s} is replaced with the sender of the original message, and
2558the second one is replaced with the original @samp{Subject:}. The
2559default value of @samp{"%s: %s"} takes a message with the header:
2560 6455
2561@example 6456@subsection namazu
2562@group
2563To: Bill Wohler <wohler@@newt.com>
2564Subject: Re: 49er football
2565From: Greg DesBrisay <gd@@cellnet.com>
2566@end group
2567@end example
2568 6457
2569and creates a subject header field of: 6458@cindex @command{namazu}
6459@cindex Unix commands, @command{namazu}
2570 6460
2571@example 6461In the examples below, replace @file{/home/user/Mail} with the path to
2572Subject: Greg DesBrisay: Re: 49er football 6462your MH directory.
2573@end example
2574 6463
2575@node Customizing Redistributing, Customizing Old Drafts, Customizing Forwarding, Customizing Sending 6464First create the directory @file{/home/user/Mail/.namazu}. Then create
2576@subsection Redistributing Your Mail 6465the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6466contents:
2577 6467
2578@cindex redistributing 6468@smallexample
2579@vindex @code{mh-redist-full-contents} 6469@group
2580@cindex @code{dist} 6470package conf; # Don't remove this line!
2581@cindex MH commands, @code{dist} 6471$ADDRESS = 'user@@localhost';
2582@cindex @code{send} 6472$ALLOW_FILE = "[0-9]*";
2583@cindex MH commands, @code{send} 6473$EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
2584 6474@end group
2585The variable @code{mh-redist-full-contents} must be set to non-@code{nil} if 6475@end smallexample
2586@code{dist} requires the whole letter for redistribution, which is the
2587case if @code{send} is compiled with the @sc{berk} @footnote{To see which
2588options your copy of MH was compiled with, use @kbd{M-x mh-version}
2589(@ref{Miscellaneous}).} option (which many people abhor). If you find
2590that MH will not allow you to redistribute a message that has been
2591redistributed before, this variable should be set to @code{nil}.
2592
2593@node Customizing Old Drafts, , Customizing Redistributing, Customizing Sending
2594@subsection Editing Old Drafts and Bounced Messages
2595 6476
2596@cindex re-editing drafts 6477This configuration does not index the folders that hold the results of
2597@vindex @code{mh-new-draft-cleaned-headers} 6478your searches in @samp{+mhe-index} since they tend to be ephemeral and
6479the original messages are indexed anyway.
2598 6480
2599The header fields specified by @code{mh-new-draft-cleaned-headers} are 6481Use the following command line to generate the namazu index. Run this
2600removed from an old draft that has been recreated with @kbd{M-e} 6482daily from cron:
2601(@code{mh-extract-rejected-mail}) or @kbd{M-a} (@code{mh-edit-again}).
2602If when you edit an old draft with these commands you find that there
2603are header fields that you don't want included, you can append them to
2604this variable. For example,
2605 6483
2606@vindex @code{mh-new-draft-cleaned-headers}, example 6484@smallexample
6485mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
6486 /home/user/Mail
6487@end smallexample
2607 6488
2608@lisp 6489@subsection pick
2609(setq mh-new-draft-cleaned-headers
2610 (concat mh-new-draft-cleaned-headers "\\|^Some-Field:"))
2611@end lisp
2612 6490
2613@cindex regular expressions 6491@cindex @command{pick}
6492@cindex MH commands, @command{pick}
2614 6493
2615This appends the regular expression @samp{\\|^Some-Field:} to the 6494This search method does not require any setup.
2616variable (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
2617GNU Emacs Manual}). The @samp{\\|} means @emph{or}, and the @samp{^}
2618(caret) matches the beginning of the line. This is done to be very
2619specific about which fields match. The literal @samp{:} is appended for
2620the same reason.
2621 6495
2622@node Customizing Draft Editing, Customizing Moving Mail, Customizing Sending, Customizing mh-e 6496Read @command{pick}(1) or the section
2623@section Editing a Draft 6497@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6498the MH book to find out more about how to enter the criteria.
2624 6499
2625@cindex editing draft 6500@subsection grep
2626 6501
2627There are several variables used during the draft editing phase. 6502@cindex @command{grep}
2628Examples include changing the name of the file that holds your signature 6503@cindex Unix commands, @command{grep}
2629or telling mh-e about new multimedia types. They are:
2630 6504
2631@table @code 6505This search method does not require any setup.
2632@item mh-yank-from-start-of-msg
2633How to yank when region not set (default: @code{t}).
2634 6506
2635@item mh-ins-buf-prefix 6507Unlike the other search methods, this method does not use the
2636Indent for yanked messages (default: @samp{"> "}). 6508MH-Search buffer. Instead, you simply enter a regular expression in
6509the minibuffer. For help in constructing regular expressions, see your
6510man page for @command{grep}.
2637 6511
2638@item mail-citation-hook 6512@node Threading, Limits, Searching, Top
2639Functions to run on yanked messages (default: @code{nil}). 6513@chapter Viewing Message Threads
2640 6514
2641@item mh-delete-yanked-msg-window 6515@cindex threading
2642Delete message window on yank (default: @code{nil}).
2643 6516
2644@c Need the @* because otherwise TeX fills it wrong and complains 6517MH-E groups messages by @dfn{threads} which are messages that are part
2645@c about overfull hbox. 6518of the same discussion and usually all have the same @samp{Subject:}
2646@item mh-mime-content-types 6519header field. Other ways to organize messages in a folder include
2647List of valid content types (default: @samp{'(("text/plain")@* 6520limiting (@pxref{Limits}) or using full-text indexed searches
2648("text/richtext") ("multipart/mixed") ("multipart/alternative")@* 6521(@pxref{Searching}).
2649("multipart/digest") ("multipart/parallel") ("message/rfc822")@*
2650("message/partial") ("message/external-body")@*
2651("application/octet-stream") ("application/postscript")@*
2652("image/jpeg") ("image/gif") ("audio/basic") ("video/mpeg"))}).
2653 6522
2654@item mh-mhn-args 6523A thread begins with a single message called a @dfn{root}. All replies
2655Additional arguments for @code{mhn} (default: @code{nil}). 6524to the same message are @dfn{siblings} of each other. Any message that
6525has replies to it is an @dfn{ancestor} of those replies.
2656 6526
2657@item mh-signature-file-name 6527There are several commands that you can use to navigate and operate on
2658File containing signature (default: @samp{"~/.signature"}). 6528threads.
2659 6529
2660@item mh-before-send-letter-hook 6530@table @kbd
2661Functions to run before sending draft (default: @code{nil}). 6531@kindex T ?
6532@findex mh-prefix-help
6533@item T ?
6534Display cheat sheet for the commands of the current prefix in
6535minibuffer (@code{mh-prefix-help}).
6536@c -------------------------
6537@kindex T o
6538@findex mh-thread-refile
6539@item T o
6540Refile (output) thread into folder (@code{mh-thread-refile}).
6541@c -------------------------
6542@kindex T d
6543@findex mh-thread-delete
6544@item T d
6545Delete thread (@code{mh-thread-delete}).
6546@c -------------------------
6547@kindex T t
6548@findex mh-toggle-threads
6549@item T t
6550Toggle threaded view of folder (@code{mh-toggle-threads}).
6551@c -------------------------
6552@kindex T n
6553@findex mh-thread-next-sibling
6554@item T n
6555Display next sibling (@code{mh-thread-next-sibling}).
6556@c -------------------------
6557@kindex T p
6558@findex mh-thread-previous-sibling
6559@item T p
6560Display previous sibling (@code{mh-thread-previous-sibling}).
6561@c -------------------------
6562@kindex T u
6563@findex mh-thread-ancestor
6564@item T u
6565Display ancestor of current message (@code{mh-thread-ancestor}).
6566@end table
2662 6567
2663@item mh-send-prog 6568The @samp{mh-thread} customization group contains one option.
2664MH program used to send messages (default: @samp{"send"}). 6569
6570@vtable @code
6571@item mh-show-threads-flag
6572On means new folders start in threaded mode (default: @samp{off}).
6573@end vtable
6574
6575Threading large number of messages can be time consuming so the option
6576@code{mh-show-threads-flag} is turned off by default. If you turn on
6577this option, then threading will be done only if the number of
6578messages being threaded is less than @code{mh-large-folder}. In any
6579event, threading can be turned on (and off) with the command @kbd{T t}
6580(@code{mh-toggle-threads}).
6581
6582There are a few commands to help you navigate threads. If you do not
6583care for the way a particular thread has turned, you can move up the
6584chain of messages with the command @kbd{T u}
6585(@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
6586(@code{mh-thread-next-sibling} or @kbd{T p}
6587(@code{mh-thread-previous-sibling}) to jump to the next or previous
6588sibling, skipping the sub-threads. The command @kbd{T u} can also take
6589a prefix argument to jump to the message that started everything.
6590
6591There are threaded equivalents for the commands that delete and refile
6592messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
6593current message and all its children. Similarly, the command @kbd{T d}
6594(@code{mh-thread-delete}) deletes the current message and all its
6595children. These commands do not refile or delete sibling messages.
6596@xref{Navigating}, for a description of the similar command @kbd{k}
6597(@code{mh-delete-subject-or-thread}).
6598
6599If you find that threading is too slow, it may be that you have
6600@code{mh-large-folder} set too high. Threading is one of the few
6601features of MH-E that really benefits from compiling. If you haven't
6602compiled MH-E, I encourage you to do so@footnote{If you're not sure
6603if MH-E has been byte-compiled, you could try running @samp{locate
6604mh-thread.elc} or otherwise find MH-E on your system and ensure that
6605@file{mh-thread.elc} exists. If you have multiple versions and you
6606find that one is compiled but the other is not, then go into your
6607@samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
6608ensure that the byte-compiled version appears first in the
6609@code{load-path}. If you find that MH-E is not compiled and you
6610installed MH-E yourself, please refer to the installation directions
6611in the file @file{README} in the distribution.}.
6612
6613@node Limits, Sequences, Threading, Top
6614@chapter Limiting Display
6615
6616@cindex limits
6617@cindex filters
6618
6619Another way to organize messages in a folder besides threading
6620(@pxref{Threading}) or using full-text indexed searches
6621(@pxref{Searching}) is by limiting the folder display to messages that
6622are similar to the current message.
6623
6624@table @kbd
6625@kindex / ?
6626@findex mh-prefix-help
6627@item / ?
6628Display cheat sheet for the commands of the current prefix in
6629minibuffer (@code{mh-prefix-help}).
6630@c -------------------------
6631@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6632@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6633@kindex / '
6634@findex mh-narrow-to-tick
6635@item / '
6636Limit to messages in the @samp{tick} sequence
6637(@code{mh-narrow-to-tick}).
6638@c -------------------------
6639@kindex / c
6640@findex mh-narrow-to-cc
6641@item / c
6642Limit to messages with the same @samp{Cc:} field
6643(@code{mh-narrow-to-cc}).
6644@c -------------------------
6645@kindex / m
6646@findex mh-narrow-to-from
6647@item / m
6648Limit to messages with the same @samp{From:} field
6649(@code{mh-narrow-to-from}).
6650@c -------------------------
6651@kindex / g
6652@findex mh-narrow-to-range
6653@item / g
6654Limit to range (@code{mh-narrow-to-range}).
6655@c -------------------------
6656@cindex @samp{Sequence > Narrow to Subject Sequence} menu item
6657@cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
6658@kindex / s
6659@findex mh-narrow-to-subject
6660@item / s
6661Limit to messages with the same @samp{Subject:} field
6662(@code{mh-narrow-to-subject}).
6663@c -------------------------
6664@kindex / t
6665@findex mh-narrow-to-to
6666@item / t
6667Limit to messages with the same @samp{To:} field
6668(@code{mh-narrow-to-to}).
6669@c -------------------------
6670@cindex @samp{Sequence > Widen from Sequence} menu item
6671@cindex menu item, @samp{Sequence > Widen from Sequence}
6672@kindex / w
6673@findex mh-widen
6674@item / w
6675Remove last restriction (@code{mh-widen}).
2665@end table 6676@end table
2666 6677
2667@menu 6678All of the limiting commands above refine the display in some way.
2668* Customizing Editing Textual::
2669* Customizing Editing MIME::
2670* Customizing Sending Message::
2671@end menu
2672 6679
2673@node Customizing Editing Textual, Customizing Editing MIME, Customizing Draft Editing, Customizing Draft Editing 6680@cindex @command{pick}
2674@subsection Editing Textual Messages 6681@cindex MH commands, @command{pick}
2675 6682
2676The following two sections include variables that customize the way you 6683The commands @kbd{/ c}, @code{/ m}, @code{/ s}, and @code{/ t}
2677edit a draft. The discussion here applies to editing multimedia 6684restrict the display to messages matching the content of the
2678messages as well. 6685respective field in the current message. However, you can give any of
6686these a prefix argument to edit the @command{pick} expression used to
6687narrow the view@footnote{See @command{pick}(1) or the section
6688@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6689the MH book.}.
2679 6690
2680@menu 6691@cindex @samp{tick} sequence
2681* Customizing Inserting Letter:: 6692@cindex sequence, @samp{tick}
2682* Customizing Signature:: 6693@cindex ticked messages, viewing
2683@end menu
2684 6694
2685@node Customizing Inserting Letter, Customizing Signature, Customizing Editing Textual, Customizing Editing Textual 6695You can also limit the display to messages in the @samp{tick} sequence
2686@subsubsection Inserting letter to which you're replying 6696with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
6697@xref{Sequences}, for information on putting message into the
6698@samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
6699command to limit the display to messages in a range (@pxref{Ranges}).
2687 6700
2688@cindex inserting messages 6701Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
2689@vindex @code{mh-yank-from-start-of-msg} 6702command. Give this command a prefix argument to remove all limits.
2690@vindex @code{mh-ins-buf-prefix}
2691@vindex @code{mail-citation-hook}
2692@vindex @code{mh-ins-buf-prefix}
2693@vindex @code{mh-delete-yanked-msg-window}
2694
2695To control how much of the message to which you are replying is yanked
2696by @kbd{C-c C-y} (@code{mh-yank-cur-msg}) into your reply, modify
2697@code{mh-yank-from-start-of-msg}. The default value of @code{t} means
2698that the entire message is copied. If it is set to @code{'body} (don't
2699forget the apostrophe), then only the message body is copied. If it is
2700set to @code{nil}, only the part of the message following point (the
2701current cursor position in the message's buffer) is copied. In any
2702case, this variable is ignored if a region is set in the message you are
2703replying to. The string contained in @code{mh-ins-buf-prefix} is
2704inserted before each line of a message that is inserted into a draft
2705with @kbd{C-c C-y} (@code{mh-yank-cur-msg}). I suggest that you not
2706modify this variable. The default value of @samp{"> "} is the default
2707string for many mailers and news readers: messages are far easier to
2708read if several included messages have all been indented by the same
2709string. The variable @code{mail-citation-hook} is @code{nil} by
2710default, which means that when a message is inserted into the letter,
2711each line is prefixed by @code{mh-ins-buf-prefix}. Otherwise, it can be
2712set to a function that modifies an included
2713@cindex Emacs, packages, supercite
2714citation.
2715@c Footnotes are fragile; hence the redundancy.
2716@c TeX not inserting a line break; hence the @*
2717@ifclear html
2718@footnote{@emph{Supercite} is an example of a full-bodied, full-featured
2719citation package. It is in Emacs versions 19.15 and later, and can be
2720found via anonymous @code{ftp} on @samp{archive.cis.ohio-state.edu} in
2721@* @file{/pub/gnu/emacs/elisp-archive/packages/sc3.1.tar.Z}}
2722@end ifclear
2723@ifset html
2724@footnote{@emph{Supercite} is an example of a full-bodied,
2725full-featured citation package. It is in Emacs versions 19.15 and
2726later, and its @sc{url} is @*
2727@file{<A HREF="ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/sc3.1.tar.Z">ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/sc3.1.tar.Z</A>}}
2728@end ifset
2729If you like to yank all the text from the message you're replying to in
2730one go, set @code{mh-delete-yanked-msg-window} to non-@code{nil} to delete
2731the window containing the original message after yanking it to make more
2732room on your screen for your reply.
2733
2734@node Customizing Signature, , Customizing Inserting Letter, Customizing Editing Textual
2735@subsubsection Inserting your signature
2736
2737@cindex inserting signature
2738@cindex signature
2739@vindex @code{mh-signature-file-name}
2740@cindex @file{.signature}
2741@cindex files, @file{.signature}
2742 6703
2743You can change the name of the file inserted with @kbd{C-c C-s} 6704@node Sequences, Junk, Limits, Top
2744(@code{mh-insert-signature}) by changing @code{mh-signature-file-name} 6705@chapter Using Sequences
2745(default: @file{"~/.signature"}).
2746 6706
2747@node Customizing Editing MIME, Customizing Sending Message, Customizing Editing Textual, Customizing Draft Editing 6707@cindex sequences
2748@subsection Editing Multimedia Messages
2749 6708
2750@cindex MIME 6709For the whole scoop on MH sequences, refer to
2751@cindex multimedia mail 6710@samp{mh-sequence}(5)@footnote{See the section
2752@vindex @code{mh-mime-content-types} 6711@uref{@value{MH-BOOK-HOME}/morseq.htm, More About Sequences} in the MH
6712book.}. As you've read, several of the MH-E commands can operate on a
6713sequence, which is a shorthand for a range or group of messages. For
6714example, you might want to forward several messages to a friend or
6715colleague. Here's how to manipulate sequences. These commands are also
6716available in the @samp{Sequence} menu.
2753 6717
2754The variable @code{mh-mime-content-types} contains a list of the 6718@table @kbd
2755currently valid content types. They are listed in the table in 6719@cindex @samp{Sequence > Toggle Tick Mark} menu item
2756@ref{Customizing Draft Editing}. If you encounter a new content type, 6720@cindex menu item, @samp{Sequence > Toggle Tick Mark}
2757you can add it like this: 6721@kindex '
6722@findex mh-toggle-tick
6723@item '
6724Toggle tick mark of range (@code{mh-toggle-tick}).
6725@c -------------------------
6726@kindex S ?
6727@findex mh-prefix-help
6728@item S ?
6729Display cheat sheet for the commands of the current prefix in
6730minibuffer (@code{mh-prefix-help}).
6731@c -------------------------
6732@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6733@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6734@kindex S '
6735@findex mh-narrow-to-tick
6736@item S '
6737Limit to ticked messages (@code{mh-narrow-to-tick}).
6738@c -------------------------
6739@cindex @samp{Sequence > Delete Message from Sequence...} menu item
6740@cindex menu item, @samp{Sequence > Delete Message from Sequence...}
6741@kindex S d
6742@findex mh-delete-msg-from-seq
6743@item S d
6744Delete range from sequence (@code{mh-delete-msg-from-seq}).
6745@c -------------------------
6746@cindex @samp{Sequence > Delete Sequence...} menu item
6747@cindex menu item, @samp{Sequence > Delete Sequence...}
6748@kindex S k
6749@findex mh-delete-seq
6750@item S k
6751Delete sequence (@code{mh-delete-seq}).
6752@c -------------------------
6753@cindex @samp{Sequence > List Sequences in Folder...} menu item
6754@cindex menu item, @samp{Sequence > List Sequences in Folder...}
6755@kindex S l
6756@findex mh-list-sequences
6757@item S l
6758List all sequences in folder (@code{mh-list-sequences}).
6759@c -------------------------
6760@cindex @samp{Sequence > Narrow to Sequence...} menu item
6761@cindex menu item, @samp{Sequence > Narrow to Sequence...}
6762@kindex S n
6763@findex mh-narrow-to-seq
6764@item S n
6765Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
6766@c -------------------------
6767@cindex @samp{Sequence > Add Message to Sequence...} menu item
6768@cindex menu item, @samp{Sequence > Add Message to Sequence...}
6769@kindex S p
6770@findex mh-put-msg-in-seq
6771@item S p
6772Add range to sequence (@code{mh-put-msg-in-seq}).
6773@c -------------------------
6774@cindex @samp{Sequence > List Sequences for Message} menu item
6775@cindex menu item, @samp{Sequence > List Sequences for Message}
6776@kindex S s
6777@findex mh-msg-is-in-seq
6778@item S s
6779Display the sequences in which the current message appears
6780(@code{mh-msg-is-in-seq}).
6781@c -------------------------
6782@cindex @samp{Sequence > Widen from Sequence} menu item
6783@cindex menu item, @samp{Sequence > Widen from Sequence}
6784@kindex S w
6785@findex mh-widen
6786@item S w
6787Remove last restriction (@code{mh-widen}).
6788@c -------------------------
6789@findex mh-update-sequences
6790@item M-x mh-update-sequences
6791Flush MH-E's state out to MH@.
6792@end table
2758 6793
2759@vindex @code{mh-mime-content-types}, example 6794@cindex @samp{mh-sequences} customization group
6795@cindex customization group, @samp{mh-sequences}
6796
6797The @samp{mh-sequences} customization group contains the options
6798associated with sequences.
6799
6800@vtable @code
6801@item mh-refile-preserves-sequences-flag
6802On means that sequences are preserved when messages are refiled
6803(default: @samp{on}).
6804@c -------------------------
6805@item mh-tick-seq
6806The name of the MH sequence for ticked messages (default: @samp{'tick}).
6807@c -------------------------
6808@item mh-update-sequences-after-mh-show-flag
6809On means flush MH sequences to disk after message is shown (default:
6810@samp{on}).
6811@end vtable
6812
6813The following hook is available.
6814
6815@vtable @code
6816@item mh-unseen-updated-hook
6817Hook run after the unseen sequence has been updated (default: @code{nil}).
6818@end vtable
6819
6820@cindex @command{pick}
6821@cindex MH commands, @command{pick}
6822
6823To place a message in a sequence, use @kbd{S p}
6824(@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
6825the messages in a sequence to another sequence (for example, @kbd{C-u
6826S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
6827
6828@cindex @samp{tick} sequence
6829@cindex sequence, @samp{tick}
6830@cindex ticking messages
6831
6832One specific use of the @kbd{S p} command is @kbd{'}
6833(@code{mh-toggle-tick}) which adds messages to the @samp{tick}
6834sequence. This sequence can be viewed later with the @kbd{F '} command
6835(@pxref{Folders}).
6836
6837You can customize the option @code{mh-tick-seq} if you already use the
6838@samp{tick} sequence for your own use. You can also disable all of the
6839ticking functions by choosing the @samp{Disable Ticking} item but
6840there isn't much advantage to that.
2760 6841
2761@lisp 6842@cindex MH-Folder mode
2762(setq mh-mime-content-types (append mh-mime-content-types 6843@cindex modes, MH-Folder
2763 '(("@var{new/type}"))))
2764@end lisp
2765 6844
2766Emacs macros can be used to insert enriched text directives like 6845Once you've placed some messages in a sequence, you may wish to narrow
2767@samp{<bold>}. The following code will make, for example, @kbd{C-c t 6846the field of view to just those messages in the sequence you've
2768b} insert the @samp{<bold>} directive. 6847created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
6848prompted for the name of the sequence. What this does is show only
6849those messages that are in the selected sequence in the MH-Folder
6850buffer. In addition, it limits further MH-E searches to just those
6851messages. To narrow the view to the messages in the @samp{tick}
6852sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
6853widen the view to all your messages again, use @kbd{S w}
6854(@code{mh-widen}).
2769 6855
2770@smallexample 6856@cindex @samp{*MH-E Sequences*}
2771@group 6857@cindex buffers, @samp{*MH-E Sequences*}
2772@i{Emacs macros for entering enriched text} 6858
6859You can see which sequences in which a message appears with the
6860command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
6861display the sequences in which another message appears (as in @kbd{C-u
686242 S s @key{RET}}). Or, you can list all sequences in a selected
6863folder (default is current folder) with @kbd{S l}
6864(@code{mh-list-sequences}). The list appears in a buffer named
6865@samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
6866
6867@cindex @samp{Previous-Sequence:} MH profile component
6868@cindex @samp{cur} sequence
6869@cindex MH profile component, @samp{Previous-Sequence:}
6870@cindex sequence, @samp{Previous-Sequence}
6871@cindex sequence, @samp{cur}
6872
6873If a message is in any sequence (except
6874@samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
6875@samp{cur}) when it is refiled, then it will still be in those
6876sequences in the destination folder. If this behavior is not desired,
6877then turn off the option @code{mh-refile-preserves-sequences-flag}.
6878
6879If you want to remove a message (or range, @pxref{Ranges}) from a
6880sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
6881to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
6882the latter case you are prompted for the sequence to delete. Note that
6883this deletes only the sequence, not the messages in the sequence. If
6884you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
6885Mail}).
6886
6887@cindex @samp{Unseen-Sequence:} MH profile component
6888@cindex MH profile component, @samp{Unseen-Sequence:}
6889@cindex sequence, @samp{Unseen-Sequence}
6890
6891Three sequences are maintained internally by MH-E and pushed out to MH
6892when a message is shown. They include the sequence specified by your
6893@samp{Unseen-Sequence:} profile component, @samp{cur}, and the
6894sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
6895by default. If you do not like this behavior, turn off the option
6896@code{mh-update-sequences-after-mh-show-flag}. You can then update the
6897state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
6898mh-update-sequences} commands.
6899
6900@vindex mh-seen-list
6901@vindex mh-unseen-updated-hook
6902
6903The hook @code{mh-unseen-updated-hook} is run after the unseen
6904sequence has been updated. The variable @code{mh-seen-list} can be
6905used by this hook to obtain the list of messages which were removed
6906from the unseen sequence.
6907
6908@cindex @command{mark}
6909@cindex MH commands, @command{mark}
6910
6911With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
6912command dealing with sequences is @command{mark}@footnote{See the
6913section @uref{@value{MH-BOOK-HOME}/mmbwm.htm, Make Message Bookmarks
6914with mark} in the MH book.}.
6915
6916@node Junk, Miscellaneous, Sequences, Top
6917@chapter Dealing With Junk Mail
6918
6919@cindex Marshall Rose
6920@cindex junk mail
6921@cindex spam
2773 6922
2774(defvar enriched-text-types '(("b" . "bold") ("i" . "italic") 6923Marshall Rose once wrote a paper on MH entitled, @cite{How to process
2775 ("f" . "fixed") ("s" . "smaller") 6924200 messages a day and still get some real work done}. This chapter
2776 ("B" . "bigger") ("u" . "underline") 6925could be entitled, @cite{How to process 1000 spams a day and still get
2777 ("c" . "center")) 6926some real work done}.
2778 "Alist of (final-character . directive) choices for add-enriched-text.
2779Additional types can be found in RFC 1563.")
2780 6927
2781(defun add-enriched-text (begin end) 6928@cindex blacklisting
2782 "Add enriched text directives around region. 6929@cindex ham
2783The directive used comes from the list enriched-text-types and is 6930@cindex viruses
2784specified by the last keystroke of the command. When called from Lisp, 6931@cindex whitelisting
2785arguments are BEGIN and END@." 6932@cindex worms
2786 (interactive "r")
2787 ;; @r{Set type to the directive indicated by the last keystroke.}
2788 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
2789 enriched-text-types))))
2790 (save-restriction ; @r{restores state from narrow-to-region}
2791 (narrow-to-region begin end) ; @r{narrow view to region}
2792 (goto-char (point-min)) ; @r{move to beginning of text}
2793 (insert "<" type ">") ; @r{insert beginning directive}
2794 (goto-char (point-max)) ; @r{move to end of text}
2795 (insert "</" type ">")))) ; @r{insert terminating directive}
2796@end group
2797@end smallexample
2798 6933
2799To use the function @code{add-enriched-text}, first create key bindings 6934We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
2800for it (@pxref{Customizing Sending}). Then, set the mark with 6935any unwanted message which includes spam, @dfn{viruses}, and
2801@kbd{C-@@} or @kbd{C-SPC}, type in the text to be highlighted, and type 6936@dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
2802@kbd{C-c t b}. This adds @samp{<bold>} where you set the mark and 6937a sender as one who sends junk mail is called @dfn{blacklisting}; the
2803adds @samp{</bold>} at the location of your cursor, giving you something 6938opposite is called @dfn{whitelisting}.
2804like: @samp{You should be <bold>very</bold>}. You may also be
2805interested in investigating @code{sgml-mode}.
2806 6939
2807@menu 6940@table @kbd
2808* Customizing Sending MIME:: 6941@kindex J ?
2809@end menu 6942@findex mh-prefix-help
6943@item J ?
6944Display cheat sheet for the commands of the current prefix in
6945minibuffer (@code{mh-prefix-help}).
6946@c -------------------------
6947@kindex J b
6948@findex mh-junk-blacklist
6949@item J b
6950Blacklist range as spam (@code{mh-junk-blacklist}).
6951@c -------------------------
6952@kindex J w
6953@findex mh-junk-whitelist
6954@item J w
6955Whitelist range as ham (@code{mh-junk-whitelist}).
6956@c -------------------------
6957@item @code{mh-spamassassin-identify-spammers}
6958Identify spammers who are repeat offenders.
6959@end table
2810 6960
2811@node Customizing Sending MIME, , Customizing Editing MIME, Customizing Editing MIME 6961@cindex @samp{mh-junk} customization group
2812@subsubsection Readying multimedia messages for sending 6962@cindex customization group, @samp{mh-junk}
6963
6964The following table lists the options from the @samp{mh-junk}
6965customization group.
6966
6967@vtable @code
6968@item mh-junk-background
6969If on, spam programs are run in background (default: @samp{off}).
6970@c -------------------------
6971@item mh-junk-disposition
6972Disposition of junk mail (default: @samp{Delete Spam}).
6973@c -------------------------
6974@item mh-junk-program
6975Spam program that MH-E should use (default: @samp{Auto-detect}).
6976@end vtable
6977
6978@cindex SpamProbe
6979@cindex Spamassassin
6980@cindex bogofilter
6981@cindex spam filters, SpamProbe
6982@cindex spam filters, Spamassassin
6983@cindex spam filters, bogofilter
6984
6985MH-E depends on @uref{http://www.spamassassin.org/, SpamAssassin},
6986@uref{http://bogofilter.sourceforge.net/, bogofilter}, or
6987@uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
6988away. This chapter describes briefly how to configure these programs
6989to work well with MH-E and how to use MH-E's interface that provides
6990continuing education for these programs.
6991
6992The default setting of the option @code{mh-junk-program} is
6993@samp{Auto-detect} which means that MH-E will automatically choose one
6994of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
6995example, you have both SpamAssassin and bogofilter installed and you
6996want to use bogofilter, then you can set this option to
6997@samp{Bogofilter}.
6998
6999The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7000program in use with the content of the range (@pxref{Ranges}) and then
7001handles the message(s) as specified by the option
7002@code{mh-junk-disposition}. By default, this option is set to
7003@samp{Delete Spam} but you can also specify the name of the folder
7004which is useful for building a corpus of spam for training purposes.
7005
7006In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7007reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7008incorrectly classified as spam. It then refiles the message into the
7009@file{+inbox} folder.
7010
7011By default, the programs are run in the foreground, but this can be
7012slow when junking large numbers of messages. If you have enough memory
7013or don't junk that many messages at the same time, you might try
7014turning on the option @code{mh-junk-background}.
7015
7016The following sections discuss the various counter-spam measures that
7017MH-E can work with.
7018
7019@cindex @file{.procmailrc}
7020@cindex files, @file{.procmailrc}
7021
7022@heading SpamAssassin
7023
7024SpamAssassin is one of the more popular spam filtering programs. Get
7025it from your local distribution or from the
7026@uref{http://spamassassin.org/, SpamAssassin web site}.
7027
7028To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7029
7030@cindex @command{spamc}
7031@cindex @samp{X-Spam-Level:} header field
7032@cindex @samp{X-Spam-Status:} header field
7033@cindex header field, @samp{X-Spam-Level:}
7034@cindex header field, @samp{X-Spam-Status:}
2813 7035
2814@vindex @code{mh-mhn-args} 7036@smallexample
7037MAILDIR=$HOME/`mhparam Path`
2815 7038
2816If you wish to pass additional arguments to @code{mhn} to affect how it 7039# Fight spam with SpamAssassin.
2817builds your message, use the variable @code{mh-mhn-args}. For example, 7040:0fw
2818you can build a consistency check into the message by setting 7041| spamc
2819@code{mh-mhn-args} to @code{-check}. The recipient of your message can
2820then run @code{mhn -check} on the message---@code{mhn} will complain if
2821the message has been corrupted on the way. The @kbd{C-c C-e}
2822(@code{mh-mhn-edit}) command only consults this variable when given a
2823prefix argument.
2824 7042
2825@node Customizing Sending Message, , Customizing Editing MIME, Customizing Draft Editing 7043# Anything with a spam level of 10 or more is junked immediately.
2826@subsection Sending a Message 7044:0:
7045* ^X-Spam-Level: ..........
7046/dev/null
2827 7047
2828@cindex sending mail 7048:0:
2829@cindex spell check 7049* ^X-Spam-Status: Yes
2830@vindex @code{mh-before-send-letter-hook} 7050spam/.
7051@end smallexample
2831 7052
2832If you want to check your spelling in your message before sending, use 7053If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
2833@code{mh-before-send-letter-hook} like this: 7054
7055Note that one of the recipes above throws away messages with a score
7056greater than or equal to 10. Here's how you can determine a value that
7057works best for you.
7058
7059First, run @samp{spamassassin -t} on every mail message in your
7060archive and use @command{gnumeric} to verify that the average plus the
7061standard deviation of good mail is under 5, the SpamAssassin default
7062for "spam".
7063
7064Using @command{gnumeric}, sort the messages by score and view the
7065messages with the highest score. Determine the score which encompasses
7066all of your interesting messages and add a couple of points to be
7067conservative. Add that many dots to the @samp{X-Spam-Level:} header
7068field above to send messages with that score down the drain.
7069
7070In the example above, messages with a score of 5-9 are set aside in
7071the @samp{+spam} folder for later review. The major weakness of
7072rules-based filters is a plethora of false positives so it is
7073worthwhile to check.
7074
7075If SpamAssassin classifies a message incorrectly, or is unsure, you can
7076use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7077@kbd{J w} (@code{mh-junk-whitelist}).
7078
7079@cindex @command{sa-learn}
7080@cindex @file{.spamassassin/user_prefs}
7081@cindex files, @file{.spamassassin/user_prefs}
7082
7083The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7084@samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7085deletes the message, and sends the message to the Razor, so that
7086others might not see this spam. If the @command{sa-learn} command is
7087available, the message is also recategorized as spam.
7088
7089The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7090@samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7091the @command{sa-learn} command is available, the message is also
7092recategorized as ham.
7093
7094Over time, you'll observe that the same host or domain occurs
7095repeatedly in the @samp{blacklist_from} entries, so you might think
7096that you could avoid future spam by blacklisting all mail from a
7097particular domain. The utility function
7098@code{mh-spamassassin-identify-spammers} helps you do precisely that.
7099This function displays a frequency count of the hosts and domains in
7100the @samp{blacklist_from} entries from the last blank line in
7101@file{~/.spamassassin/user_prefs} to the end of the file. This
7102information can be used so that you can replace multiple
7103@samp{blacklist_from} entries with a single wildcard entry such as:
2834 7104
2835@i{Spell-check message via mh-before-send-letter-hook} 7105@smallexample
7106blacklist_from *@@*amazingoffersdirect2u.com
7107@end smallexample
2836 7108
2837@vindex @code{mh-before-send-letter-hook}, example 7109In versions of SpamAssassin (2.50 and on) that support a Bayesian
7110classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7111@command{sa-learn} to recategorize the message as spam. Neither MH-E,
7112nor SpamAssassin, rebuilds the database after adding words, so you
7113will need to run @samp{sa-learn --rebuild} periodically. This can be
7114done by adding the following to your @file{crontab}:
2838 7115
2839@lisp 7116@smallexample
2840(add-hook 'mh-before-send-letter-hook 'ispell-message) 71170 * * * * sa-learn --rebuild > /dev/null 2>&1
2841@end lisp 7118@end smallexample
2842 7119
2843@cindex @code{send} 7120@heading Bogofilter
2844@cindex MH commands, @code{send}
2845@vindex @code{mh-send-prog}
2846 7121
2847In case the MH @code{send} program is installed under a different name, 7122Bogofilter is a Bayesian spam filtering program. Get it from your
2848use @code{mh-send-prog} to tell mh-e the name. 7123local distribution or from the
7124@uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
2849 7125
2850@node Customizing Moving Mail, Customizing Searching, Customizing Draft Editing, Customizing mh-e 7126Bogofilter is taught by running:
2851@section Moving Your Mail Around
2852 7127
2853@cindex processing mail 7128@smallexample
7129bogofilter -n < good-message
7130@end smallexample
2854 7131
2855If you change the name of some of the MH programs or have your own 7132on every good message, and
2856printing programs, the following variables can help you.
2857They are described in detail in the subsequent sections.
2858 7133
2859@table @code 7134@smallexample
2860@item mh-inc-prog 7135bogofilter -s < spam-message
2861Program to incorporate mail (default: @samp{"inc"}). 7136@end smallexample
2862 7137
2863@item mh-inc-folder-hook 7138@cindex full training
2864Functions to run when incorporating mail (default: @code{nil}).
2865 7139
2866@item mh-delete-msg-hook 7140on every spam message. This is called a @dfn{full training}; three
2867Functions to run when deleting messages (default: @code{nil}). 7141other training methods are described in the FAQ that is distributed
7142with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7143each type of message to start doing a good job.
2868 7144
2869@item mh-print-background 7145To use bogofilter, add the following recipes to @file{~/.procmailrc}:
2870Print in foreground or background (default: @code{nil}).
2871 7146
2872@item mh-lpr-command-format 7147@cindex @samp{X-Bogosity:} header field
2873Command used to print (default: @samp{"lpr -J '%s'"}). 7148@cindex header field, @samp{X-Bogosity:}
2874 7149
2875@item mh-default-folder-for-message-function 7150@smallexample
2876Function to generate a default folder (default: @code{nil}). 7151MAILDIR=$HOME/`mhparam Path`
2877 7152
2878@item mh-auto-folder-collect 7153# Fight spam with Bogofilter.
2879Collect folder names in background at startup (default: @code{t}). 7154:0fw
7155| bogofilter -3 -e -p
2880 7156
2881@item mh-recursive-folders 7157:0:
2882Collect nested folders (default: @code{nil}). 7158* ^X-Bogosity: Yes, tests=bogofilter
7159spam/.
2883 7160
2884@item mh-refile-msg-hook 7161:0:
2885Functions to run when refiling message (default: @code{nil}). 7162* ^X-Bogosity: Unsure, tests=bogofilter
7163spam/unsure/.
7164@end smallexample
2886 7165
2887@item mh-store-default-directory 7166If bogofilter classifies a message incorrectly, or is unsure, you can
2888Default directory for storing files created by @code{uuencode} or @code{shar} 7167use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
2889(default: @code{nil}). 7168w} (@code{mh-junk-whitelist}) to update bogofilter's training.
2890 7169
2891@item mh-sortm-args 7170The @cite{Bogofilter FAQ} suggests that you run the following
2892Additional arguments for @code{sortm} (default: @code{nil}). 7171occasionally to shrink the database:
2893 7172
2894@item mh-scan-prog 7173@smallexample
2895Program to scan messages (default: @samp{"scan"}). 7174bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7175mv wordlist.db wordlist.db.prv
7176mv wordlist.db.new wordlist.db
7177@end smallexample
2896 7178
2897@item mh-before-quit-hook 7179The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
2898Functions to run before quitting (default: @code{nil}). See also 7180bogofilter.
2899@code{mh-quit-hook}.
2900 7181
2901@item mh-quit-hook 7182@heading SpamProbe
2902Functions to run after quitting (default: @code{nil}). See also
2903@code{mh-before-quit-hook}.
2904@end table
2905 7183
2906@menu 7184SpamProbe is a Bayesian spam filtering program. Get it from your local
2907* Customizing Incorporating:: 7185distribution or from the @uref{http://spamprobe.sourceforge.net,
2908* Customizing Deleting:: 7186SpamProbe web site}.
2909* Customizing Organizing::
2910* Customizing Printing::
2911* Customizing Files and Pipes::
2912* Customizing Finishing Up::
2913@end menu
2914 7187
2915@node Customizing Incorporating, Customizing Deleting, Customizing Moving Mail, Customizing Moving Mail 7188To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
2916@subsection Incorporating Your Mail
2917 7189
2918@cindex incorporating 7190@cindex @command{formail}
2919@vindex @code{mh-inc-prog} 7191@cindex @samp{X-SpamProbe:} header field
2920@cindex @code{inc} 7192@cindex header field, @samp{X-SpamProbe:}
2921@cindex MH commands, @code{inc}
2922@vindex @code{mh-progs}
2923@vindex @code{mh-scan-prog}
2924@vindex @code{mh-inc-folder-hook}
2925 7193
2926The name of the program that incorporates new mail is stored in 7194@smallexample
2927@code{mh-inc-prog}; it is @samp{"inc"} by default. This program 7195MAILDIR=$HOME/`mhparam Path`
2928generates a one-line summary for each of the new messages. Unless it is
2929an absolute pathname, the file is assumed to be in the @code{mh-progs}
2930directory. You may also link a file to @code{inc} that uses a different
2931format (see @code{mh-profile}(5)). You'll then need to modify several
2932variables appropriately; see @code{mh-scan-prog} below. You can set the
2933hook @code{mh-inc-folder-hook}, which is called after new mail is
2934incorporated by the @kbd{i} (@code{mh-inc-folder}) command. A good use
2935of this hook is to rescan the whole folder either after running @kbd{M-x
2936mh-rmail} the first time or when you've changed the message numbers from
2937outside of mh-e.
2938
2939@findex @code{mh-execute-commands}
2940@findex @code{mh-rescan-folder}, example
2941@findex @code{mh-show}, example
2942@vindex @code{mh-inc-folder-hook}, example
2943 7196
2944@lisp 7197# Fight spam with SpamProbe.
2945@group 7198:0
2946@i{Rescan folder after incorporating new mail via mh-inc-folder-hook} 7199SCORE=| spamprobe receive
2947 7200
2948(defun my-mh-inc-folder-hook () 7201:0 wf
2949 "Hook to rescan folder after incorporating mail." 7202| formail -I "X-SpamProbe: $SCORE"
2950 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
2951 (mh-execute-commands)) ; @r{carry them out}
2952 (mh-rescan-folder) ; @r{synchronize with +inbox}
2953 (mh-show)) ; @r{show the current message}
2954 7203
2955(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook) 7204:0:
2956@end group 7205*^X-SpamProbe: SPAM
2957@end lisp 7206spam/.
7207@end smallexample
2958 7208
2959@node Customizing Deleting, Customizing Organizing, Customizing Incorporating, Customizing Moving Mail 7209If SpamProbe classifies a message incorrectly, you can use the MH-E
2960@subsection Deleting Your Mail 7210commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7211(@code{mh-junk-whitelist}) to update SpamProbe's training.
2961 7212
2962@cindex deleting 7213@heading Other Things You Can Do
2963@vindex @code{mh-delete-msg-hook}
2964 7214
2965The hook @code{mh-delete-msg-hook} is called after you mark a message 7215There are a couple of things that you can add to @file{~/.procmailrc}
2966for deletion. For example, the current maintainer of mh-e used this 7216in order to filter out a lot of spam and viruses. The first is to
2967once when he kept statistics on his mail usage. 7217eliminate any message with a Windows executable (which is most likely
7218a virus). The second is to eliminate mail in character sets that you
7219can't read.
2968 7220
2969@node Customizing Organizing, Customizing Printing, Customizing Deleting, Customizing Moving Mail 7221@cindex @samp{Content-Transfer-Encoding:} header field
2970@subsection Organizing Your Mail with Folders 7222@cindex @samp{Content-Type:} header field
7223@cindex @samp{Subject:} header field
7224@cindex header field, @samp{Content-Transfer-Encoding:}
7225@cindex header field, @samp{Content-Type:}
7226@cindex header field, @samp{Subject:}
2971 7227
2972@cindex using folders 7228@smallexample
2973@vindex @code{mh-recursive-folders} 7229MAILDIR=$HOME/`mhparam Path`
2974@vindex @code{mh-auto-folder-collect}
2975
2976By default, operations on folders work only one level at a time. Set
2977@code{mh-recursive-folders} to non-@code{nil} to operate on all folders.
2978This mostly means that you'll be able to see all your folders when you
2979press @key{TAB} when prompted for a folder name. The variable
2980@code{mh-auto-folder-collect} is normally turned on to generate a list
2981of folder names in the background as soon as mh-e is loaded. Otherwise,
2982the list is generated when you need a folder name the first time (as
2983with @kbd{o} (@code{mh-refile-msg})). If you have a lot of folders and
2984you have @code{mh-recursive-folders} set, this could take a while, which
2985is why it's nice to do the folder collection in the background.
2986
2987@vindex @code{mh-default-folder-for-message-function}
2988@findex @code{mh-refile-msg}
2989@findex @code{mh-to-fcc}
2990@cindex @file{.emacs}
2991@cindex files, @file{.emacs}
2992 7230
2993The function @code{mh-default-folder-for-message-function} is used by 7231#
2994@kbd{o} (@code{mh-refile-msg}) and @kbd{C-c C-f C-f} (@code{mh-to-fcc}) 7232# Filter messages with win32 executables/virii.
2995to generate a default folder. The generated folder name should be a 7233#
2996string with a @samp{+} before it. For each of my correspondents, I use the 7234# These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
2997same name for both an alias and a folder. So, I wrote a function that 7235# pattern. The string "this program cannot be run in MS-DOS mode"
2998takes the address in the @samp{From:} header field, finds it in my alias 7236# encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
2999file, and returns the alias, which is used as a default folder name. 7237# positives (Roland Smith via Pete from the bogofilter mailing list).
3000This is the most complicated example given here, and it demonstrates 7238#
3001several features of Emacs Lisp programming. You should be able to drop 7239:0 B:
3002this into @file{~/.emacs}, however. If you use this to store messages 7240* ^Content-Transfer-Encoding:.*base64
3003in a subfolder of your Mail directory, you can modify the line that 7241* ^TVqQAAMAAAAEAAAA//8AALg
3004starts @samp{(format +%s...} and insert your subfolder after the folder 7242* 4fug4AtAnNIbg
3005symbol @samp{+}. 7243spam/exe/.
3006@c Note for me: if I insert a new version, don't forget to remove the
3007@c "a/" from the folder name.
3008 7244
3009@iftex 7245#
3010@filbreak 7246# Filter mail in unreadable character sets (from the Bogofilter FAQ).
3011@end iftex 7247#
7248UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
3012 7249
3013@vindex @code{mh-default-folder-for-message-function}, example 7250:0:
3014@vindex @code{mh-user-path}, example 7251* 1^0 $ ^Subject:.*=\?($UNREADABLE)
7252* 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7253spam/unreadable/.
3015 7254
3016@smallexample 7255:0:
3017@group 7256* ^Content-Type:.*multipart
3018@i{Creating useful default folder for refiling via mh-default-folder-for-message-function} 7257* B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
3019 7258spam/unreadable/.
3020(defun my-mh-folder-from-address ()
3021 "Determine folder name from address.
3022Takes the address in the From: header field, and returns its
3023corresponding alias from the user's personal aliases file. Returns
3024@code{nil} if the address was not found."
3025 (require 'rfc822) ; @r{for the rfc822 functions}
3026 (search-forward-regexp "^From: \\(.*\\)") ; @r{grab header field contents}
3027 (save-excursion ; @r{save state}
3028 (let ((addr (car (rfc822-addresses ; @r{get address}
3029 (buffer-substring (match-beginning 1)
3030 (match-end 1)))))
3031 (buffer (get-buffer-create " *temp*")) ; @r{set local variables}
3032 folder)
3033 (set-buffer buffer) ; @r{jump to temporary buffer}
3034 (unwind-protect ; @r{run kill-buffer when done}
3035 (progn ; @r{function grouping construct}
3036 (insert-file-contents (expand-file-name "aliases"
3037 mh-user-path))
3038 (goto-char (point-min)) ; @r{grab aliases file and go to start}
3039 (setq folder
3040 ;; @r{Search for the given address, even commented-out}
3041 ;; @r{addresses are found!}
3042 ;; @r{The function search-forward-regexp sets values that}
3043 ;; @r{are later used by match-beginning and match-end.}
3044 (if (search-forward-regexp (format "^;*\\(.*\\):.*%s"
3045 addr) nil t)
3046 ;; @r{NOTE WELL: this is what the return value looks}
3047 ;; @r{like. You can modify the format string to match}
3048 ;; @r{your own Mail hierarchy.}
3049 (format "+%s" (buffer-substring
3050 (match-beginning 1)
3051 (match-end 1))))))
3052 (kill-buffer buffer)) ; @r{get rid of our temporary buffer}
3053 folder))) ; @r{function's return value}
3054
3055(setq mh-default-folder-for-message-function 'my-mh-folder-from-address)
3056@end group
3057@end smallexample 7259@end smallexample
3058 7260
3059@vindex @code{mh-refile-msg-hook} 7261@node Miscellaneous, Scan Line Formats, Junk, Top
7262@chapter Miscellaneous Commands, Variables, and Buffers
7263
7264This chapter covers the following command and the various MH-E
7265buffers,
7266
7267@ftable @code
7268@item mh-version
7269Display version information about MH-E and the MH mail handling
7270system.
7271@end ftable
7272
7273@cindex @samp{*MH-E Info*}
7274@cindex MH-E version
7275@cindex buffers, @samp{*MH-E Info*}
7276@cindex version
7277
7278One command worth noting is @kbd{M-x mh-version}. You can compare the
7279version this command prints to the latest release (@pxref{Getting
7280MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7281@samp{*MH-E Info*}, should usually be included with any bug report you
7282submit (@pxref{Bug Reports}).
7283
7284@heading MH-E Buffers
7285
7286Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7287several other buffers. They are:
7288
7289@table @samp
7290@cindex @samp{*MH-E Folders*}
7291@cindex buffers, @samp{*MH-E Folders*}
7292@findex mh-list-folders
7293@item *MH-E Folders*
7294@kindex F l
7295This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
7296@xref{Folders}.
7297@c -------------------------
7298@cindex @samp{*MH-E Help*}
7299@cindex buffers, @samp{*MH-E Help*}
7300@findex mh-help
7301@item *MH-E Help*
7302@kindex ?
7303@kindex C-c ?
7304This buffer contains the output of @kbd{?} (@code{mh-help}) and
7305@kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
7306@c -------------------------
7307@cindex @samp{*MH-E Info*}
7308@cindex buffers, @samp{*MH-E Info*}
7309@item *MH-E Info*
7310This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
7311@c -------------------------
7312@cindex @samp{*MH-E Log*}
7313@cindex buffers, @samp{*MH-E Log*}
7314@item *MH-E Log*
7315This buffer contains the last 100 lines of the output of the various
7316MH commands.
7317@c -------------------------
7318@cindex @samp{*MH-E Mail Delivery*}
7319@cindex buffers, @samp{*MH-E Mail Delivery*}
7320@item *MH-E Mail Delivery*
7321This buffer contains the transcript of a mail delivery. @xref{Sending
7322Message}.
7323@c -------------------------
7324@cindex @samp{*MH-E Recipients*}
7325@cindex buffers, @samp{*MH-E Recipients*}
7326@findex mh-check-whom
7327@item *MH-E Recipients*
7328@kindex C-c C-w
7329This buffer contains the output of @kbd{C-c C-w}
7330(@code{mh-check-whom}) and is killed when draft is sent.
7331@xref{Checking Recipients}.
7332@c -------------------------
7333@cindex @samp{*MH-E Sequences*}
7334@cindex buffers, @samp{*MH-E Sequences*}
7335@item *MH-E Sequences*
7336This buffer contains the output of @kbd{S l}
7337(@code{mh-list-sequences}). @xref{Sequences}.
7338@c -------------------------
7339@cindex @samp{*mh-temp*}
7340@cindex buffers, @samp{*mh-temp*}
7341@item *mh-temp
7342This is a scratch, ephemeral, buffer used by MH-E functions. Note that
7343it is hidden because the first character in the name is a space.
7344You'll generally not have any need for this buffer.
7345@end table
3060 7346
3061The hook @code{mh-refile-msg-hook} is called after a message is marked 7347@node Scan Line Formats, Procmail, Miscellaneous, Top
3062to be refiled. 7348@appendix Scan Line Formats
3063 7349
3064@vindex @code{mh-sortm-args} 7350@cindex scan line formats
3065@cindex @code{sortm}
3066@cindex MH commands, @code{sortm}
3067@findex @code{mh-sort-folder}
3068@cindex MH profile components, @code{sortm}
3069@cindex @file{.mh_profile}
3070@cindex files, @file{.mh_profile}
3071 7351
3072The variable @code{mh-sortm-args} holds extra arguments to pass on to 7352This appendix discusses how MH-E creates, parses, and manipulates scan
3073the @code{sortm} command. Note: this variable is only consulted when a 7353lines. If you have your own MH scan or inc format files, you
3074prefix argument is given to @kbd{M-x mh-sort-folder}. It is used to 7354@strong{can} teach MH-E how to handle them, but it isn't easy as
3075override any arguments given in a @code{sortm:} entry in your MH profile 7355you'll see.
3076(@file{~/.mh_profile}).
3077 7356
3078@menu 7357@cindex @samp{mh-scan-line-formats} customization group
3079* Customizing Scan Line Formats:: 7358@cindex customization group, @samp{mh-scan-line-formats}
3080@end menu
3081 7359
3082@node Customizing Scan Line Formats, , Customizing Organizing, Customizing Organizing 7360This table lists the options in the @samp{mh-scan-line-formats}
3083@subsubsection Scan line formatting 7361customization group.
3084 7362
3085@vindex @code{mh-scan-prog} 7363@vtable @code
3086@cindex @code{scan} 7364@item mh-adaptive-cmd-note-flag
3087@cindex MH commands, @code{scan} 7365On means that the message number width is determined dynamically
3088@vindex @code{mh-progs} 7366(default: @samp{on}).
7367@c -------------------------
7368@item mh-scan-format-file
7369Specifies the format file to pass to the scan program (default:
7370@samp{Use MH-E scan Format}).
7371@c -------------------------
7372@item mh-scan-prog
7373Program used to scan messages (default: @samp{"scan"}).
7374@end vtable
7375
7376@findex mh-set-cmd-note
7377@vindex mh-adaptive-cmd-note-flag
7378@vindex mh-scan-format-file
7379
7380There are a couple of caveats when creating your own scan format file.
7381First, MH-E will not work if your scan lines do not include message
7382numbers. It will work poorly if you don't dedicate a column for
7383showing the current message and notations. You won't be able to use
7384the option @code{mh-adaptive-cmd-note-flag} or the threading features
7385(@pxref{Threading}).
7386
7387@cindex message numbers
7388
7389If you've created your own format to handle long message numbers,
7390you'll be pleased to know you no longer need it since MH-E adapts its
7391internal format based upon the largest message number if
7392@code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
7393fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
7394and call @code{mh-set-cmd-note} with the width specified by your
7395format file (see @code{mh-scan-format-file}). For example, the default
7396width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
7397
7398@vindex mh-scan-format-nmh
7399@vindex mh-scan-format-mh
7400
7401The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
7402scan Format}. This means that the format string will be taken from the
7403either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
7404on whether MH or nmh (or GNU mailutils) is in use. This setting also
7405enables you to turn on the option @code{mh-adaptive-cmd-note-flag}.
7406You can also set this option to @samp{Use Default scan Format} to get
7407the same output as you would get if you ran @command{scan} from the
7408shell. If you have a format file that you want MH-E to use but not MH,
7409you can set this option to @samp{Specify a scan Format File} and enter
7410the name of your format file.
7411
7412The scan format that MH-E uses when @code{mh-scan-format-file} is set
7413to its default of @samp{Use MH-E scan Format} is held in the variables
7414@code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
7415whether you are using nmh (or GNU mailutils) or not. Typically, you
7416create your own format files rather than modifying these variables.
7417The value of @code{mh-scan-format-nmh} is:
3089 7418
3090The name of the program that generates a listing of one line per message 7419@smallexample
3091is held in @code{mh-scan-prog} (default: @samp{"scan"}). Unless this 7420(concat
3092variable contains an absolute pathname, it is assumed to be in the 7421 "%4(msg)"
3093@code{mh-progs} directory. You may link another program to @code{scan} 7422 "%<(cur)+%| %>"
3094(see @code{mh-profile}(5)) to produce a different type of listing. 7423 "%<@{replied@}-"
7424 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
7425 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
7426 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
7427 "%?(nonnull(comp@{newsgroups@}))n%>"
7428 "%<(zero) %>"
7429 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
7430 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
7431 "%<(zero)%17(decode(friendly@{from@}))%> "
7432 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
7433@end smallexample
3095 7434
3096If you change the format of the scan lines you'll need to tell mh-e how 7435@cindex RFC 2047, decoding
3097to parse the new format. As you see, quite a lot of variables are 7436@cindex decoding RFC 2047
3098involved to do that. The first variable has to do with pruning out 7437
3099garbage. 7438The setting for @code{mh-scan-format-mh} is similar, except that MH
7439doesn't have the function @code{decode} (which is used to decode RFC
74402047 encodings).
7441
7442@cindex notations, scan line
7443@cindex scan line notations
7444
7445These strings are passed to the @command{scan} program via the
7446@option{-format} argument. The formats are identical to the defaults
7447except that additional hints for fontification have been added to the
7448existing notations in the fifth column (remember that in Emacs, the
7449columns start at 0). The values of the fifth column, in priority
7450order, are: @samp{-} if the message has been replied to, @samp{t} if
7451an address in the @samp{To:} field matches one of the mailboxes of the
7452current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
7453the @samp{Bcc:} field matches, and @samp{n} if a non-empty
7454@samp{Newsgroups:} field is present.
7455
7456@cindex @command{scan}
7457@cindex MH commands, @command{scan}
7458@vindex mh-progs
7459@vindex mh-scan-prog
7460
7461The name of the program that generates a listing of one line per
7462message is held in @code{mh-scan-prog} (default: @samp{"scan"}).
7463Unless this variable contains an absolute pathname, it is assumed to
7464be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
7465link another program to @command{scan} (see @samp{mh-profile}(5)) to
7466produce a different type of listing@footnote{See the section
7467@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
7468pick Ranges Sequences} in the MH book.}.
7469
7470@cindex regular expressions, scan line formats
7471
7472If you change the format of the scan lines you'll need to tell MH-E
7473how to parse the new format. As you will see, quite a lot of variables
7474are involved to do that. Use @samp{M-x apropos @key{RET} mh-scan.*regexp'}
7475to obtain a list of these variables. You will also have to call
7476@code{mh-set-cmd-note} if your notations are not in column 4 (columns
7477in Emacs start with 0). Note that unlike most of the user options
7478described in this manual, these are variables and must be set with
7479@code{setq} instead of in a customization buffer. For help with
7480regular expressions, see
7481@ifnothtml
7482@ref{Regexps, , Syntax of Regular Expressions, emacs, The
7483GNU Emacs Manual}
7484@end ifnothtml
7485@ifhtml
7486the section
7487@uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
7488Syntax of Regular Expressions} in
7489@cite{The GNU Emacs Manual}).
7490@end ifhtml
7491
7492The first variable has to do with pruning out garbage.
7493
7494@vtable @code
7495@cindex @command{inc}
7496@cindex MH commands, @command{inc}
7497@cindex @command{scan}
7498@cindex MH commands, @command{scan}
7499@item mh-scan-valid-regexp
7500This regular expression describes a valid scan line. This is used to
7501eliminate error messages that are occasionally produced by
7502@command{inc}@footnote{See the section
7503@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
7504prev} in the MH book.} or @command{scan} (default: @samp{"^ *[0-9]"}).
7505@end vtable
7506
7507Next, many variables control how the scan lines are parsed.
7508
7509@vindex mh-folder-font-lock-keywords
7510
7511@vtable @code
7512@vindex mh-folder-body
7513@vindex mh-folder-font-lock-keywords
7514@item mh-scan-body-regexp
7515This regular expression matches the message body fragment. Note that
7516the default setting of @code{mh-folder-font-lock-keywords} expects
7517this expression to contain at least one parenthesized expression which
7518matches the body text as in the default of
7519@samp{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
7520correct, the body fragment will not be highlighted with the face
7521@code{mh-folder-body}.
7522@c -------------------------
7523@vindex mh-folder-cur-msg-number
7524@vindex mh-folder-font-lock-keywords
7525@vindex mh-note-cur
7526@item mh-scan-cur-msg-number-regexp
7527This regular expression matches the current message. It must match
7528from the beginning of the line. Note that the default setting of
7529@code{mh-folder-font-lock-keywords} expects this expression to contain
7530at least one parenthesized expression which matches the message number
7531as in the default of @w{@samp{"^\\( *[0-9]+\\+\\).*"}}. This
7532expression includes the leading space and current message marker
7533@samp{+} within the parenthesis since it looks better to highlight
7534these items as well. The highlighting is done with the face
7535@code{mh-folder-cur-msg-number}. This regular expression should be
7536correct as it is needed by non-fontification functions. See also
7537@code{mh-note-cur}.
7538@c -------------------------
7539@vindex mh-folder-date
7540@vindex mh-folder-font-lock-keywords
7541@vindex mh-scan-sent-to-me-sender-regexp
7542@item mh-scan-date-regexp
7543This regular expression matches a valid date. It must @strong{not} be
7544anchored to the beginning or the end of the line. Note that the
7545default setting of @code{mh-folder-font-lock-keywords} expects this
7546expression to contain only one parenthesized expression which matches
7547the date field as in the default of
7548@samp{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
7549not correct, the date will not be highlighted with the face
7550@code{mh-folder-date}.
7551@c -------------------------
7552@vindex mh-folder-deleted
7553@vindex mh-folder-font-lock-keywords
7554@vindex mh-note-deleted
7555@item mh-scan-deleted-msg-regexp
7556This regular expression matches deleted messages. It must match from
7557the beginning of the line. Note that the default setting of
7558@code{mh-folder-font-lock-keywords} expects this expression to contain
7559at least one parenthesized expression which matches the message number
7560as in the default of @samp{"^\\( *[0-9]+\\)D"}. This expression
7561includes the leading space within the parenthesis since it looks
7562better to highlight it as well. The highlighting is done with the face
7563@code{mh-folder-deleted}. This regular expression should be correct as
7564it is needed by non-fontification functions. See also
7565@code{mh-note-deleted}.
7566@c -------------------------
7567@vindex mh-folder-font-lock-keywords
7568@vindex mh-folder-msg-number
7569@item mh-scan-good-msg-regexp
7570This regular expression matches ``good'' messages. It must match from
7571the beginning of the line. Note that the default setting of
7572@code{mh-folder-font-lock-keywords} expects this expression to contain
7573at least one parenthesized expression which matches the message number
7574as in the default of @w{@samp{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
7575expression includes the leading space within the parenthesis since it
7576looks better to highlight it as well. The highlighting is done with
7577the face @code{mh-folder-msg-number}. This regular expression should
7578be correct as it is needed by non-fontification functions.
7579@c -------------------------
7580@vindex mh-scan-format-file
7581@item mh-scan-msg-format-regexp
7582This regular expression finds the message number width in a scan
7583format. Note that the message number must be placed in a parenthesized
7584expression as in the default of @samp{"%\\([0-9]*\\)(msg)"}. This
7585variable is only consulted if @code{mh-scan-format-file} is set to
7586@samp{Use MH-E scan Format}.
7587@c -------------------------
7588@vindex mh-scan-format-file
7589@item mh-scan-msg-format-string
7590This is a format string for the width of the message number in a scan
7591format. Use @samp{0%d} for zero-filled message numbers. This variable
7592is only consulted if @code{mh-scan-format-file} is set to @samp{Use
7593MH-E scan Format} (default: @samp{"%d"}).
7594@c -------------------------
7595@item mh-scan-msg-number-regexp
7596This regular expression extracts the message number. It must match
7597from the beginning of the line. Note that the message number must be
7598placed in a parenthesized expression as in the default of @w{@samp{"^
7599*\\([0-9]+\\)"}}.
7600@c -------------------------
7601@item mh-scan-msg-overflow-regexp
7602This regular expression matches overflowed message numbers (default:
7603@samp{"^[?0-9][0-9]"}).
7604@c -------------------------
7605@item mh-scan-msg-search-regexp
7606This regular expression matches a particular message. It is a format
7607string; use @samp{%d} to represent the location of the message number
7608within the expression as in the default of @samp{"^[^0-9]*%d[^0-9]"}.
7609@c -------------------------
7610@vindex mh-folder-address
7611@vindex mh-folder-font-lock-keywords
7612@vindex mh-folder-to
7613@item mh-scan-rcpt-regexp
7614This regular expression specifies the recipient in messages you sent.
7615Note that the default setting of @code{mh-folder-font-lock-keywords}
7616expects this expression to contain two parenthesized expressions. The
7617first is expected to match the @samp{To:} that the default scan format
7618file generates. The second is expected to match the recipient's name
7619as in the default of @samp{"\\(To:\\)\\(..............\\)"}. If this
7620regular expression is not correct, the @samp{To:} string will not be
7621highlighted with the face @code{mh-folder-to} and the recipient will not be
7622highlighted with the face @code{mh-folder-address}.
7623@c -------------------------
7624@vindex mh-folder-font-lock-keywords
7625@vindex mh-folder-refiled
7626@vindex mh-note-refiled
7627@item mh-scan-refiled-msg-regexp
7628This regular expression matches refiled messages. It must match from
7629the beginning of the line. Note that the default setting of
7630@code{mh-folder-font-lock-keywords} expects this expression to contain
7631at least one parenthesized expression which matches the message number
7632as in the default of @w{@samp{"^\\( *[0-9]+\\)\\^"}}. This expression
7633includes the leading space within the parenthesis since it looks
7634better to highlight it as well. The highlighting is done with the face
7635@code{mh-folder-refiled}. This regular expression should be correct as
7636it is needed by non-fontification functions. See also
7637@code{mh-note-refiled}.
7638@c -------------------------
7639@vindex mh-folder-font-lock-keywords
7640@vindex mh-folder-sent-to-me-sender
7641@vindex mh-mh-folder-sent-to-me-hint
7642@vindex mh-scan-format-nmh
7643@item mh-scan-sent-to-me-sender-regexp
7644This regular expression matches messages sent to us. Note that the
7645default setting of @code{mh-folder-font-lock-keywords} expects this
7646expression to contain at least two parenthesized expressions. The
7647first should match the fontification hint (see
7648@code{mh-scan-format-nmh}) and the second should match the user name
7649as in the default of
7650@w{@samp{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
7651If this regular expression is not correct, the notation hints will not
7652be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
7653the sender will not be highlighted with the face
7654@code{mh-folder-sent-to-me-sender}.
7655@c -------------------------
7656@vindex mh-folder-followup
7657@vindex mh-folder-font-lock-keywords
7658@vindex mh-folder-subject
7659@item mh-scan-subject-regexp
7660This regular expression matches the subject. It must match from the
7661beginning of the line. Note that the default setting of
7662@samp{mh-folder-font-lock-keywords} expects this expression to contain
7663at least three parenthesized expressions. The first is expected to
7664match the @samp{Re:} string, if any, and is highlighted with the face
7665@code{mh-folder-followup}. The second matches an optional bracketed
7666number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
7667sub-expression of the first expression). The third is expected to
7668match the subject line itself which is highlighted with the face
7669@code{mh-folder-subject}. For example, the default is
7670@w{@samp{"^ *[0-9]+........[ ]*...................}}@*
7671@w{@samp{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
7672This regular expression should be correct as it is needed by
7673non-fontification functions. Note that this example is broken up on
7674two lines for readability, but is actually a single string.
7675@end vtable
7676
7677Finally, there are a slew of variables that control how MH-E annotates
7678the scan lines.
3100 7679
3101@table @code 7680@vtable @code
3102@item mh-valid-scan-line 7681@item mh-cmd-note
3103@vindex @code{mh-valid-scan-line} 7682Column for notations (default: 4). This variable should be set with
3104@cindex @code{inc} 7683the function @code{mh-set-cmd-note}. This variable may be updated
3105@cindex MH commands, @code{inc} 7684dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
3106@cindex @code{scan} 7685variables contain the notational characters. Note that columns in
3107@cindex MH commands, @code{scan} 7686Emacs start with 0.
3108This regular expression describes a valid scan line. This is used to 7687@c -------------------------
3109eliminate error messages that are occasionally produced by @code{inc} or 7688@item mh-note-copied
3110@code{scan} (default: @samp{"^ *[0-9]"}). 7689Messages that have been copied are marked by this character (default:
3111@end table 7690@samp{?C}).
7691@c -------------------------
7692@item mh-note-cur
7693The current message (in MH, not in MH-E) is marked by this character
7694(default: @samp{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
7695@c -------------------------
7696@item mh-note-deleted
7697Messages that have been deleted are marked by this character (default:
7698@samp{?D}). See also @code{mh-scan-deleted-msg-regexp}.
7699@c -------------------------
7700@item mh-note-dist
7701Messages that have been redistributed are marked by this character
7702(default: @samp{?R}).
7703@c -------------------------
7704@item mh-note-forw
7705Messages that have been forwarded are marked by this character
7706(default: @samp{?F}).
7707@c -------------------------
7708@item mh-note-printed
7709Messages that have been printed are marked by this character (default:
7710@samp{?P}).
7711@c -------------------------
7712@item mh-note-refiled
7713Messages that have been refiled are marked by this character (default:
7714@samp{?^}). See also @code{mh-scan-refiled-msg-regexp}.
7715@c -------------------------
7716@item mh-note-repl
7717Messages that have been replied to are marked by this character
7718(default: @samp{?-}).
7719@c -------------------------
7720@item mh-note-seq
7721Messages in a user-defined sequence are marked by this character
7722(default: @samp{?%}). Messages in the @samp{search} sequence are
7723marked by this character as well.
7724@end vtable
3112 7725
3113Next, two variables control how the message numbers are parsed. 7726For example, let's say I have the following in @file{scan.format}
7727which displays the sender, the subject, and the message number. This
7728format places a @samp{+} after the message number for the current
7729message according to MH; it also uses that column for notations.
3114 7730
3115@table @code 7731@example
7732%20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
7733@end example
3116 7734
3117@item mh-msg-number-regexp 7735@vindex mh-scan-format-file, example
3118@vindex @code{mh-msg-number-regexp}
3119This regular expression is used to extract the message number from a
3120scan line. Note that the message number must be placed in quoted
3121parentheses, (\\(...\\)), as in the default of @w{@samp{"^
3122*\\([0-9]+\\)"}}.
3123 7736
3124@item mh-msg-search-regexp 7737The first thing you have to do is tell MH-E to use this file.
3125@vindex @code{mh-msg-search-regexp} 7738Customize @code{mh-scan-format-file} and set its value to @samp{Use
3126Given a message number (which is inserted in @samp{%d}), this regular 7739Default scan Format}. If you didn't get already turn off
3127expression will match the scan line that it represents (default: 7740@code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
3128@samp{"^[^0-9]*%d[^0-9]"}).
3129@end table
3130 7741
3131Finally, there are a slew of variables that control how mh-e marks up 7742Next, tell MH-E what a valid scan line looks like so that you can at
3132the scan lines. 7743least display the output of scan in your MH-Folder buffer.
3133 7744
3134@table @code 7745@vindex mh-scan-valid-regexp, example
3135@item mh-cmd-note
3136@vindex @code{mh-cmd-note}
3137Number of characters to skip over before inserting notation (default:
31384). Note how it relates to the following regular expressions.
3139
3140@item mh-deleted-msg-regexp
3141@vindex @code{mh-deleted-msg-regexp}
3142This regular expression describes deleted messages (default:
3143@samp{"^....D"}). See also @code{mh-note-deleted}.
3144
3145@item mh-refiled-msg-regexp
3146@vindex @code{mh-refiled-msg-regexp}
3147This regular expression describes refiled messages (default:
3148@samp{"^....\\^"}). See also @code{mh-note-refiled}.
3149
3150@item mh-cur-scan-msg-regexp
3151@vindex @code{mh-cur-scan-msg-regexp}
3152This regular expression matches the current message (default:
3153@samp{"^....\\+"}). See also @code{mh-note-cur}.
3154
3155@item mh-good-msg-regexp
3156@vindex @code{mh-good-msg-regexp}
3157This regular expression describes which messages should be shown when
3158mh-e goes to the next or previous message. Normally, deleted or refiled
3159messages are skipped over (default: @samp{"^....[^D^]"}).
3160 7746
3161@item mh-note-deleted 7747@lisp
3162@vindex @code{mh-note-deleted} 7748(setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
3163Messages that have been deleted to are marked by this string (default: 7749@end lisp
3164@samp{"D"}). See also @code{mh-deleted-msg-regexp}.
3165 7750
3166@item mh-note-refiled 7751Now, in order to get rid of the @samp{Cursor not pointing to message}
3167@vindex @code{mh-note-refiled} 7752message, you need to tell MH-E how to access the message number. You
3168Messages that have been refiled are marked by this string (default: 7753should also see why MH-E requires that you include a message number in
3169@samp{"^"}). See also @code{mh-refiled-msg-regexp}. 7754the first place.
3170 7755
3171@item mh-note-copied 7756@vindex mh-scan-msg-number-regexp, example
3172@vindex @code{mh-note-copied} 7757@vindex mh-scan-msg-search-regexp, example
3173Messages that have been copied are marked by this string (default:
3174@samp{"C"}).
3175 7758
3176@item mh-note-cur 7759@lisp
3177@vindex @code{mh-note-cur} 7760(setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
3178The current message (in MH, not in mh-e) is marked by this string 7761(setq mh-scan-msg-search-regexp " %d[+D^ ]$")
3179(default: @samp{"+"}). See also @code{mh-cur-scan-msg-regexp}. 7762@end lisp
3180 7763
3181@item mh-note-repl 7764In order to get the next and previous commands working, add this.
3182@vindex @code{mh-note-repl}
3183Messages that have been replied to are marked by this string (default:
3184@samp{"-"}).
3185 7765
3186@item mh-note-forw 7766@vindex mh-scan-good-msg-regexp, example
3187@vindex @code{mh-note-forw}
3188Messages that have been forwarded are marked by this string (default:
3189@samp{"F"}).
3190 7767
3191@item mh-note-dist 7768@lisp
3192@vindex @code{mh-note-dist} 7769(setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
3193Messages that have been redistributed are marked by this string 7770@end lisp
3194(default: @samp{"R"}).
3195 7771
3196@item mh-note-printed 7772Note that the current message isn't marked with a @samp{+} when moving
3197@vindex @code{mh-note-printed} 7773between the next and previous messages. Here is the code required to
3198Messages that have been printed are marked by this string (default: 7774get this working.
3199@samp{"P"}).
3200 7775
3201@item mh-note-seq 7776@vindex set-mh-cmd-note, example
3202@vindex @code{mh-note-seq} 7777@vindex mh-scan-cur-msg-number-regexp, example
3203Messages in a sequence are marked by this string (default: @samp{"%"}).
3204@end table
3205 7778
3206@node Customizing Printing, Customizing Files and Pipes, Customizing Organizing, Customizing Moving Mail 7779@lisp
3207@subsection Printing Your Mail 7780(set-mh-cmd-note 76)
7781(setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
7782@end lisp
3208 7783
3209@cindex printing 7784Finally, add the following to delete and refile messages.
3210@vindex @code{mh-print-background} 7785
3211@vindex @code{mh-lpr-command-format} 7786@vindex mh-scan-deleted-msg-regexp, example
3212@cindex @code{lpr} 7787@vindex mh-scan-refiled-msg-regexp, example
3213@cindex Unix commands, @code{lpr}
3214
3215Normally messages are printed in the foreground. If this is slow on
3216your system, you may elect to set @code{mh-print-background} to
3217non-@code{nil} to print in the background. If you do this, do not delete
3218the message until it is printed or else the output may be truncated.
3219The variable @code{mh-lpr-command-format} controls how the printing is
3220actually done. The string can contain one escape, @samp{%s}, which is
3221filled with the name of the folder and the message number and is useful
3222for print job names. As an example, the default is @samp{"lpr -J
3223'%s'"}.
3224
3225@node Customizing Files and Pipes, Customizing Finishing Up, Customizing Printing, Customizing Moving Mail
3226@subsection Files and Pipes
3227
3228@cindex using files
3229@cindex using pipes
3230@findex @code{mh-store-msg}
3231@vindex @code{mh-store-default-directory}
3232
3233The initial directory for the @code{mh-store-msg} command is held in
3234@code{mh-store-default-directory}. Since I almost always run
3235@code{mh-store-msg} on sources, I set it to my personal source directory
3236like this:
3237
3238@vindex @code{mh-store-default-directory}, example
3239 7788
3240@lisp 7789@lisp
3241(setq mh-store-default-directory (expand-file-name "~/src/")) 7790(setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
7791(setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
3242@end lisp 7792@end lisp
3243 7793
3244@findex @code{mh-store-buffer} 7794This is just a bare minimum; it's best to adjust all of the regular
3245@cindex @code{uuencode} 7795expressions to ensure that MH-E and highlighting perform well.
3246@cindex Unix commands, @code{uuencode}
3247@cindex @code{shar}
3248@cindex Unix commands, @code{shar}
3249
3250Subsequent incarnations of @code{mh-store-msg} offer the last directory
3251used as the default. By the way, @code{mh-store-msg} calls the Emacs
3252Lisp function @code{mh-store-buffer}. I mention this because you can use
3253it directly if you're editing a buffer that contains a file that has
3254been run through @code{uuencode} or @code{shar}. For example, you can
3255extract the contents of the current buffer in your home directory by
3256typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
3257 7796
3258@node Customizing Finishing Up, , Customizing Files and Pipes, Customizing Moving Mail 7797@node Procmail, Odds and Ends, Scan Line Formats, Top
3259@subsection Finishing Up 7798@appendix Reading Mailing Lists Effectively
3260 7799
3261@cindex quitting 7800@cindex @command{procmail}
3262@vindex @code{mh-before-quit-hook} 7801@cindex @command{slocal}
3263@vindex @code{mh-quit-hook} 7802@cindex Gnus
3264@findex @code{mh-execute-commands} 7803@cindex MH commands, @command{slocal}
7804@cindex Unix commands, @command{procmail}
7805@cindex mailing lists, reading
3265 7806
3266The two variables @code{mh-before-quit-hook} and @code{mh-quit-hook} are 7807This appendix explains how to use @uref{http://www.procmail.org/,
3267called by @kbd{q} (@code{mh-quit}). The former one is called before the 7808procmail} to file mail from mailing lists into folders which can then
3268quit occurs, so you might use it to perform any mh-e operations; you 7809be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
3269could perform some query and abort the quit or call 7810can be used as well, but procmail is more flexible and more packages
3270@code{mh-execute-commands}, for example. The latter is not run in an 7811exist for procmail than for slocal.}. Some mailing lists have such
3271mh-e context, so you might use it to modify the window setup. 7812high traffic that Gnus must be used and I discuss how to use Gnus
7813side-by-side with MH-E.
3272 7814
3273@node Customizing Searching, , Customizing Moving Mail, Customizing mh-e 7815@cindex @file{.procmailrc}
3274@section Searching Through Messages 7816@cindex files, @file{.procmailrc}
3275 7817
3276@cindex searching 7818First, I'll describe how to put mail from your mailing lists directly
3277@vindex @code{mh-pick-mode-hook} 7819into an MH folder using @command{procmail}. First, add the following
3278@vindex @code{mh-partial-folder-mode-line-annotation} 7820to @file{~/.procmailrc}. While the logging variables aren't strictly
7821necessary, they are extremely useful.
3279 7822
3280If you find that you do the same thing over and over when editing the 7823@smallexample
3281search template, you may wish to bind some shortcuts to keys. This can 7824[1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
3282be done with the variable @code{mh-pick-mode-hook}, which is called when 7825[2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
3283@kbd{M-s} (@code{mh-search-folder}) is run on a new pattern. 7826[3]
3284 7827[4] # Point LOGFILE at the actual log file.
3285The string 7828[5] LOGFILE=$HOME/.procmail.log
3286@code{mh-partial-folder-mode-line-annotation} is used to annotate the 7829[6]
3287mode line when only a portion of the folder is shown. For example, this 7830[7] # This setting provides just the right amount of information.
3288will be displayed after running @kbd{M-s} (@code{mh-search-folder}) to 7831[8] LOGABSTRACT=all
3289list messages based on some search criteria (see @ref{Searching}). The 7832[9]
3290default annotation of @samp{"select"} yields a mode line that looks 7833[10] # Uncomment the following line to see how your patterns match.
3291like: 7834[11] #VERBOSE=yes
7835[12]
7836[13] # Place mail sent to any MH-E mailing list in +mh-e.
7837[14] :0 w: mh-e$LOCKEXT
7838[15] * ^TO.*mh-e-.*@.*sourceforge.net
7839[16] | myrcvstore -create +mh-e
7840@end smallexample
7841
7842@cindex @command{rcvstore}
7843@cindex MH commands, @command{rcvstore}
7844
7845Line 14 creates a lock file in your mail directory based upon the name
7846of the folder. This is done because @command{rcvstore} does not
7847perform locking. While this lock file will prevent @command{procmail}
7848from writing to a folder concurrently, there is a slight chance that
7849you might lose a message if you're performing operations on a folder
7850at the same time @command{rcvstore} is placing a message there. You
7851have been warned. Now that that disclaimer is out of the way, note
7852that I've been using this set-up for over a decade and haven't lost
7853anything to my knowledge@footnote{See
7854@uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
7855Savannah issue #4361} to see if @command{rcvstore} locking is still an
7856issue.}.
7857
7858@cindex @samp{Unseen-Sequence:} MH profile component
7859@cindex MH profile component, @samp{Unseen-Sequence:}
7860
7861Line 16 uses the following script, @code{myrcvstore}, to massage the
7862message as described in the comment and file the message in the given
7863folder@footnote{The @samp{-create} argument wasn't always the default
7864to @command{rcvstore}.}.
7865
7866@smallexample
7867#! /bin/sh
7868
7869# Accepts a message on standard input and passes it through rcvstore
7870# after first passing it through any filters. All arguments are passed
7871# on to rcvstore.
7872
7873# Force the "From user date" to become part of header. One reason this
7874# is done is because the presence of the From field confuses dist so
7875# that dist adds a new header, rather than using the existing header.
7876# Note that this should not be done for any message that goes into a
7877# Gnus incoming file (Gnus will thrown an error) nor should it be
7878# applied to any message that goes to the system mailbox because the
7879# entire mailbox will be incorporated as a single message.
7880formail -c -z -R 'From ' X-Envelope-From: |
7881rcvstore $@@
7882@end smallexample
7883
7884If your version of @command{rcvstore} doesn't add messages to the
7885@samp{unseen} sequence by default, add the following line to your MH
7886profile:
7887
7888@example
7889Unseen-Sequence: unseen
7890@end example
7891
7892Now view your new messages with the speedbar (@pxref{Speedbar}) or with
7893@kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
7894
7895If you're on a mailing list that is so voluminous that it is
7896impossible to read every message, it usually better to read the
7897mailing list like a newsgroup in a news reader. Emacs has a built-in
7898newsreader called Gnus. The remainder of this appendix talks about how
7899to use Gnus with an MH message store. The version of Gnus that was
7900used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
7901work but versions prior to 5.8 use different options.
7902
7903This table contains a list of Gnus options that you will have to
7904modify. Note that for them to become accessible, you'll have to load
7905@file{nnml.el} first. This can be done with @kbd{M-x load-library
7906@key{RET} nnml @key{RET}}.
7907
7908@vtable @code
7909@item gnus-secondary-select-methods
7910Select the @samp{nnml} value. This select method uses directories for
7911folders and individual files for messages, just like MH. You do not
7912have to set an address.
7913@c -------------------------
7914@item mail-sources
7915Select the @samp{Several files in a directory} value, check the
7916@samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
7917your mail.
7918@c -------------------------
7919@item message-mail-user-agent
7920In order to send mail within Gnus using MH-E, set this option to
7921@samp{mail-user-agent} and set the @samp{mail-user-agent} option to
7922@samp{Emacs interface to MH}.
7923@c -------------------------
7924@item nnmail-keep-last-article
7925Since Gnus keeps track of which messages you have read, it would be
7926bad if Gnus expired the last message, for example, message 100, and
7927@command{rcvstore} gave the next new message number 1. Gnus would then
7928ignore it since it thinks that you've read messages 1-100. Turning on
7929this option ensures that the last message is never removed thereby
7930eliminating this problem.
7931@end vtable
7932
7933Next add the following to @file{~/.procmailrc}. If you don't subscribe
7934to the GnuCash mailing list, substitute one to which you are
7935subscribed.
3292 7936
3293@example 7937@example
3294--%%-@{+inbox/select@} 2 msgs (2-3) (MH-Folder)--All----------------- 7938MAILDIR=$HOME/`mhparam Path`
7939# Place mail sent to the GnuCash mailing list in gnucash.spool, where
7940# Gnus will pick it up.
7941:0:
7942* ^TO.*gnucash.*@.*gnucash.org
7943gnucash.spool
3295@end example 7944@end example
3296 7945
3297@node Odds and Ends, History, Customizing mh-e, Top 7946Wait for some messages to appear in @file{gnucash.spool} and run Gnus
7947with @kbd{M-x gnus @key{RET}}. To view the folder created in the
7948example above, you would tell Gnus about it the first time only with
7949@kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
7950known as @samp{+gnucash}.
7951
7952@node Odds and Ends, History, Procmail, Top
3298@appendix Odds and Ends 7953@appendix Odds and Ends
3299 7954
3300This appendix covers a few topics that don't fit elsewhere. Here I tell 7955This appendix covers a few topics that don't fit elsewhere. Here I
3301you how to report bugs and how to get on the mh-e mailing list. I also 7956tell you how to report bugs and how to get on the MH-E mailing lists.
3302point out some additional sources of information. 7957I also point out some additional sources of information.
3303 7958
3304@menu 7959@menu
3305* Bug Reports:: 7960* Bug Reports::
3306* Mailing List:: 7961* Mailing Lists::
3307* MH FAQ:: 7962* MH FAQ and Support::
3308* Getting mh-e:: 7963* Getting MH-E::
3309@end menu 7964@end menu
3310 7965
3311@node Bug Reports, Mailing List, Odds and Ends, Odds and Ends 7966@node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
3312@appendixsec Bug Reports 7967@appendixsec Bug Reports
3313 7968
3314@cindex bugs
3315@cindex Wohler, Bill
3316@cindex SourceForge 7969@cindex SourceForge
7970@cindex bugs
3317 7971
3318The current maintainer of mh-e is Bill Wohler 7972Bug reports should be filed at
3319<@i{wohler@@newt.com}>. Bug reports should be filed at 7973@uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. You
3320@uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. 7974need to be a SourceForge user to submit bug reports, but this is easy
3321Please include the output of 7975enough to do that it shouldn't be a restriction for you. Please
3322@kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug report you send. 7976include the output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in
7977any bug report you send unless you're 110% positive we won't ask for
7978it.
3323 7979
3324@node Mailing List, MH FAQ, Bug Reports, Odds and Ends 7980@node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
3325@appendixsec mh-e Mailing List 7981@appendixsec MH-E Mailing Lists
3326 7982
3327@cindex mailing list
3328@cindex SourceForge 7983@cindex SourceForge
7984@cindex mailing lists
3329 7985
3330There are actually several mailing lists for mh-e. They are 7986There are several mailing lists for MH-E. They are @i{mh-e-users at
3331@i{mh-e-users@@lists.sourceforge.net}, 7987lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
3332@i{mh-e-announce@@lists.sourceforge.net}, and 7988and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
3333@i{mh-e-devel@@lists.sourceforge.net}. You can subscribe or view the 7989the archives at @uref{https://sourceforge.net/mail/?group_id=13357,
3334archives at @uref{https://sourceforge.net/mail/?group_id=13357,
3335SourceForge}. Do not report bugs on these lists; please submit them 7990SourceForge}. Do not report bugs on these lists; please submit them
3336via SourceForge (@pxref{Bug Reports}). 7991via SourceForge (@pxref{Bug Reports}).
3337 7992
3338@node MH FAQ, Getting mh-e, Mailing List, Odds and Ends 7993@node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
3339@appendixsec MH FAQ 7994@appendixsec MH FAQ and Support
3340 7995
3341@cindex MH FAQ
3342@cindex FAQ 7996@cindex FAQ
7997@cindex MH FAQ
7998
7999The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8000Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8001@samp{comp.mail.mh}. While very little is there that deals with MH-E
8002specifically, there is an incredible wealth of material about MH
8003itself which you will find useful.
3343 8004
3344An FAQ appears monthly in the newsgroup @samp{comp.mail.mh}. While very 8005@cindex support
3345little is there that deals with mh-e specifically, there is an
3346incredible wealth of material about MH itself which you will find
3347useful. The subject of the FAQ is @cite{MH Frequently Asked Questions
3348(FAQ) with Answers}.
3349 8006
3350The FAQ is available via the World Wide Web (WWW) at 8007You can find FAQs on MH-E at the
3351@uref{http://www.faqs.org/faqs/mail/mh-faq/part1/preamble.html, faqs.org}. 8008@uref{https://sourceforge.net/support/?group_id=13357, Support
8009Requests} page on SourceForge. If you don't find the answer to your
8010question, file a support request and your question will become a new
8011FAQ!
3352 8012
3353@node Getting mh-e, , MH FAQ, Odds and Ends 8013@node Getting MH-E, , MH FAQ and Support, Odds and Ends
3354@appendixsec Getting mh-e 8014@appendixsec Getting MH-E
3355 8015
3356@cindex obtaining mh-e 8016@cindex MH-E, obtaining
8017@cindex getting MH-E
8018@cindex obtaining MH-E
3357 8019
3358The version of mh-e in the current version of Emacs should be up to 8020Because MH-E is undergoing a phase of sustained growth, the version of
3359date. It is most likely to be more up to date than the copy that comes 8021MH-E in your Emacs is likely to be out of date although it is most
3360with the MH distribution in @file{miscellany/mh-e}. 8022likely to be more up to date than the copy that comes with the MH
8023distribution in @file{miscellany/mh-e}.
8024
8025@cindex change log
8026@cindex release notes
3361 8027
3362@c intentionally wordy to avoid overfull hbox 8028@c intentionally wordy to avoid overfull hbox
3363New mh-e releases are always available for downloading at 8029New MH-E releases are always available for downloading at
3364@uref{https://sourceforge.net/project/showfiles.php?group_id=13357, 8030@uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
3365SourceForge} before they appear in an Emacs release. You can read the 8031SourceForge} before they appear in an Emacs release. You can read the
3366release notes on that page to determine if the given release of mh-e 8032release notes on that page to determine if the given release of MH-E
3367is already installed in your version of Emacs. 8033is already installed in your version of Emacs. You can also read the
3368 8034change log to see if you are interested in what the given release of
3369If you go this route, I suggest that you extract the files from 8035MH-E has to offer (although we have no doubt that you will be
3370@file{mh-e-@var{m.n}.tgz} in the following fashion: 8036extremely interested in all new releases).
3371 8037
3372@smallexample 8038@cindex @samp{MH-E-NEWS}
3373@group 8039@cindex @samp{README}
3374% @kbd{cd} # @r{Start in your home directory} 8040@cindex files, @samp{MH-E-NEWS}
3375% @kbd{mkdir lib lib/emacs} # @r{Create directory for mh-e} 8041@cindex files, @samp{README}
3376% @kbd{cd lib/emacs} 8042@cindex news
3377% @kbd{zcat @var{path/to/}mh-e-@var{m.n}.tgz | tar xvf -} # @r{Extract files}
3378@end group
3379@end smallexample
3380 8043
3381@cindex @file{.emacs} 8044After you download and extract the MH-E tarball, read the
3382@cindex files, @file{.emacs} 8045@file{README} file and @file{MH-E-NEWS}. These correspond to the
8046release notes and change log mentioned above. The file @file{README}
8047contains instructions on installing MH-E. If you're already running
8048Emacs, please quit that session and start again to load in the new
8049MH-E. Check that you're running the new version with the command
8050@kbd{M-x mh-version}.
3383 8051
3384To use these new files, add the following to @file{~/.emacs}: 8052@cindex contributed software
8053@cindex manual
8054@cindex documentation
3385 8055
3386@lisp 8056In addition to the mh-e package, the
3387(setq load-path (cons (expand-file-name "~/lib/emacs") load-path)) 8057@uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
3388@end lisp 8058SourceForge} site also contains doc and contrib packages. The former
3389 8059is the latest release of this manual, and the latter contains a few
3390@cindex news 8060contributed packages you might find useful.
3391@cindex files, @samp{MH-E-NEWS}
3392
3393That's it! If you're already running Emacs, please quit that session
3394and start again to load in the new mh-e. Check that you're running the
3395new version with the command @kbd{M-x mh-version} after running any mh-e
3396command. The distribution comes with a file called @file{MH-E-NEWS} so
3397you can see what's new.
3398 8061
3399@node History, Copying, Odds and Ends, Top 8062@node History, GFDL, Odds and Ends, Top
3400@appendix History of mh-e 8063@appendix History of MH-E
3401 8064
8065@cindex Bill Wohler
8066@cindex Brian Reid
3402@cindex Gildea, Stephen 8067@cindex Gildea, Stephen
8068@cindex Jim Larus
3403@cindex Larus, Jim 8069@cindex Larus, Jim
8070@cindex MH-E, versions
3404@cindex Reid, Brian 8071@cindex Reid, Brian
3405@cindex SourceForge 8072@cindex SourceForge
3406@cindex history of mh-e 8073@cindex Stephen Gildea
8074@cindex Wohler, Bill
8075@cindex history of MH-E
8076@cindex versions of MH-E
3407 8077
3408mh-e was originally written by Brian Reid in 1983 and has changed 8078MH-E was originally written by Brian Reid in 1983 and has changed
3409hands several times since then. Jim Larus wanted to do something 8079hands several times since then. Jim Larus wanted to do something
3410similar for GNU Emacs, and ended up completely rewriting it that same 8080similar for GNU Emacs, and ended up completely rewriting it that same
3411year. In 1989, Stephen Gildea picked it up and added many improvements. 8081year. In 1989, Stephen Gildea picked it up and added many
3412Bill Wohler then took over in 2000 and moved its development to 8082improvements. Bill Wohler then took over in 2000 and moved its
3413@uref{http://sourceforge.net/, SourceForge}. 8083development to @uref{http://sourceforge.net/, SourceForge} where it
8084lives today.
3414 8085
3415@menu 8086@menu
3416* From Brian Reid:: 8087* From Brian Reid::
3417* From Jim Larus:: 8088* From Jim Larus::
3418* From Stephen Gildea:: 8089* From Stephen Gildea::
8090* From Bill Wohler::
3419@end menu 8091@end menu
3420 8092
3421@node From Brian Reid, From Jim Larus, History, History 8093@node From Brian Reid, From Jim Larus, History, History
3422@appendixsec From Brian Reid 8094@appendixsec From Brian Reid
3423 8095
8096@cindex Brian Reid
3424@cindex Reid, Brian 8097@cindex Reid, Brian
3425 8098
3426One day in 1983 I got the flu and had to stay home from work for three 8099One day in 1983 I got the flu and had to stay home from work for three
3427days with nothing to do. I used that time to write MHE@. The 8100days with nothing to do. I used that time to write MHE@. The
3428fundamental idea behind MHE was that it was a ``puppeteer'' driving the MH 8101fundamental idea behind MHE was that it was a ``puppeteer'' driving
3429programs underneath it. MH had a model that the editor was supposed to 8102the MH programs underneath it. MH had a model that the editor was
3430run as a subprocess of the mailer, which seemed to me at the time to be 8103supposed to run as a sub-process of the mailer, which seemed to me at
3431the tail wagging the dog. So I turned it around and made the editor 8104the time to be the tail wagging the dog. So I turned it around and
3432drive the MH programs. I made sure that the UCI people (who were 8105made the editor drive the MH programs. I made sure that the UCI people
3433maintaining MH at the time) took in my changes and made them stick. 8106(who were maintaining MH at the time) took in my changes and made them
3434 8107stick.
3435Today, I still use my own version of MHE because I don't at all like the 8108
3436way that GNU mh-e works and I've never gotten to be good enough at 8109Today, I still use my own version of MHE because I don't at all like
3437hacking Emacs Lisp to make GNU mh-e do what I want. The Gosling-emacs 8110the way that GNU MH-E works and I've never gotten to be good enough at
3438version of MHE and the GNU Emacs version of mh-e have almost nothing in 8111hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
3439common except similar names. They work differently, have different 8112version of MHE and the GNU Emacs version of MH-E have almost nothing
3440conceptual models, and have different key bindings. @footnote{After 8113in common except similar names. They work differently, have different
8114conceptual models, and have different key bindings@footnote{After
3441reading this article, I questioned Brian about his version of MHE, and 8115reading this article, I questioned Brian about his version of MHE, and
3442received some great ideas for improving mh-e such as a dired-like method 8116received some great ideas for improving MH-E such as a dired-like
3443of selecting folders; and removing the prompting when sending mail, 8117method of selecting folders; and removing the prompting when sending
3444filling in the blanks in the draft buffer instead. I passed them on to 8118mail, filling in the blanks in the draft buffer instead. I passed them
3445Stephen Gildea, the current maintainer, and he was excited about the 8119on to Stephen Gildea, the current maintainer, and he was excited about
3446ideas as well. Perhaps one day, mh-e will again resemble MHE, although 8120the ideas as well. Perhaps one day, MH-E will again resemble MHE
3447none of these ideas are manifest in Version 5.0.} 8121(draft form editing was introduced in version 7.4).}.
3448 8122
3449Brian Reid, June 1994 8123Brian Reid, June 1994
3450 8124
3451@node From Jim Larus, From Stephen Gildea, From Brian Reid, History 8125@node From Jim Larus, From Stephen Gildea, From Brian Reid, History
3452@appendixsec From Jim Larus 8126@appendixsec From Jim Larus
3453 8127
8128@cindex Jim Larus
3454@cindex Larus, Jim 8129@cindex Larus, Jim
3455 8130
3456Brian Reid, while at CMU or shortly after going to Stanford wrote a mail 8131Brian Reid, while at CMU or shortly after going to Stanford wrote a
3457reading program called MHE for Gosling Emacs. It had much the same 8132mail reading program called MHE for Gosling Emacs. It had much the
3458structure as mh-e (i.e., invoked MH programs), though it was simpler and 8133same structure as MH-E (i.e., invoked MH programs), though it was
3459the commands were slightly different. Unfortunately, I no longer have a 8134simpler and the commands were slightly different. Unfortunately, I no
3460copy so the differences are lost in the mists of time. 8135longer have a copy so the differences are lost in the mists of time.
3461 8136
3462In '82-83, I was working at BBN and wrote a lot of mlisp code in Gosling 8137In '82-83, I was working at BBN and wrote a lot of mlisp code in
3463Emacs to make it look more like Tennex Emacs. One of the packages that 8138Gosling Emacs to make it look more like Tennex Emacs. One of the
3464I picked up and improved was Reid's mail system. In '83, I went back to 8139packages that I picked up and improved was Reid's mail system. In '83,
3465Berkeley. About that time, Stallman's first version of GNU Emacs came 8140I went back to Berkeley. About that time, Stallman's first version of
3466out and people started to move to it from Gosling Emacs (as I recall, 8141GNU Emacs came out and people started to move to it from Gosling Emacs
3467the transition took a year or two). I decided to port Reid's MHE and 8142(as I recall, the transition took a year or two). I decided to port
3468used the mlisp to Emacs Lisp translator that came with GNU Emacs. It 8143Reid's MHE and used the mlisp to Emacs Lisp translator that came with
3469did a lousy job and the resulting code didn't work, so I bit the bullet 8144GNU Emacs. It did a lousy job and the resulting code didn't work, so I
3470and rewrote the code by hand (it was a lot smaller and simpler then, so 8145bit the bullet and rewrote the code by hand (it was a lot smaller and
3471it took only a day or two). 8146simpler then, so it took only a day or two).
3472 8147
3473Soon after that, mh-e became part of the standard Emacs distribution and 8148Soon after that, MH-E became part of the standard Emacs distribution
3474suggestions kept dribbling in for improvements. mh-e soon reached 8149and suggestions kept dribbling in for improvements. MH-E soon reached
3475sufficient functionality to keep me happy, but I kept on improving it 8150sufficient functionality to keep me happy, but I kept on improving it
3476because I was a graduate student with plenty of time on my hands and it 8151because I was a graduate student with plenty of time on my hands and
3477was more fun than my dissertation. In retrospect, the one thing that I 8152it was more fun than my dissertation. In retrospect, the one thing
3478regret is not writing any documentation, which seriously limited the use 8153that I regret is not writing any documentation, which seriously
3479and appeal of the package. 8154limited the use and appeal of the package.
3480 8155
3481@cindex @code{xmh}, in mh-e history 8156@cindex @command{xmh}, in MH-E history
3482 8157
3483In '89, I came to Wisconsin as a professor and decided not to work on 8158In '89, I came to Wisconsin as a professor and decided not to work on
3484mh-e. It was stable, except for minor bugs, and had enough 8159MH-E. It was stable, except for minor bugs, and had enough
3485functionality, so I let it be for a few years. Stephen Gildea of BBN 8160functionality, so I let it be for a few years. Stephen Gildea of BBN
3486began to pester me about the bugs, but I ignored them. In 1990, he went 8161began to pester me about the bugs, but I ignored them. In 1990, he
3487off to the X Consortium, said good bye, and said that he would now be 8162went off to the X Consortium, said good bye, and said that he would
3488using @code{xmh}. A few months later, he came back and said that he 8163now be using @command{xmh}. A few months later, he came back and said
3489couldn't stand @code{xmh} and could I put a few more bug fixes into 8164that he couldn't stand @command{xmh} and could I put a few more bug fixes
3490mh-e. At that point, I had no interest in fixing mh-e, so I gave the 8165into MH-E. At that point, I had no interest in fixing MH-E, so I gave
3491responsibility of maintenance to him and he has done a fine job since 8166the responsibility of maintenance to him and he has done a fine job
3492then. 8167since then.
3493 8168
3494Jim Larus, June 1994 8169Jim Larus, June 1994
3495 8170
3496@node From Stephen Gildea, , From Jim Larus, History 8171@node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
3497@appendixsec From Stephen Gildea 8172@appendixsec From Stephen Gildea
3498 8173
3499@cindex Gildea, Stephen 8174@cindex Gildea, Stephen
8175@cindex Stephen Gildea
3500 8176
3501In 1987 I went to work for Bolt Beranek and Newman, as Jim had before 8177In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
3502me. In my previous job, I had been using RMAIL, but as my folders tend 8178me. In my previous job, I had been using RMAIL, but as my folders tend
3503to run large, I was frustrated with the speed of RMAIL@. However, I 8179to run large, I was frustrated with the speed of RMAIL@. However, I
3504stuck with it because I wanted the GNU Emacs interface. I am very 8180stuck with it because I wanted the GNU Emacs interface. I am very
3505familiar and comfortable with the Emacs interface (with just a few 8181familiar and comfortable with the Emacs interface (with just a few
3506modifications of my own) and dislike having to use applications with 8182modifications of my own) and dislike having to use applications with
3507embedded editors; they never live up to Emacs. 8183embedded editors; they never live up to Emacs.
3508 8184
3509MH is the mail reader of choice at BBN, so I converted to it. Since I 8185MH is the mail reader of choice at BBN, so I converted to it. Since I
3510didn't want to give up using an Emacs interface, I started using mh-e. 8186didn't want to give up using an Emacs interface, I started using MH-E.
3511As is my wont, I started hacking on it almost immediately. I first used 8187As is my wont, I started hacking on it almost immediately. I first
3512version 3.4m. One of the first features I added was to treat the folder 8188used version 3.4m. One of the first features I added was to treat the
3513buffer as a file-visiting buffer: you could lock it, save it, and be 8189folder buffer as a file-visiting buffer: you could lock it, save it,
3514warned of unsaved changes when killing it. I also worked to bring its 8190and be warned of unsaved changes when killing it. I also worked to
3515functionality a little closer to RMAIL@. Jim Larus was very cooperative 8191bring its functionality a little closer to RMAIL@. Jim Larus was very
3516about merging in my changes, and my efforts first appeared in version 8192cooperative about merging in my changes, and my efforts first appeared
35173.6, distributed with Emacs 18.52 in 1988. Next I decided mh-e was too 8193in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
3518slow and optimized it a lot. Version, 3.7, distributed with Emacs 18.56 8194MH-E was too slow and optimized it a lot. Version, 3.7, distributed
3519in 1990, was noticeably faster. 8195with Emacs 18.56 in 1990, was noticeably faster.
3520 8196
3521When I moved to the X Consortium I became the first person there to not 8197When I moved to the X Consortium I became the first person there to
3522use xmh. (There is now one other engineer there using mh-e.) About 8198not use xmh. (There is now one other engineer there using MH-E.) About
3523this point I took over maintenance of mh-e from Jim and was finally able 8199this point I took over maintenance of MH-E from Jim and was finally
3524to add some features Jim hadn't accepted, such as the backward searching 8200able to add some features Jim hadn't accepted, such as the backward
3525undo. My first release was 3.8 (Emacs 18.58) in 1992. 8201searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
3526 8202
3527Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0. 8203Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
3528Version 4.0 added many new features, including background folder 8204Version 4.0 added many new features, including background folder
3529collection and support for composing @sc{mime} messages. (Reading 8205collection and support for composing @sc{mime} messages. (Reading
3530@sc{mime} messages remains to be done, alas.) While writing this book, 8206@sc{mime} messages remains to be done, alas.) While writing this book,
3531Bill Wohler gave mh-e its closest examination ever, uncovering bugs and 8207Bill Wohler gave MH-E its closest examination ever, uncovering bugs
3532inconsistencies that required a new major version to fix, and so version 8208and inconsistencies that required a new major version to fix, and so
35335 was released. 8209version 5 was released.
3534 8210
3535Stephen Gildea, June 1994 8211Stephen Gildea, June 1994
3536 8212
3537@node Copying, Command Index, History, Top 8213@node From Bill Wohler, , From Stephen Gildea, History
3538@appendix GNU GENERAL PUBLIC LICENSE 8214@appendixsec From Bill Wohler
8215
8216@cindex Wohler, Bill
8217@cindex Bill Wohler
8218
8219The preface originally included the following text which I use to
8220begin my story:
8221
8222@quotation
8223But it's important to note a brief history of MH-E.
8224
8225@w{Version 3} was prevalent through the @w{Emacs 18} and early
8226@w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8227which introduced several new and changed commands. Next, @w{Version
82285.0} was released, which fixed some bugs and incompatibilities, and
8229was incorporated into @w{Emacs 19.29}.
8230@end quotation
8231
8232After a long break, Stephen handed the reins over to me in 2000. I
8233moved the project to a new site called SourceForge and organized a
8234great team of developers. Our first release in late 2001 was version
82356. It appeared in Emacs 21.2 and had menus and tool bar buttons.
8236
8237Then, indexed searches, improved MIME handling, a speedbar, multiple
8238identities, alias completion, an index view of unseen messages, spam
8239software support, Face and X-Image-URL header field support, Fcc
8240completion, arbitrary range handling, and draft form editing were
8241introduced in the version 7 series in Emacs 21.4 (2004).
8242
8243Version 8 development was mostly driven by the rewrite of the manual.
8244It also brought mailutils support, S/MIME support, picon support, and
8245an improved interface for hiding header fields. The CVS repository was
8246migrated from SourceForge to Savannah (only for those files that were
8247already part of Emacs) and the software was completely reorganized to
8248push back two decades of entropy. It appeared in Emacs 22.1 (2006).
8249
8250Bill Wohler, February 2006
8251
8252@node GFDL, GPL, History, Top
8253@appendix GNU FREE DOCUMENTATION LICENSE
8254@center Version 1.2, November 2002
8255
8256@display
8257Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
825851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8259
8260Everyone is permitted to copy and distribute verbatim copies
8261of this license document, but changing it is not allowed.
8262@end display
8263@sp 1
8264@enumerate 0
8265@item
8266PREAMBLE
8267
8268The purpose of this License is to make a manual, textbook, or other
8269functional and useful document ``free'' in the sense of freedom: to
8270assure everyone the effective freedom to copy and redistribute it,
8271with or without modifying it, either commercially or noncommercially.
8272Secondarily, this License preserves for the author and publisher a way
8273to get credit for their work, while not being considered responsible
8274for modifications made by others.
8275
8276This License is a kind of ``copyleft'', which means that derivative
8277works of the document must themselves be free in the same sense. It
8278complements the GNU General Public License, which is a copyleft
8279license designed for free software.
8280
8281We have designed this License in order to use it for manuals for free
8282software, because free software needs free documentation: a free
8283program should come with manuals providing the same freedoms that the
8284software does. But this License is not limited to software manuals;
8285it can be used for any textual work, regardless of subject matter or
8286whether it is published as a printed book. We recommend this License
8287principally for works whose purpose is instruction or reference.
8288
8289@sp 1
8290@item
8291APPLICABILITY AND DEFINITIONS
8292
8293This License applies to any manual or other work, in any medium, that
8294contains a notice placed by the copyright holder saying it can be
8295distributed under the terms of this License. Such a notice grants a
8296world-wide, royalty-free license, unlimited in duration, to use that
8297work under the conditions stated herein. The ``Document'', below,
8298refers to any such manual or work. Any member of the public is a
8299licensee, and is addressed as ``you''. You accept the license if you
8300copy, modify or distribute the work in a way requiring permission
8301under copyright law.
8302
8303A ``Modified Version'' of the Document means any work containing the
8304Document or a portion of it, either copied verbatim, or with
8305modifications and/or translated into another language.
8306
8307A ``Secondary Section'' is a named appendix or a front-matter section of
8308the Document that deals exclusively with the relationship of the
8309publishers or authors of the Document to the Document's overall subject
8310(or to related matters) and contains nothing that could fall directly
8311within that overall subject. (Thus, if the Document is in part a
8312textbook of mathematics, a Secondary Section may not explain any
8313mathematics.) The relationship could be a matter of historical
8314connection with the subject or with related matters, or of legal,
8315commercial, philosophical, ethical or political position regarding
8316them.
8317
8318The ``Invariant Sections'' are certain Secondary Sections whose titles
8319are designated, as being those of Invariant Sections, in the notice
8320that says that the Document is released under this License. If a
8321section does not fit the above definition of Secondary then it is not
8322allowed to be designated as Invariant. The Document may contain zero
8323Invariant Sections. If the Document does not identify any Invariant
8324Sections then there are none.
8325
8326The ``Cover Texts'' are certain short passages of text that are listed,
8327as Front-Cover Texts or Back-Cover Texts, in the notice that says that
8328the Document is released under this License. A Front-Cover Text may
8329be at most 5 words, and a Back-Cover Text may be at most 25 words.
8330
8331A ``Transparent'' copy of the Document means a machine-readable copy,
8332represented in a format whose specification is available to the
8333general public, that is suitable for revising the document
8334straightforwardly with generic text editors or (for images composed of
8335pixels) generic paint programs or (for drawings) some widely available
8336drawing editor, and that is suitable for input to text formatters or
8337for automatic translation to a variety of formats suitable for input
8338to text formatters. A copy made in an otherwise Transparent file
8339format whose markup, or absence of markup, has been arranged to thwart
8340or discourage subsequent modification by readers is not Transparent.
8341An image format is not Transparent if used for any substantial amount
8342of text. A copy that is not ``Transparent'' is called ``Opaque.''
8343
8344
8345Examples of suitable formats for Transparent copies include plain
8346ASCII without markup, Texinfo input format, LaTeX input format, SGML
8347or XML using a publicly available DTD, and standard-conforming simple
8348HTML, PostScript or PDF designed for human modification. Examples of
8349transparent image formats include PNG, XCF and JPG. Opaque formats
8350include proprietary formats that can be read and edited only by
8351proprietary word processors, SGML or XML for which the DTD and/or
8352processing tools are not generally available, and the
8353machine-generated HTML, PostScript or PDF produced by some word
8354processors for output purposes only.
8355
8356The ``Title Page'' means, for a printed book, the title page itself,
8357plus such following pages as are needed to hold, legibly, the material
8358this License requires to appear in the title page. For works in
8359formats which do not have any title page as such, ``Title Page'' means
8360the text near the most prominent appearance of the work's title,
8361preceding the beginning of the body of the text.
8362
8363A section ``Entitled XYZ'' means a named subunit of the Document whose
8364title either is precisely XYZ or contains XYZ in parentheses following
8365text that translates XYZ in another language. (Here XYZ stands for a
8366specific section name mentioned below, such as ``Acknowledgements'',
8367``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
8368of such a section when you modify the Document means that it remains a
8369section ``Entitled XYZ'' according to this definition.
8370
8371The Document may include Warranty Disclaimers next to the notice which
8372states that this License applies to the Document. These Warranty
8373Disclaimers are considered to be included by reference in this
8374License, but only as regards disclaiming warranties: any other
8375implication that these Warranty Disclaimers may have is void and has
8376no effect on the meaning of this License.
8377@sp 1
8378@item
8379VERBATIM COPYING
8380
8381You may copy and distribute the Document in any medium, either
8382commercially or noncommercially, provided that this License, the
8383copyright notices, and the license notice saying this License applies
8384to the Document are reproduced in all copies, and that you add no other
8385conditions whatsoever to those of this License. You may not use
8386technical measures to obstruct or control the reading or further
8387copying of the copies you make or distribute. However, you may accept
8388compensation in exchange for copies. If you distribute a large enough
8389number of copies you must also follow the conditions in section 3.
8390
8391You may also lend copies, under the same conditions stated above, and
8392you may publicly display copies.
8393@sp 1
8394@item
8395COPYING IN QUANTITY
8396
8397If you publish printed copies (or copies in media that commonly have
8398printed covers) of the Document, numbering more than 100, and the
8399Document's license notice requires Cover Texts, you must enclose the
8400copies in covers that carry, clearly and legibly, all these Cover
8401Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
8402the back cover. Both covers must also clearly and legibly identify
8403you as the publisher of these copies. The front cover must present
8404the full title with all words of the title equally prominent and
8405visible. You may add other material on the covers in addition.
8406Copying with changes limited to the covers, as long as they preserve
8407the title of the Document and satisfy these conditions, can be treated
8408as verbatim copying in other respects.
8409
8410If the required texts for either cover are too voluminous to fit
8411legibly, you should put the first ones listed (as many as fit
8412reasonably) on the actual cover, and continue the rest onto adjacent
8413pages.
8414
8415If you publish or distribute Opaque copies of the Document numbering
8416more than 100, you must either include a machine-readable Transparent
8417copy along with each Opaque copy, or state in or with each Opaque copy
8418a computer-network location from which the general network-using
8419public has access to download using public-standard network protocols
8420a complete Transparent copy of the Document, free of added material.
8421If you use the latter option, you must take reasonably prudent steps,
8422when you begin distribution of Opaque copies in quantity, to ensure
8423that this Transparent copy will remain thus accessible at the stated
8424location until at least one year after the last time you distribute an
8425Opaque copy (directly or through your agents or retailers) of that
8426edition to the public.
8427
8428It is requested, but not required, that you contact the authors of the
8429Document well before redistributing any large number of copies, to give
8430them a chance to provide you with an updated version of the Document.
8431@sp 1
8432@item
8433MODIFICATIONS
8434
8435You may copy and distribute a Modified Version of the Document under
8436the conditions of sections 2 and 3 above, provided that you release
8437the Modified Version under precisely this License, with the Modified
8438Version filling the role of the Document, thus licensing distribution
8439and modification of the Modified Version to whoever possesses a copy
8440of it. In addition, you must do these things in the Modified Version:
8441
8442A. Use in the Title Page (and on the covers, if any) a title distinct
8443 from that of the Document, and from those of previous versions
8444 (which should, if there were any, be listed in the History section
8445 of the Document). You may use the same title as a previous version
8446 if the original publisher of that version gives permission.@*
8447B. List on the Title Page, as authors, one or more persons or entities
8448 responsible for authorship of the modifications in the Modified
8449 Version, together with at least five of the principal authors of the
8450 Document (all of its principal authors, if it has fewer than five),
8451 unless they release you from this requirement.@*
8452C. State on the Title page the name of the publisher of the
8453 Modified Version, as the publisher.@*
8454D. Preserve all the copyright notices of the Document.@*
8455E. Add an appropriate copyright notice for your modifications
8456 adjacent to the other copyright notices.@*
8457F. Include, immediately after the copyright notices, a license notice
8458 giving the public permission to use the Modified Version under the
8459 terms of this License, in the form shown in the Addendum below.@*
8460G. Preserve in that license notice the full lists of Invariant Sections
8461 and required Cover Texts given in the Document's license notice.@*
8462H. Include an unaltered copy of this License.@*
8463I. Preserve the section Entitled ``History'', Preserve its Title, and add
8464 to it an item stating at least the title, year, new authors, and
8465 publisher of the Modified Version as given on the Title Page. If
8466 there is no section Entitled ``History'' in the Document, create one
8467 stating the title, year, authors, and publisher of the Document as
8468 given on its Title Page, then add an item describing the Modified
8469 Version as stated in the previous sentence.@*
8470J. Preserve the network location, if any, given in the Document for
8471 public access to a Transparent copy of the Document, and likewise
8472 the network locations given in the Document for previous versions
8473 it was based on. These may be placed in the ``History'' section.
8474 You may omit a network location for a work that was published at
8475 least four years before the Document itself, or if the original
8476 publisher of the version it refers to gives permission.@*
8477K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
8478 Preserve the Title of the section, and preserve in the section all
8479 the substance and tone of each of the contributor acknowledgements
8480 and/or dedications given therein.@*
8481L. Preserve all the Invariant Sections of the Document,
8482 unaltered in their text and in their titles. Section numbers
8483 or the equivalent are not considered part of the section titles.@*
8484M. Delete any section Entitled ``Endorsements.'' Such a section
8485 may not be included in the Modified Version.@*
8486N. Do not retitle any existing section to be Entitled ``Endorsements''
8487 or to conflict in title with any Invariant Section.@*
8488O. Preserve any Warranty Disclaimers.@*
8489@sp 1
8490If the Modified Version includes new front-matter sections or
8491appendices that qualify as Secondary Sections and contain no material
8492copied from the Document, you may at your option designate some or all
8493of these sections as invariant. To do this, add their titles to the
8494list of Invariant Sections in the Modified Version's license notice.
8495These titles must be distinct from any other section titles.
8496
8497You may add a section Entitled ``Endorsements'', provided it contains
8498nothing but endorsements of your Modified Version by various
8499parties--for example, statements of peer review or that the text has
8500been approved by an organization as the authoritative definition of a
8501standard.
8502
8503You may add a passage of up to five words as a Front-Cover Text, and a
8504passage of up to 25 words as a Back-Cover Text, to the end of the list
8505of Cover Texts in the Modified Version. Only one passage of
8506Front-Cover Text and one of Back-Cover Text may be added by (or
8507through arrangements made by) any one entity. If the Document already
8508includes a cover text for the same cover, previously added by you or
8509by arrangement made by the same entity you are acting on behalf of,
8510you may not add another; but you may replace the old one, on explicit
8511permission from the previous publisher that added the old one.
8512
8513The author(s) and publisher(s) of the Document do not by this License
8514give permission to use their names for publicity for or to assert or
8515imply endorsement of any Modified Version.
8516@sp 1
8517@item
8518COMBINING DOCUMENTS
8519
8520You may combine the Document with other documents released under this
8521License, under the terms defined in section 4 above for modified
8522versions, provided that you include in the combination all of the
8523Invariant Sections of all of the original documents, unmodified, and
8524list them all as Invariant Sections of your combined work in its
8525license notice, and that you preserve all their Warranty Disclaimers.
8526
8527The combined work need only contain one copy of this License, and
8528multiple identical Invariant Sections may be replaced with a single
8529copy. If there are multiple Invariant Sections with the same name but
8530different contents, make the title of each such section unique by
8531adding at the end of it, in parentheses, the name of the original
8532author or publisher of that section if known, or else a unique number.
8533Make the same adjustment to the section titles in the list of
8534Invariant Sections in the license notice of the combined work.
8535
8536In the combination, you must combine any sections Entitled ``History''
8537in the various original documents, forming one section Entitled
8538``History''; likewise combine any sections Entitled ``Acknowledgements'',
8539and any sections Entitled ``Dedications.'' You must delete all sections
8540Entitled ``Endorsements.''
8541@sp 1
8542@item
8543COLLECTIONS OF DOCUMENTS
8544
8545You may make a collection consisting of the Document and other documents
8546released under this License, and replace the individual copies of this
8547License in the various documents with a single copy that is included in
8548the collection, provided that you follow the rules of this License for
8549verbatim copying of each of the documents in all other respects.
8550
8551You may extract a single document from such a collection, and distribute
8552it individually under this License, provided you insert a copy of this
8553License into the extracted document, and follow this License in all
8554other respects regarding verbatim copying of that document.
8555@sp 1
8556@item
8557AGGREGATION WITH INDEPENDENT WORKS
8558
8559A compilation of the Document or its derivatives with other separate
8560and independent documents or works, in or on a volume of a storage or
8561distribution medium, is called an ``aggregate'' if the copyright
8562resulting from the compilation is not used to limit the legal rights
8563of the compilation's users beyond what the individual works permit.
8564When the Document is included in an aggregate, this License does not
8565apply to the other works in the aggregate which are not themselves
8566derivative works of the Document.
8567
8568If the Cover Text requirement of section 3 is applicable to these
8569copies of the Document, then if the Document is less than one half of
8570the entire aggregate, the Document's Cover Texts may be placed on
8571covers that bracket the Document within the aggregate, or the
8572electronic equivalent of covers if the Document is in electronic form.
8573Otherwise they must appear on printed covers that bracket the whole
8574aggregate.
8575@sp 1
8576@item
8577TRANSLATION
8578
8579Translation is considered a kind of modification, so you may
8580distribute translations of the Document under the terms of section 4.
8581Replacing Invariant Sections with translations requires special
8582permission from their copyright holders, but you may include
8583translations of some or all Invariant Sections in addition to the
8584original versions of these Invariant Sections. You may include a
8585translation of this License, and all the license notices in the
8586Document, and any Warranty Disclaimers, provided that you also include
8587the original English version of this License and the original versions
8588of those notices and disclaimers. In case of a disagreement between
8589the translation and the original version of this License or a notice
8590or disclaimer, the original version will prevail.
8591
8592If a section in the Document is Entitled ``Acknowledgements'',
8593``Dedications'', or ``History'', the requirement (section 4) to Preserve
8594its Title (section 1) will typically require changing the actual
8595title.
8596@sp 1
8597@item
8598TERMINATION
8599
8600You may not copy, modify, sublicense, or distribute the Document except
8601as expressly provided for under this License. Any other attempt to
8602copy, modify, sublicense or distribute the Document is void, and will
8603automatically terminate your rights under this License. However,
8604parties who have received copies, or rights, from you under this
8605License will not have their licenses terminated so long as such
8606parties remain in full compliance.
8607@sp 1
8608@item
8609FUTURE REVISIONS OF THIS LICENSE
8610
8611The Free Software Foundation may publish new, revised versions
8612of the GNU Free Documentation License from time to time. Such new
8613versions will be similar in spirit to the present version, but may
8614differ in detail to address new problems or concerns. See
8615http://www.gnu.org/copyleft/.
8616
8617Each version of the License is given a distinguishing version number.
8618If the Document specifies that a particular numbered version of this
8619License ``or any later version'' applies to it, you have the option of
8620following the terms and conditions either of that specified version or
8621of any later version that has been published (not as a draft) by the
8622Free Software Foundation. If the Document does not specify a version
8623number of this License, you may choose any version ever published (not
8624as a draft) by the Free Software Foundation.
8625
8626@end enumerate
8627
8628@unnumberedsec ADDENDUM: How to use this License for your documents
8629
8630To use this License in a document you have written, include a copy of
8631the License in the document and put the following copyright and
8632license notices just after the title page:
3539 8633
8634@smallexample
8635@group
8636Copyright (C) @var{year} @var{your name}.
8637Permission is granted to copy, distribute and/or modify this document
8638under the terms of the GNU Free Documentation License, Version 1.2
8639or any later version published by the Free Software Foundation;
8640with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
8641A copy of the license is included in the section entitled ``GNU
8642Free Documentation License''.
8643@end group
8644@end smallexample
8645
8646If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
8647replace the ``with...Texts.'' line with this:
8648
8649@smallexample
8650@group
8651with the Invariant Sections being @var{list their titles}, with the
8652Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
8653@var{list}.
8654@end group
8655@end smallexample
8656
8657If you have Invariant Sections without Cover Texts, or some other
8658combination of the three, merge those two alternatives to suit the
8659situation.
8660
8661If your document contains nontrivial examples of program code, we
8662recommend releasing these examples in parallel under your choice of
8663free software license, such as the GNU General Public License,
8664to permit their use in free software.
8665
8666@node GPL, Key Index, GFDL, Top
8667@appendix GNU GENERAL PUBLIC LICENSE
3540@center Version 2, June 1991 8668@center Version 2, June 1991
3541 8669
3542@display 8670@display
3543Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. 8671Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
354451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 867251 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
3545 8673
3546Everyone is permitted to copy and distribute verbatim copies 8674Everyone is permitted to copy and distribute verbatim copies
3547of this license document, but changing it is not allowed. 8675of this license document, but changing it is not allowed.
3548@end display 8676@end display
3549 8677
3550@appendixsec Preamble 8678@unnumberedsec Preamble
3551 8679
3552 The licenses for most software are designed to take away your 8680 The licenses for most software are designed to take away your
3553freedom to share and change it. By contrast, the GNU General Public 8681freedom to share and change it. By contrast, the GNU General Public
@@ -3598,7 +8726,7 @@ patent must be licensed for everyone's free use or not licensed at all.
3598modification follow. 8726modification follow.
3599 8727
3600@iftex 8728@iftex
3601@appendixsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 8729@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3602@end iftex 8730@end iftex
3603@ifinfo 8731@ifinfo
3604@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 8732@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -3860,7 +8988,7 @@ POSSIBILITY OF SUCH DAMAGES.
3860@end ifinfo 8988@end ifinfo
3861 8989
3862@page 8990@page
3863@appendixsec How to Apply These Terms to Your New Programs 8991@unnumberedsec How to Apply These Terms to Your New Programs
3864 8992
3865 If you develop a new program, and you want it to be of the greatest 8993 If you develop a new program, and you want it to be of the greatest
3866possible use to the public, the best way to achieve this is to make it 8994possible use to the public, the best way to achieve this is to make it
@@ -3873,7 +9001,7 @@ the ``copyright'' line and a pointer to where the full notice is found.
3873 9001
3874@smallexample 9002@smallexample
3875@var{one line to give the program's name and an idea of what it does.} 9003@var{one line to give the program's name and an idea of what it does.}
3876Copyright (C) 20@var{yy} @var{name of author} 9004Copyright (C) 19@var{yy} @var{name of author}
3877 9005
3878This program is free software; you can redistribute it and/or 9006This program is free software; you can redistribute it and/or
3879modify it under the terms of the GNU General Public License 9007modify it under the terms of the GNU General Public License
@@ -3887,7 +9015,7 @@ GNU General Public License for more details.
3887 9015
3888You should have received a copy of the GNU General Public License along 9016You should have received a copy of the GNU General Public License along
3889with this program; if not, write to the Free Software Foundation, Inc., 9017with this program; if not, write to the Free Software Foundation, Inc.,
389051 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 901851 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3891@end smallexample 9019@end smallexample
3892 9020
3893Also add information on how to contact you by electronic and paper mail. 9021Also add information on how to contact you by electronic and paper mail.
@@ -3931,27 +9059,101 @@ consider it more useful to permit linking proprietary applications with the
3931library. If this is what you want to do, use the GNU Library General 9059library. If this is what you want to do, use the GNU Library General
3932Public License instead of this License. 9060Public License instead of this License.
3933 9061
3934@node Command Index, Variable Index, Copying, Top 9062@node Key Index, Command Index, GPL, Top
3935@unnumbered Command Index 9063@unnumbered Key (Character) Index
9064@printindex ky
3936 9065
9066@node Command Index, Option Index, Key Index, Top
9067@unnumbered Command Index
3937@printindex fn 9068@printindex fn
3938 9069
3939@node Variable Index, Concept Index, Command Index, Top 9070@node Option Index, Concept Index, Command Index, Top
3940@unnumbered Variable Index 9071@unnumbered Option (Variable) Index
3941
3942@printindex vr 9072@printindex vr
3943 9073
3944@node Concept Index, , Variable Index, Top 9074@node Concept Index, , Option Index, Top
3945@unnumbered Concept Index 9075@unnumbered Concept Index
3946
3947@printindex cp 9076@printindex cp
3948 9077
3949@contents
3950@bye 9078@bye
3951 9079
3952@c XXX In the sections on customizing mh-e, you can add cross-references 9080@c Ispell Helpers
3953@c to the Emacs manual and the Emacs Lisp manual wherever they are 9081@c
3954@c useful. @pxref{node, , section, emacs, The GNU Emacs Manual} 9082@c The following are words that ispell should ignore that would not
9083@c normally be in a dictionary (global or personal). Be careful not to
9084@c include words here that could potentially be typos of other words
9085@c (such as url, elisp, or MHE).
9086@c
9087@c LocalWords: CTRL ESC SPC f's
9088@c LocalWords: addr Aliasfile alist
9089@c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9090@c LocalWords: cmd CMU contrib cron
9091@c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9092@c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9093@c LocalWords: ImageMagick inbox ispell keychain
9094@c LocalWords: Larus licensor LocalWords lookup lpr
9095@c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9096@c LocalWords: MML msg multipart
9097@c LocalWords: Namazu NIS nenscript nnml num
9098@c LocalWords: packmbox passphrase pathname prev procmail prog repl
9099@c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9100@c LocalWords: sublicense supercite speedbar
9101@c LocalWords: Tennex texi texinfo Thelen thelenm
9102@c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9103@c
9104@c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9105@c See http://en.wikipedia.org/.
9106@c
9107@c Note the lowercase mh which is needed to avoid hits in the
9108@c functions and variables. Occasionally, check for accidental
9109@c inclusion of mh in text by uncommenting the following and executing
9110@c it with C-x C-e. You want to see "Search failed"
9111@c (let ((case-fold-search nil))
9112@c (goto-char (point-min))
9113@c (search-forward-regexp "^mh\\( \\|$\\)"))
9114@c
9115@c An extremely useful setting for texinfo-mode-hook is:
9116@c (add-to-list
9117@c 'ispell-skip-region-alist
9118@c (list
9119@c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9120@c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9121@c "@[@{}.]\\|"
9122@c "[^@]\\|"
9123@c "@\\(end \\)?group\\|"
9124@c "@\\(end \\)?cartouche\\)+"
9125@c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9126@c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9127@c "^@end [a-z]+$\\|"
9128@c "^@\\([fv]\\|print\\)index .*$\\|"
9129@c "@uref{[^,]+,\\|"
9130@c "@[a-z]+\\|"
9131@c "/[a-z.]+[/}]\\)")))))
9132@c
9133@c Cross References
9134@c
9135@c See existing cross-references to the Emacs manual and the Emacs
9136@c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9137@c Emacs Lisp Reference Manual'' respectively).
9138
9139@c @ftable Sorting
9140@c
9141@c As per index (sort of): Punctuation, keyboard characters (such as
9142@c RET and BS) upper and lowercase mixed (lower comes before
9143@c uppercase), control characters go with uppercase C, meta characters
9144@c go with uppercase M.
9145@c In some cases, the sort isn't strictly ASCII.
9146@c For example, SPC (mh-page-msg) reads better before BS
9147@c (mh-previous-page) and . (mh-show) is better before ,
9148@c (mh-header-display).
9149
9150@c @vtable Sorting
9151@c
9152@c Alphabetical, pull hooks into their own table.
9153
9154@c Local Variables:
9155@c sentence-end-double-space: nil
9156@c End:
3955 9157
3956@ignore 9158@ignore
3957 arch-tag: b778477d-1a10-4a99-84de-f877a2ea6bef 9159 arch-tag: b778477d-1a10-4a99-84de-f877a2ea6bef
diff --git a/man/org.texi b/man/org.texi
index 1f5ab0deeba..29436365feb 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -4,7 +4,7 @@
4@setfilename ../info/org 4@setfilename ../info/org
5@settitle Org Mode Manual 5@settitle Org Mode Manual
6 6
7@set VERSION 4.07 7@set VERSION 4.08
8@set DATE March 2006 8@set DATE March 2006
9 9
10@dircategory Emacs 10@dircategory Emacs
diff --git a/man/search.texi b/man/search.texi
index 443de66cbf5..4afcba837e9 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -498,11 +498,13 @@ elisp, The Emacs Lisp Reference Manual}.
498special constructs and the rest are @dfn{ordinary}. An ordinary 498special constructs and the rest are @dfn{ordinary}. An ordinary
499character is a simple regular expression which matches that same 499character is a simple regular expression which matches that same
500character and nothing else. The special characters are @samp{$}, 500character and nothing else. The special characters are @samp{$},
501@samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, @samp{]} and 501@samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and
502@samp{\}. Any other character appearing in a regular expression is 502@samp{\}. The character @samp{]} is special if it ends a character
503ordinary, unless a @samp{\} precedes it. (When you use regular 503alternative (see later). The character @samp{-} is special inside a
504expressions in a Lisp program, each @samp{\} must be doubled, see the 504character alternative. Any other character appearing in a regular
505example near the end of this section.) 505expression is ordinary, unless a @samp{\} precedes it. (When you use
506regular expressions in a Lisp program, each @samp{\} must be doubled,
507see the example near the end of this section.)
506 508
507 For example, @samp{f} is not a special character, so it is ordinary, and 509 For example, @samp{f} is not a special character, so it is ordinary, and
508therefore @samp{f} is a regular expression that matches the string 510therefore @samp{f} is a regular expression that matches the string
@@ -682,6 +684,14 @@ no preceding expression on which the @samp{*} can act. It is poor practice
682to depend on this behavior; it is better to quote the special character anyway, 684to depend on this behavior; it is better to quote the special character anyway,
683regardless of where it appears. 685regardless of where it appears.
684 686
687As a @samp{\} is not special inside a character alternative, it can
688never remove the special meaning of @samp{-} or @samp{]}. So you
689should not quote these characters when they have no special meaning
690either. This would not clarify anything, since backslashes can
691legitimately precede these characters where they @emph{have} special
692meaning, as in @code{[^\]} (@code{"[^\\]"} for Lisp string syntax),
693which matches any single character except a backslash.
694
685@node Regexp Backslash 695@node Regexp Backslash
686@section Backslash in Regular Expressions 696@section Backslash in Regular Expressions
687 697
diff --git a/src/ChangeLog b/src/ChangeLog
index 11fe6f910e4..db10f46024b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,48 @@
12006-03-08 Luc Teirlinck <teirllm@auburn.edu>
2
3 * window.c: Declare preserve_y as a static global variable.
4 (window_scroll_pixel_based): No longer declare preserve_y;
5 it is global now.
6 (syms_of_window): set preserve_y to -1.
7
82006-03-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9
10 * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap
11 depth is 32.
12 [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap
13 depth is 32.
14
152006-03-06 Chong Yidong <cyd@stupidchicken.com>
16
17 * xdisp.c (handle_invisible_prop): Don't update it->position with
18 a buffer position if we're in a display string.
19
202006-03-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21
22 * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH)
23 (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines.
24
25 * macfns.c (x_default_scroll_bar_color_parameter)
26 (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Remove
27 unnecessary prototypes.
28 (x_set_scroll_bar_default_width): Use
29 MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH.
30 (mac_set_scroll_bar_width): New function.
31 (mac_frame_parm_handlers): Set it as handler for scroll-bar-width.
32
33 * macterm.c (get_control_part_bounds): Fix type of return value.
34 (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create)
35 (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show
36 scroll bar if it is not tall enough to display scroll bar thumb.
37 [USE_CARBON_EVENTS] (mac_convert_event_ref)
38 (mac_handle_command_event, mac_handle_window_event)
39 (mac_handle_mouse_event): Check error code of GetEventParameter.
40 (convert_fn_keycode) [MAC_OSX]: Likewise.
41
422006-03-05 Andreas Schwab <schwab@suse.de>
43
44 * xselect.c (x_catch_errors_unwind): Fix missing return value.
45
12006-03-02 Kim F. Storm <storm@cua.dk> 462006-03-02 Kim F. Storm <storm@cua.dk>
2 47
3 * frame.h (struct frame): New member n_tool_bar_rows. 48 * frame.h (struct frame): New member n_tool_bar_rows.
diff --git a/src/image.c b/src/image.c
index 3587515f840..ba78a835ef3 100644
--- a/src/image.c
+++ b/src/image.c
@@ -194,7 +194,7 @@ XPutPixel (ximage, x, y, pixel)
194 char *base_addr = GetPixBaseAddr (pixmap); 194 char *base_addr = GetPixBaseAddr (pixmap);
195 short row_bytes = GetPixRowBytes (pixmap); 195 short row_bytes = GetPixRowBytes (pixmap);
196 196
197 ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel; 197 ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel;
198 } 198 }
199 else if (depth == 1) 199 else if (depth == 1)
200 { 200 {
@@ -238,7 +238,7 @@ XGetPixel (ximage, x, y)
238 char *base_addr = GetPixBaseAddr (pixmap); 238 char *base_addr = GetPixBaseAddr (pixmap);
239 short row_bytes = GetPixRowBytes (pixmap); 239 short row_bytes = GetPixRowBytes (pixmap);
240 240
241 return ((unsigned long *) (base_addr + y * row_bytes))[x]; 241 return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff;
242 } 242 }
243 else if (depth == 1) 243 else if (depth == 1)
244 { 244 {
diff --git a/src/macfns.c b/src/macfns.c
index 617167dfc46..92a78a7319b 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -210,15 +210,6 @@ void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
210void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); 210void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
211void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); 211void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
212void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); 212void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
213void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object,
214 Lisp_Object));
215void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object,
216 Lisp_Object));
217static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
218 Lisp_Object,
219 Lisp_Object,
220 char *, char *,
221 int));
222 213
223extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); 214extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
224 215
@@ -1897,7 +1888,7 @@ x_set_scroll_bar_default_width (f)
1897 int wid = FRAME_COLUMN_WIDTH (f); 1888 int wid = FRAME_COLUMN_WIDTH (f);
1898 1889
1899#ifdef MAC_OSX 1890#ifdef MAC_OSX
1900 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16; /* Aqua scroll bars. */ 1891 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH;
1901 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + 1892 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
1902 wid - 1) / wid; 1893 wid - 1) / wid;
1903#else /* not MAC_OSX */ 1894#else /* not MAC_OSX */
@@ -1911,6 +1902,24 @@ x_set_scroll_bar_default_width (f)
1911#endif /* not MAC_OSX */ 1902#endif /* not MAC_OSX */
1912} 1903}
1913 1904
1905void
1906mac_set_scroll_bar_width (f, arg, oldval)
1907 struct frame *f;
1908 Lisp_Object arg, oldval;
1909{
1910#ifdef MAC_OSX
1911 if (INTEGERP (arg) && XINT (arg) > 0)
1912 {
1913 if (XINT (arg) < (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH
1914 + MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) / 2)
1915 XSETINT (arg, MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH);
1916 else
1917 XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH);
1918 }
1919#endif
1920 x_set_scroll_bar_width (f, arg, oldval);
1921}
1922
1914 1923
1915/* Subroutines of creating a frame. */ 1924/* Subroutines of creating a frame. */
1916 1925
@@ -4373,7 +4382,7 @@ frame_parm_handler mac_frame_parm_handlers[] =
4373 x_set_menu_bar_lines, 4382 x_set_menu_bar_lines,
4374 x_set_mouse_color, 4383 x_set_mouse_color,
4375 x_explicitly_set_name, 4384 x_explicitly_set_name,
4376 x_set_scroll_bar_width, 4385 mac_set_scroll_bar_width,
4377 x_set_title, 4386 x_set_title,
4378 x_set_unsplittable, 4387 x_set_unsplittable,
4379 x_set_vertical_scroll_bars, 4388 x_set_vertical_scroll_bars,
diff --git a/src/macterm.c b/src/macterm.c
index af9079e919b..7f682515f43 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4265,8 +4265,8 @@ static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
4265static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); 4265static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
4266static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, 4266static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
4267 struct input_event *)); 4267 struct input_event *));
4268static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, 4268static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
4269 Rect *)); 4269 Rect *));
4270static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, 4270static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
4271 ControlPartCode, 4271 ControlPartCode,
4272 struct input_event *)); 4272 struct input_event *));
@@ -4387,7 +4387,7 @@ construct_scroll_bar_click (bar, part, bufp)
4387 bufp->modifiers = 0; 4387 bufp->modifiers = 0;
4388} 4388}
4389 4389
4390static OSErr 4390static OSStatus
4391get_control_part_bounds (ch, part_code, rect) 4391get_control_part_bounds (ch, part_code, rect)
4392 ControlHandle ch; 4392 ControlHandle ch;
4393 ControlPartCode part_code; 4393 ControlPartCode part_code;
@@ -4531,7 +4531,10 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4531 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4531 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4532 int value, viewsize, maximum; 4532 int value, viewsize, maximum;
4533 4533
4534 if (whole == 0 || XINT (bar->track_height) == 0) 4534 if (XINT (bar->track_height) == 0)
4535 return;
4536
4537 if (whole == 0)
4535 value = 0, viewsize = 1, maximum = 0; 4538 value = 0, viewsize = 1, maximum = 0;
4536 else 4539 else
4537 { 4540 {
@@ -4542,10 +4545,9 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4542 4545
4543 BLOCK_INPUT; 4546 BLOCK_INPUT;
4544 4547
4545 if (IsControlVisible (ch) 4548 if (GetControlViewSize (ch) != viewsize
4546 && (GetControlViewSize (ch) != viewsize 4549 || GetControl32BitValue (ch) != value
4547 || GetControl32BitValue (ch) != value 4550 || GetControl32BitMaximum (ch) != maximum)
4548 || GetControl32BitMaximum (ch) != maximum))
4549 { 4551 {
4550 /* Temporarily hide the scroll bar to avoid multiple redraws. */ 4552 /* Temporarily hide the scroll bar to avoid multiple redraws. */
4551 SetControlVisibility (ch, false, false); 4553 SetControlVisibility (ch, false, false);
@@ -4592,7 +4594,12 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
4592 r.bottom = disp_top + disp_height; 4594 r.bottom = disp_top + disp_height;
4593 4595
4594#if TARGET_API_MAC_CARBON 4596#if TARGET_API_MAC_CARBON
4595 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, 4597 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p",
4598#if USE_TOOLKIT_SCROLL_BARS
4599 false,
4600#else
4601 width < disp_height,
4602#endif
4596 0, 0, 0, kControlScrollBarProc, (long) bar); 4603 0, 0, 0, kControlScrollBarProc, (long) bar);
4597#else 4604#else
4598 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, 4605 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
@@ -4762,6 +4769,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4762 /* Adjustments according to Inside Macintosh to make it look nice */ 4769 /* Adjustments according to Inside Macintosh to make it look nice */
4763 disp_top = top; 4770 disp_top = top;
4764 disp_height = height; 4771 disp_height = height;
4772#ifdef MAC_OS8
4765 if (disp_top == 0) 4773 if (disp_top == 0)
4766 { 4774 {
4767 disp_top = -1; 4775 disp_top = -1;
@@ -4775,6 +4783,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4775 4783
4776 if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) 4784 if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f))
4777 sb_left++; 4785 sb_left++;
4786#endif
4778 4787
4779 /* Does the scroll bar exist yet? */ 4788 /* Does the scroll bar exist yet? */
4780 if (NILP (w->vertical_scroll_bar)) 4789 if (NILP (w->vertical_scroll_bar))
@@ -4810,8 +4819,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4810 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); 4819 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
4811 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 4820 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
4812 disp_height); 4821 disp_height);
4822#ifndef USE_TOOLKIT_SCROLL_BARS
4813 if (sb_width < disp_height) 4823 if (sb_width < disp_height)
4814 ShowControl (ch); 4824 ShowControl (ch);
4825#endif
4815 4826
4816 /* Remember new settings. */ 4827 /* Remember new settings. */
4817 XSETINT (bar->left, sb_left); 4828 XSETINT (bar->left, sb_left);
@@ -4829,30 +4840,41 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4829 4840
4830#ifdef USE_TOOLKIT_SCROLL_BARS 4841#ifdef USE_TOOLKIT_SCROLL_BARS
4831 if (NILP (bar->track_top)) 4842 if (NILP (bar->track_top))
4832 { 4843 if (sb_width >= disp_height)
4833 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4844 {
4834 Rect r0, r1; 4845 XSETINT (bar->track_top, 0);
4846 XSETINT (bar->track_height, 0);
4847 }
4848 else
4849 {
4850 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4851 Rect r0, r1;
4835 4852
4836 BLOCK_INPUT; 4853 BLOCK_INPUT;
4837 4854
4838 SetControl32BitMinimum (ch, 0); 4855 SetControl32BitMinimum (ch, 0);
4839 SetControl32BitMaximum (ch, 1); 4856 SetControl32BitMaximum (ch, 1);
4840 SetControlViewSize (ch, 1); 4857 SetControlViewSize (ch, 1);
4841 4858
4842 /* Move the scroll bar thumb to the top. */ 4859 /* Move the scroll bar thumb to the top. */
4843 SetControl32BitValue (ch, 0); 4860 SetControl32BitValue (ch, 0);
4844 get_control_part_bounds (ch, kControlIndicatorPart, &r0); 4861 get_control_part_bounds (ch, kControlIndicatorPart, &r0);
4845 4862
4846 /* Move the scroll bar thumb to the bottom. */ 4863 /* Move the scroll bar thumb to the bottom. */
4847 SetControl32BitValue (ch, 1); 4864 SetControl32BitValue (ch, 1);
4848 get_control_part_bounds (ch, kControlIndicatorPart, &r1); 4865 get_control_part_bounds (ch, kControlIndicatorPart, &r1);
4849 4866
4850 UnionRect (&r0, &r1, &r0); 4867 UnionRect (&r0, &r1, &r0);
4851 XSETINT (bar->track_top, r0.top); 4868 XSETINT (bar->track_top, r0.top);
4852 XSETINT (bar->track_height, r0.bottom - r0.top); 4869 XSETINT (bar->track_height, r0.bottom - r0.top);
4853 4870
4854 UNBLOCK_INPUT; 4871 /* Don't show the scroll bar if its height is not enough to
4855 } 4872 display the scroll bar thumb. */
4873 if (r0.bottom - r0.top > 0)
4874 ShowControl (ch);
4875
4876 UNBLOCK_INPUT;
4877 }
4856 4878
4857 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); 4879 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
4858#else /* not USE_TOOLKIT_SCROLL_BARS */ 4880#else /* not USE_TOOLKIT_SCROLL_BARS */
@@ -8387,6 +8409,7 @@ mac_get_mouse_btn (EventRef ref)
8387 XTread_socket loop). */ 8409 XTread_socket loop). */
8388static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) 8410static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
8389{ 8411{
8412 OSStatus err;
8390 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); 8413 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
8391 8414
8392 if (result) 8415 if (result)
@@ -8420,13 +8443,19 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
8420 unsigned char char_codes; 8443 unsigned char char_codes;
8421 UInt32 key_code; 8444 UInt32 key_code;
8422 8445
8423 eventRec->what = keyDown; 8446 err = GetEventParameter (eventRef, kEventParamKeyMacCharCodes,
8424 GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar, 8447 typeChar, NULL, sizeof (char),
8425 NULL, sizeof (char), NULL, &char_codes); 8448 NULL, &char_codes);
8426 GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32, 8449 if (err == noErr)
8427 NULL, sizeof (UInt32), NULL, &key_code); 8450 err = GetEventParameter (eventRef, kEventParamKeyCode,
8428 eventRec->message = char_codes | ((key_code & 0xff) << 8); 8451 typeUInt32, NULL, sizeof (UInt32),
8429 result = 1; 8452 NULL, &key_code);
8453 if (err == noErr)
8454 {
8455 eventRec->what = keyDown;
8456 eventRec->message = char_codes | ((key_code & 0xff) << 8);
8457 result = 1;
8458 }
8430 } 8459 }
8431 break; 8460 break;
8432 8461
@@ -8442,7 +8471,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
8442 if (result) 8471 if (result)
8443 { 8472 {
8444 /* Need where and when. */ 8473 /* Need where and when. */
8445 UInt32 mods; 8474 UInt32 mods = 0;
8446 8475
8447 GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, 8476 GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint,
8448 NULL, sizeof (Point), NULL, &eventRec->where); 8477 NULL, sizeof (Point), NULL, &eventRec->where);
@@ -8852,8 +8881,7 @@ mac_handle_command_event (next_handler, event, data)
8852 EventRef event; 8881 EventRef event;
8853 void *data; 8882 void *data;
8854{ 8883{
8855 OSStatus result; 8884 OSStatus result, err;
8856 OSErr err;
8857 HICommand command; 8885 HICommand command;
8858 Lisp_Object class_key, id_key, binding; 8886 Lisp_Object class_key, id_key, binding;
8859 8887
@@ -8861,10 +8889,10 @@ mac_handle_command_event (next_handler, event, data)
8861 if (result != eventNotHandledErr) 8889 if (result != eventNotHandledErr)
8862 return result; 8890 return result;
8863 8891
8864 GetEventParameter (event, kEventParamDirectObject, typeHICommand, NULL, 8892 err = GetEventParameter (event, kEventParamDirectObject, typeHICommand,
8865 sizeof (HICommand), NULL, &command); 8893 NULL, sizeof (HICommand), NULL, &command);
8866 8894
8867 if (command.commandID == 0) 8895 if (err != noErr || command.commandID == 0)
8868 return eventNotHandledErr; 8896 return eventNotHandledErr;
8869 8897
8870 /* A HICommand event is mapped to an Apple event whose event class 8898 /* A HICommand event is mapped to an Apple event whose event class
@@ -8918,12 +8946,14 @@ mac_handle_window_event (next_handler, event, data)
8918 void *data; 8946 void *data;
8919{ 8947{
8920 WindowPtr wp; 8948 WindowPtr wp;
8921 OSStatus result; 8949 OSStatus result, err;
8922 UInt32 attributes; 8950 UInt32 attributes;
8923 XSizeHints *size_hints; 8951 XSizeHints *size_hints;
8924 8952
8925 GetEventParameter (event, kEventParamDirectObject, typeWindowRef, 8953 err = GetEventParameter (event, kEventParamDirectObject, typeWindowRef,
8926 NULL, sizeof (WindowPtr), NULL, &wp); 8954 NULL, sizeof (WindowPtr), NULL, &wp);
8955 if (err != noErr)
8956 return eventNotHandledErr;
8927 8957
8928 switch (GetEventKind (event)) 8958 switch (GetEventKind (event))
8929 { 8959 {
@@ -8940,8 +8970,11 @@ mac_handle_window_event (next_handler, event, data)
8940 if (result != eventNotHandledErr) 8970 if (result != eventNotHandledErr)
8941 return result; 8971 return result;
8942 8972
8943 GetEventParameter (event, kEventParamAttributes, typeUInt32, 8973 err = GetEventParameter (event, kEventParamAttributes, typeUInt32,
8944 NULL, sizeof (UInt32), NULL, &attributes); 8974 NULL, sizeof (UInt32), NULL, &attributes);
8975 if (err != noErr)
8976 break;
8977
8945 size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); 8978 size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp));
8946 if ((attributes & kWindowBoundsChangeUserResize) 8979 if ((attributes & kWindowBoundsChangeUserResize)
8947 && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) 8980 && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize))
@@ -8950,9 +8983,12 @@ mac_handle_window_event (next_handler, event, data)
8950 Rect bounds; 8983 Rect bounds;
8951 int width, height; 8984 int width, height;
8952 8985
8953 GetEventParameter (event, kEventParamCurrentBounds, 8986 err = GetEventParameter (event, kEventParamCurrentBounds,
8954 typeQDRectangle, 8987 typeQDRectangle, NULL, sizeof (Rect),
8955 NULL, sizeof (Rect), NULL, &bounds); 8988 NULL, &bounds);
8989 if (err != noErr)
8990 break;
8991
8956 width = bounds.right - bounds.left; 8992 width = bounds.right - bounds.left;
8957 height = bounds.bottom - bounds.top; 8993 height = bounds.bottom - bounds.top;
8958 8994
@@ -9001,7 +9037,7 @@ mac_handle_mouse_event (next_handler, event, data)
9001 EventRef event; 9037 EventRef event;
9002 void *data; 9038 void *data;
9003{ 9039{
9004 OSStatus result; 9040 OSStatus result, err;
9005 9041
9006 switch (GetEventKind (event)) 9042 switch (GetEventKind (event))
9007 { 9043 {
@@ -9017,22 +9053,31 @@ mac_handle_mouse_event (next_handler, event, data)
9017 if (result != eventNotHandledErr || read_socket_inev == NULL) 9053 if (result != eventNotHandledErr || read_socket_inev == NULL)
9018 return result; 9054 return result;
9019 9055
9020 GetEventParameter (event, kEventParamWindowRef, typeWindowRef, 9056 err = GetEventParameter (event, kEventParamWindowRef, typeWindowRef,
9021 NULL, sizeof (WindowRef), NULL, &wp); 9057 NULL, sizeof (WindowRef), NULL, &wp);
9058 if (err != noErr)
9059 break;
9060
9022 f = mac_window_to_frame (wp); 9061 f = mac_window_to_frame (wp);
9023 if (f != mac_focus_frame (&one_mac_display_info)) 9062 if (f != mac_focus_frame (&one_mac_display_info))
9024 break; 9063 break;
9025 9064
9026 GetEventParameter (event, kEventParamMouseWheelAxis, 9065 err = GetEventParameter (event, kEventParamMouseWheelAxis,
9027 typeMouseWheelAxis, NULL, 9066 typeMouseWheelAxis, NULL,
9028 sizeof (EventMouseWheelAxis), NULL, &axis); 9067 sizeof (EventMouseWheelAxis), NULL, &axis);
9029 if (axis != kEventMouseWheelAxisY) 9068 if (err != noErr || axis != kEventMouseWheelAxisY)
9030 break; 9069 break;
9031 9070
9032 GetEventParameter (event, kEventParamMouseWheelDelta, typeSInt32, 9071 err = GetEventParameter (event, kEventParamMouseWheelDelta,
9033 NULL, sizeof (SInt32), NULL, &delta); 9072 typeSInt32, NULL, sizeof (SInt32),
9034 GetEventParameter (event, kEventParamMouseLocation, typeQDPoint, 9073 NULL, &delta);
9035 NULL, sizeof (Point), NULL, &point); 9074 if (err != noErr)
9075 break;
9076 err = GetEventParameter (event, kEventParamMouseLocation,
9077 typeQDPoint, NULL, sizeof (Point),
9078 NULL, &point);
9079 if (err != noErr)
9080 break;
9036 read_socket_inev->kind = WHEEL_EVENT; 9081 read_socket_inev->kind = WHEEL_EVENT;
9037 read_socket_inev->code = 0; 9082 read_socket_inev->code = 0;
9038 read_socket_inev->modifiers = 9083 read_socket_inev->modifiers =
@@ -9494,13 +9539,13 @@ convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode)
9494 Fn modifier. That's why we need the table. 9539 Fn modifier. That's why we need the table.
9495 9540
9496 */ 9541 */
9497 9542 OSStatus err;
9498 UInt32 mods = 0; 9543 UInt32 mods = 0;
9499 if (!NILP(Vmac_function_modifier)) 9544 if (!NILP(Vmac_function_modifier))
9500 { 9545 {
9501 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, 9546 err = GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32,
9502 sizeof (UInt32), NULL, &mods); 9547 NULL, sizeof (UInt32), NULL, &mods);
9503 if (mods & kEventKeyModifierFnMask) 9548 if (err != noErr && mods & kEventKeyModifierFnMask)
9504 { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f]; 9549 { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f];
9505 9550
9506 return (*newCode != 0); 9551 return (*newCode != 0);
diff --git a/src/macterm.h b/src/macterm.h
index 107814ddb3f..42020811e6c 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -516,6 +516,10 @@ struct scroll_bar {
516 text from glomming up against the scroll bar */ 516 text from glomming up against the scroll bar */
517#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) 517#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
518 518
519/* Variations of possible Aqua scroll bar width. */
520#define MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH (15)
521#define MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH (11)
522
519/* Size of hourglass controls */ 523/* Size of hourglass controls */
520#define HOURGLASS_WIDTH 16 524#define HOURGLASS_WIDTH 16
521#define HOURGLASS_HEIGHT 16 525#define HOURGLASS_HEIGHT 16
diff --git a/src/window.c b/src/window.c
index 36050ac649e..bc9a956994a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -217,6 +217,10 @@ Lisp_Object Vscroll_preserve_screen_position;
217 217
218int window_deletion_count; 218int window_deletion_count;
219 219
220/* Used by the function window_scroll_pixel_based */
221
222static int preserve_y;
223
220#if 0 /* This isn't used anywhere. */ 224#if 0 /* This isn't used anywhere. */
221/* Nonzero means we can split a frame even if it is "unsplittable". */ 225/* Nonzero means we can split a frame even if it is "unsplittable". */
222static int inhibit_frame_unsplittable; 226static int inhibit_frame_unsplittable;
@@ -4726,7 +4730,6 @@ window_scroll_pixel_based (window, n, whole, noerror)
4726 int this_scroll_margin; 4730 int this_scroll_margin;
4727 /* True if we fiddled the window vscroll field without really scrolling. */ 4731 /* True if we fiddled the window vscroll field without really scrolling. */
4728 int vscrolled = 0; 4732 int vscrolled = 0;
4729 static int preserve_y = -1;
4730 4733
4731 SET_TEXT_POS_FROM_MARKER (start, w->start); 4734 SET_TEXT_POS_FROM_MARKER (start, w->start);
4732 4735
@@ -7024,6 +7027,8 @@ syms_of_window ()
7024 minibuf_selected_window = Qnil; 7027 minibuf_selected_window = Qnil;
7025 staticpro (&minibuf_selected_window); 7028 staticpro (&minibuf_selected_window);
7026 7029
7030 preserve_y = -1;
7031
7027 DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, 7032 DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function,
7028 doc: /* Non-nil means call as function to display a help buffer. 7033 doc: /* Non-nil means call as function to display a help buffer.
7029The function is called with one argument, the buffer to be displayed. 7034The function is called with one argument, the buffer to be displayed.
diff --git a/src/xdisp.c b/src/xdisp.c
index 41c8546aac9..a645efd38a2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3649,8 +3649,11 @@ handle_invisible_prop (it)
3649 the invisible text. Otherwise the cursor would be 3649 the invisible text. Otherwise the cursor would be
3650 placed _after_ the ellipsis when the point is after the 3650 placed _after_ the ellipsis when the point is after the
3651 first invisible character. */ 3651 first invisible character. */
3652 it->position.charpos = IT_CHARPOS (*it) - 1; 3652 if (!STRINGP (it->object))
3653 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); 3653 {
3654 it->position.charpos = IT_CHARPOS (*it) - 1;
3655 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
3656 }
3654 setup_for_ellipsis (it, 0); 3657 setup_for_ellipsis (it, 0);
3655 } 3658 }
3656 } 3659 }
diff --git a/src/xselect.c b/src/xselect.c
index 6776e732734..5e6ffd806f0 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -627,6 +627,7 @@ x_catch_errors_unwind (dummy)
627 BLOCK_INPUT; 627 BLOCK_INPUT;
628 x_uncatch_errors (); 628 x_uncatch_errors ();
629 UNBLOCK_INPUT; 629 UNBLOCK_INPUT;
630 return Qnil;
630} 631}
631 632
632 633