Initial Commit
[packages] / xemacs-packages / vm / info / vm.texinfo
1 \input texinfo  @comment -*-Text-*-
2 @setfilename vm.info
3 @settitle VM User's Manual
4 @dircategory Emacs
5 @direntry
6 * VM: (vm).                             A mail reader.
7 @end direntry
8 @iftex
9 @finalout
10 @end iftex
11 @c @setchapternewpage odd               % For book style double sided manual.
12 @c      @smallbook
13 @tex
14 \overfullrule=0pt
15 %\global\baselineskip 30pt      % For printing in double spaces
16 @end tex
17 @ifnottex
18 This file documents the VM mail reader.
19
20 Copyright (C) 1989, 1991, 1999 Kyle E. Jones
21
22 Permission is granted to make and distribute verbatim copies of
23 this manual provided the copyright notice and this permission notice
24 are preserved on all copies.
25
26 @ignore
27 Permission is granted to process this file through Tex and print the
28 results, provided the printed document carries copying permission
29 notice identical to this one except for the removal of this paragraph
30 (this paragraph not being relevant to the printed manual).
31
32 @end ignore
33 @end ifnottex
34 @c
35 @titlepage
36 @sp 6
37 @center @titlefont{VM User's Manual}
38 @sp 4
39 @center VM Version 8.0
40 @sp 5
41 @page
42 @vskip 0pt plus 1filll
43 Copyright @copyright{} 1989, 1991, 1999, 2002, 2003 Kyle E. Jones
44 Copyright @copyright{} 2003 - 2007 Robert Widhopf-Fenk
45
46 Permission is granted to make and distribute verbatim copies of
47 this manual provided the copyright notice and this permission notice
48 are preserved on all copies.
49
50 @end titlepage
51 @page
52 @ifnottex
53 @node Top, Introduction,, (DIR)
54
55 This manual documents the VM mail reader, a Lisp program which runs as a
56 subsystem under Emacs.  The manual is divided into the following
57 chapters.
58
59 @menu
60 * Introduction::        Overview of the VM interface.
61 * Starting Up::         What happens when you start VM.
62 * Selecting Messages::  How to select messages for reading.
63 * Reading Messages::    Previewing and paging through a message.
64 * Sending Messages::    How to send messages from within VM.
65 * Saving Messages::     How to save messages.
66 * Deleting Messages::   How to delete, undelete and expunge messages.
67 * Editing Messages::    How to alter the text and headers of a message.
68 * Message Marks::       Running VM commands on arbitrary sets of messages.
69 * Message Attributes::  How to change and undo changes to message attributes.
70 * Sorting Messages::    How to make VM present similar messages together.
71 * Reading Digests::     How to read digests under VM.
72 * Summaries::           How to view and customize the summary of a folder.
73 * Virtual Folders::     Blurring the boundaries of different physical folders.
74 * Frames and Windows::  How to customize VM's use of windows and frames.
75 * Toolbar::             How to configure VM's toolbar.
76 * Menus::               How to configure VM's menus.
77 * Faces::               How to configure VM's use of faces.
78 * Using the Mouse::     Understanding the VM mouse interface.
79 * Hooks::               How you can make VM run your code at certain times.
80 * License::             Copying and distribution terms for VM.
81
82 Indices:
83
84 * Key Index::           Menus of command keys and their references.
85 * Command Index::       Menus of commands and their references.
86 * Variable Index::      Menus of variables and their references.
87 @end menu
88 @end ifnottex
89
90 @node Introduction, Starting Up, Top, Top
91 @unnumbered Introduction
92
93 VM (View Mail) is an Emacs subsystem that allows UNIX mail to be read
94 and disposed of within Emacs.  Commands exist to do the normal things
95 expected of a mail user agent, such as generating replies, saving
96 messages to folders, deleting messages and so on.  There are other more
97 advanced commands that do tasks like bursting and creating digests,
98 message forwarding, and organizing message presentation according to
99 various criteria.
100
101 You can make VM your default mail user agent by setting @code{mail-user-agent}
102 to @code{vm-user-agent}, e.g. by @kbd{M-x} @code{customize-variable} @kbd{RET}
103 @code{mail-user-agent} @kbd{RET}.
104
105 To invoke VM, type @kbd{M-x vm}.  VM gathers any mail that has
106 arrived in your system mailbox and appends it to a file known as your
107 @dfn{primary inbox}, and visits that file for reading.  @xref{Starting Up}.
108 A file visited for reading by VM is called the @dfn{current folder}.
109
110 If you type @kbd{?} in a VM folder buffer you will get some help, i.e.
111 @code{vm-help} is called.
112
113 @findex vm-scroll-forward
114 @findex vm-scroll-backward
115 @kindex SPC
116 @kindex b
117 @kindex DEL
118 If there are any messages in the primary inbox, VM selects the first new
119 or unread message, and previews it.  @dfn{Previewing} is VM's way of
120 showing you part of a message and allowing you to decide whether you want
121 to read it.  @xref{Previewing}.  By default VM shows you the message's
122 sender, recipient, subject and date headers.  Typing @key{SPC}
123 (@code{vm-scroll-forward}) exposes the body of the message and flags the
124 message as read.  Subsequent @key{SPC}'s scroll forward through the
125 message, @kbd{b} or @key{DEL} scrolls backward.  When you reach the end
126 of a message, typing @key{SPC} or @kbd{n} moves you forward to preview
127 the next message.  @xref{Paging}.
128
129 If you do not want to read a message that's being previewed, type
130 @kbd{n} and VM will move to the next message (if there is one).
131 @xref{Selecting Messages}.
132
133 To save a message to a mail folder use @kbd{s} (@code{vm-save-message}).
134 VM will prompt you for the folder name in the minibuffer.
135 @xref{Saving Messages}.
136
137 Messages are deleted by typing @kbd{d} (@code{vm-delete-message}) while
138 previewing or reading them.  The message is not removed right away; VM
139 makes a note that you want the message to be removed later.  If you
140 change your mind about deleting a message, select it and type @kbd{u}
141 (@code{vm-undelete-message}), and the message will be undeleted.
142 @xref{Deleting Messages}.  The actual removal of deleted messages from
143 the current folder is called @dfn{expunging} and it is accomplished by
144 typing @kbd{###} (@code{vm-expunge-folder}).  The message is still present
145 in the on-disk version of the folder until the folder is saved.
146
147 To delete duplicates type @kbd{M-x} (@code{vm-delete-duplicate-messages}). 
148
149 Typing @kbd{h} (@code{vm-summarize}) causes VM to display a window
150 containing a summary of the contents of the current folder.  The summary is
151 presented one line per message, by message number, listing each message's
152 author, date sent, line and byte count, and subject.  Also, various
153 letters appear beside the message number to indicate that a message is
154 new, unread, flagged for deletion, etc.  An arrow @samp{->} appears to
155 the left of the line summarizing the current message.  The summary
156 format is user configurable, @pxref{Summaries}.
157
158 @findex vm-save-folder
159 @kindex S
160 When you are finished reading mail the current folder must be saved, so
161 that the next time the folder is visited VM will know which messages
162 have been already read, replied to and so on.  Typing @kbd{S}
163 (@code{vm-save-folder}) saves the folder.  Note that deleted messages are
164 @emph{not} expunged automatically when you save a folder.
165 The next time you visit the folder any deleted
166 messages will still be flagged for deletion.
167
168 @vindex vm-folder-file-precious-flag
169 When a folder is first visited, the value of the variable
170 @code{vm-folder-file-precious-flag} is used to initialize a
171 buffer-local instance of @code{file-precious-flag}, which
172 determines how folders are saved.  A non-nil value causes
173 folders to be saved by writing to a temporary file and then
174 replacing the folder with that file.  A nil value causes
175 folders to be saved by writing directly to the folder without
176 the use of a temporary file.
177
178 @vindex vm-delete-empty-folders
179 If the folder is empty at the time you save it and the variable
180 @code{vm-delete-empty-folders} is non-@code{nil}, VM will remove
181 the zero length folder after saving it.
182
183 @findex vm-quit
184 @findex vm-quit-no-change
185 @kindex q
186 @kindex x
187 To quit visiting a folder you can type @kbd{q} (@code{vm-quit}) or
188 @kbd{x} (@code{vm-quit-no-change}).  Typing @kbd{q} saves the current
189 folder before quitting.  Also, any messages flagged new are changed to
190 be flagged as old and unread, before saving.  The @kbd{x} command quits
191 a folder without changing the status of new messages, saving or
192 otherwise modifying the current folder.
193
194 @vindex vm-confirm-quit
195 If the variable @code{vm-confirm-quit} is set to @code{t}
196 VM will always ask for confirmation before ending a VM
197 visit of a folder.  A @code{nil} value means VM will ask only
198 when messages will be lost unwittingly by quitting, i.e. not
199 removed by intentional delete and expunge.  A value that is
200 neither @code{nil} nor @code{t} causes VM to ask only when
201 there are unsaved changes to message attributes or when messages
202 will be lost.
203
204 @findex vm-quit-just-bury
205 You do not have to quit a folder to continue using Emacs for other
206 purposes.  (@code{vm-quit-just-bury}) buries the buffers associated with
207 the current folder deep in Emacs' stack of buffers, but otherwise leaves
208 the folder visited so that you can resume reading messages quickly.  You
209 can locate the folder's buffers again by using @code{list-buffers},
210 which is normally bound to @kbd{C-x C-b}.
211
212 @findex vm-quit-just-iconify
213 Another command you can use if you are using a window system like X
214 Windows is @code{vm-quit-just-iconify}.  This command buries the
215 folder's buffers like @code{vm-quit-just-bury} and also iconifies the
216 current frame.
217
218 @findex vm-get-new-mail
219 @kindex g
220 At any time while reading mail in any folder you can type @kbd{g}
221 (@code{vm-get-new-mail}) to check to see if new mail for that folder has
222 arrived.  If new mail has arrived it will be moved from the spool file
223 or spool files associated with the current folder and merged into the
224 folder.  If you are not in the middle of another message, VM will also
225 move to the first new or unread message.
226
227 If @code{vm-get-new-mail} is given a prefix argument, it will prompt for
228 another file from which to gather messages instead of the usual spool
229 files.  In this case the source folder is copied but no messages are
230 deleted from it as they would be for a spool file.
231
232 By default your primary inbox has your system mailbox associated with
233 it, e.g. @file{/var/spool/mail/kyle}, and so typing @kbd{g} will retrieve
234 mail from this file.  Your system mailbox is one example of a @dfn{spool
235 file}, a file that the mail transport system delivers messages into.
236 You can associate other spool files with your primary inbox and spool
237 files with other folders by setting the variable
238 @code{vm-spool-files}.  @xref{Spool Files}.
239
240 @node Starting Up, Selecting Messages, Introduction, Top
241 @chapter Starting Up
242
243 @findex vm-load-init-file
244 @vindex vm-init-file
245 @kindex L
246 The first time VM is started in an Emacs session, it attempts to load
247 the file specified by the variable @code{vm-init-file}, normally
248 @file{~/.vm}.  If present this file should contain Lisp code, much like
249 the @file{.emacs} file.  Since VM has well over one hundred
250 configuration variables, use of the @file{~/.vm} can considerably reduce
251 clutter in the @file{.emacs} file.  You can reload this file
252 by typing @kbd{L} (@code{vm-load-init-file}) from within VM.
253
254 @findex vm
255 @vindex vm-primary-inbox
256 @vindex vm-auto-get-new-mail
257 @kbd{M-x vm} causes VM to visit a file known as your @dfn{primary
258 inbox}.  If the variable @code{vm-auto-get-new-mail} is set
259 non-@code{nil}, VM will gather any mail present in your system mailbox
260 and integrate it into your primary inbox.  The default name of your
261 primary inbox is @file{~/Mail/inbox}, but VM will use whatever file is named
262 by the variable @code{vm-primary-inbox}.
263
264 @vindex vm-crash-box
265 VM transfers the mail from the system mailbox to the primary inbox via a
266 temporary file known as the @dfn{crash box}.  The variable
267 @code{vm-crash-box} names the crash box file.  VM first copies the mail
268 to the crash box, truncates the system mailbox to zero messages, merges
269 the crash box contents into the primary inbox, and then deletes the
270 crash box.  If the system or Emacs should crash in the midst of this
271 activity, any message not present in the primary inbox will be either in
272 the system mailbox or the crash box.  Some messages may be duplicated
273 but no mail will be lost.
274
275 If the file named by @code{vm-crash-box} already exists when VM is
276 started up, VM will merge that file with the primary inbox before
277 retrieving any new messages from the system mailbox.
278
279 @findex vm-visit-folder
280 @kindex v
281 @kbd{M-x vm-visit-folder} (@kbd{v} from within VM) allows you to visit
282 some other mail folder than the primary inbox.  The folder name will be
283 prompted for in the minibuffer.
284
285 Once VM has read the folder, any spool files associated with the folder
286 are checked for new messages if @code{vm-auto-get-new-mail} is
287 non-@code{nil}.  @xref{Spool Files}.  After this, the first new or
288 unread message will be selected, if any.  If there is no such message,
289 VM will select whatever the selected message was when this folder was last
290 saved.  If this folder has never been visited and saved by VM, then the
291 first message in the folder is selected.
292
293 @findex vm-mode
294 @kbd{M-x vm-mode} can be used on a buffer already loaded into Emacs
295 to put it into the VM major mode so that VM commands can be executed
296 on it.  This command is suitable for use in Lisp programs, and for
297 inclusion in @code{auto-mode-alist} to automatically start VM on a
298 file based on a particular filename suffix.  @code{vm-mode} skips
299 some of VM's startup procedures (e.g. starting up a summary) to make
300 non-interactive use easier.
301
302 @vindex vm-startup-with-summary
303 The variable @code{vm-startup-with-summary} controls whether VM
304 automatically displays a summary of the folder's contents at startup.  A
305 value of @code{nil} gives no summary; a value of @code{t} always gives a
306 summary.  A value that is a positive integer @var{n} means that VM
307 should generate a summary on if there are @var{n} or more messages in
308 the folder.  A negative value @var{-n} means generate a summary only if
309 there are @var{n} or fewer messages.  The default value of
310 @code{vm-startup-with-summary} is @code{t}.
311
312 @menu
313 * Spool Files::  Linking folders and mailboxes.
314 * Getting New Mail::  Retrieving mail from spool files.
315 * Crash Recovery::  Recovering changes after Emacs or your system dies.
316 @end menu
317
318 @node Spool Files, Getting New Mail, Starting Up, Starting Up
319 @section Spool Files
320 @vindex vm-spool-files
321 A @dfn{spool file} is a file where the mail transport system delivers
322 messages intended for you.  Typically a program called @file{/bin/mail}
323 or @file{/bin/mail.local} does this delivery, although agents such as
324 @file{procmail}, @file{filter} and @file{slocal} can be invoked from a
325 user's @file{~/.forward} or @file{~/.qmail} files.  No matter what the
326 delivery agent, what all spool files have in common is that mail is
327 delivered into them by one or more entities apart from VM and that all
328 access to spool files must therefore be accompanied by the use of
329 some file locking protocol.
330
331 @vindex vm-movemail-program
332 @vindex vm-movemail-program-switches
333 VM leaves the task of accessing spool files to @file{movemail}, a
334 program distributed with Emacs that is written for this purpose.
335 The variable @code{vm-movemail-program} specifies the name of the
336 movemail program and defaults to @samp{"movemail"}.  The variable
337 @code{vm-movemail-program-switches} lets you specify some initial
338 command line argument to pass to the movemail program.
339
340 Every folder, including the primary inbox, can have one or more spool
341 files associated with it.  You make these associations known to VM by
342 setting the variable @code{vm-spool-files}.
343
344 If you only want to associate spool files with your primary inbox, you
345 can set @code{vm-spool-files} to a list of strings.  By default, the location
346 of your system mailbox (the spool file that is associated with your
347 primary inbox) is determined heuristically based on what type of system
348 you're using.  VM can be told explicitly where the system mailbox is by
349 setting @code{vm-spool-files} like this:
350
351 @example
352 (setq vm-spool-files '("/var/spool/mail/kyle" "~/Mailbox"))
353 @end example
354
355 With this setting, VM will retrieve mail for the primary inbox from
356 first @file{/var/spool/mail/kyle} and then @file{~/Mailbox}.
357
358 If the value of @code{vm-spool-files} is @code{nil}, a default value for
359 @code{vm-spool-files} will be inherited from the shell environmental
360 variables MAILPATH or MAIL if either of these variables are defined.
361 This inheritance happens before your init file is loaded, so setting
362 @code{vm-spool-files} in your init file will override any environmental
363 variables.
364
365 If you want to associate spool files with folders other than or in
366 addition to the primary inbox, the value of @code{vm-spool-files} must be a
367 list of lists.  Each sublist specifies three entities, a folder, a spool
368 file and a crash box.  When retrieving mail for a particular folder, VM
369 will scan @code{vm-spool-files} for folder names that match the current
370 folder's name.  The spool file and crash box found in any matching
371 entries will be used to gather mail for that folder.
372
373 For example, you can set @code{vm-spool-files} like this
374
375 @example
376 @group
377 (setq vm-spool-files
378       '(
379         ("~/INBOX"      "/var/spool/mail/kyle"      "~/INBOX.CRASH")
380         ("~/INBOX"      "~/Mailbox"                 "~/INBOX.CRASH")
381         ("~/Mail/bugs"  "/var/spool/mail/answerman" "~/Mail/bugs.crash")
382        )
383 )
384 @end group
385 @end example
386
387 The folder @file{~/INBOX} has two spool files associated with it in this
388 example, @file{/var/spool/mail/kyle} and @file{~/Mailbox}.  Another
389 folder, @file{"~/Mail/bugs"} has one folder
390 @file{/var/spool/mail/answerman} associated with it.  Note that both of
391 the @file{~/INBOX} entries used the same crash box.  The crash box can be
392 the same if the folder name is the same.  Different folders should use
393 different crashboxes.
394
395 @vindex vm-crash-box-suffix
396 @vindex vm-spool-file-suffixes
397 An alternate way of specifying folder/spool file associations
398 is to use the variables @code{vm-spool-file-suffixes} and
399 @code{vm-crash-box-suffix}.
400
401 The value of @code{vm-spool-file-suffixes} should be a list of string suffixes
402 to be used to create possible spool file names for folders.  Example:
403
404 @example
405 @group
406 (setq vm-spool-file-suffixes '(".spool" "-"))
407 @end group
408 @end example
409
410 With @code{vm-spool-file-suffixes} set this way, if you visit a
411 folder @file{~/mail/beekeeping}, when VM attempts to retrieve new mail for
412 that folder it will look for mail in @file{~/mail/beekeeping.spool}
413 and @file{~/mail/beekeeping-} in addition to scanning @code{vm-spool-files}
414 for matches.  The value of @code{vm-spool-files-suffixes} will not be used
415 unless @code{vm-crash-box-suffix} is also defined, since a crash box is
416 required for all mail retrieval from spool files.
417
418 The value of @code{vm-crash-box-suffix} should be a string suffix used to
419 create possible crash box file names for folders.  When VM uses
420 @code{vm-spool-file-suffixes} to create a spool file name, it will append
421 the value of @code{vm-crash-box-suffix} to the folder's file name to
422 create a crash box name.  If the value of @code{vm-spool-files-suffixes}
423 is @code{nil}, then the value of @code{vm-crash-box-suffix} is not used
424 by VM.
425
426 @vindex vm-make-crash-box-name
427 @vindex vm-make-spool-file-name
428 The idea behind @code{vm-spool-file-suffixes} and
429 @code{vm-crash-box-suffix} is to give you a way to have many
430 folders with individual spool files associated with them, without
431 having to list them all in @code{vm-spool-files}.  If you need
432 even more control of spool file and crash box names, use
433 @code{vm-make-spool-file-name} and @code{vm-make-crash-box-name}.
434 The value of both of these should be a function or the name of a
435 function.  When VM visits a folder, it will call the function
436 with the name of the folder as an argument, and the function
437 should return the spool file name or crash box name to be used
438 for that folder.
439
440 @ifnottex
441 If your spool file is on another host, VM supports accessing
442 spool files on remote hosts using the POP and IMAP protocols.
443 @end ifnottex
444
445 @menu
446 * POP Spool Files::     How to use a POP maildrop as a spool file
447 * IMAP Spool Files::    How to use an IMAP maildrop as a spool file
448 * POP Folders::         How to use a POP maildrop as a folder
449 * IMAP Folders::        How to use a IMAP maildrop as a folder
450 @end menu
451
452 @node POP Spool Files,,, Spool Files
453 @section POP Spool Files
454 @cindex POP
455 VM supports accessing spool files on remote hosts via the Post
456 Office Protocol (POP).  Instead of a spool file name as in the
457 examples above, you would use a string that tells VM how to
458 access the POP mailbox.  The format of this string is:
459
460 @example
461 ``pop:@var{HOST}:@var{PORT}:@var{AUTH}:@var{USER}:@var{PASSWORD}''
462 @end example
463
464 Replace @samp{pop} in the example with @samp{pop-ssl} to have
465 VM speak POP over an SSL connection.  Use @samp{pop-ssh} to use
466 POP over an SSH connection.  
467
468 For SSL, you must have the stunnel program installed and the
469 variable @code{vm-stunnel-program} must name it in order for
470 POP over SSL to work.  The default value of this variable,
471 @samp{"stunnel"}, should be sufficient if the program is
472 installed in your normal command search path.
473
474 For SSH, you must have the ssh program installed and the variable
475 @code{vm-ssh-program} must name it in order for POP over SSH to
476 work.  When VM makes the SSH connection it must run a command on
477 the remote host so that the SSH session is maintained long enough
478 for the POP connection to be established.  By default that command
479 is @samp{"echo ready; sleep 10"}, but you can specify another
480 command by setting @code{vm-ssh-remote-command}.  Whatever
481 command you use must produce some output and hold the connection
482 open long enough for VM to establish a port-forwarded connection
483 to the POP server.
484
485 @var{HOST} is the host name of the POP server.  @var{PORT} is the
486 TCP port number to connect to (should normally be 110).  For POP
487 over SSL connections the standard port is 995.  @var{USER}
488 is the user name sent to the server.  @var{PASSWORD} is the secret
489 shared by you and the server for authentication purposes.  How it is
490 used depends on the value of the @var{AUTH} parameter.  If the
491 @var{PASSWORD} is @samp{*}, VM will prompt you for the password the
492 first time you try to retrieve mail from the maildrop.  If the password
493 is valid, VM will not ask you for the password again during this
494 Emacs session.
495
496 @vindex vm-pop-md5-program
497 @var{AUTH} is the authentication method used to convince the
498 server you should have access to the maildrop.  Acceptable
499 values are @samp{pass}, @samp{rpop} and @samp{apop}.  For
500 @samp{pass}, the @var{PASSWORD} is sent to the server with
501 the POP PASS command.  For @samp{rpop}, the @var{PASSWORD}
502 should be the string to be sent to the server via the RPOP
503 command.  In this case the string is not really a secret;
504 authentication is done by other means.  For @samp{apop}, an
505 MD5 digest of the @var{PASSWORD} appended to the server
506 timestamp will be sent to the server with the APOP command.
507 If Emacs does not have bulit in MD5 support, you will have
508 to set the value of @code{vm-pop-md5-program} appropriately
509 to point at the program that will generate the MD5 digest
510 that VM needs.
511
512 @vindex vm-pop-max-message-size
513 By default VM will retrieve all the messages from a POP maildrop
514 before returning control of Emacs to you.  If the maildrop is
515 large, the wait could be considerable.  If you set
516 @code{vm-pop-max-message-size} to a positive numeric value, VM will not 
517 automatically retrieve messages larger than this size.  If VM is
518 retrieving messages because you invoked @code{vm-get-new-mail}
519 interactively, then VM will ask whether it should retrieve the
520 large message.  If VM is retrieving messages automatically
521 (e.g. @code{vm-auto-get-new-mail} is set non-@code{nil}) then VM will skip the
522 large message and you can retrieve it later.
523
524 @vindex vm-pop-bytes-per-session
525 @vindex vm-pop-messages-per-session
526 The variable @code{vm-pop-messages-per-session} controls how many messages
527 VM will retrieve from a POP maildrop before returning control to
528 you.  Similarly, the variable @code{vm-pop-bytes-per-session} limits the
529 number of bytes VM will retrieve from a POP maildrop before returning
530 control to you.  By default, the value of both variables is nil, which
531 tells VM to retrieve all the messages in the POP maildrop regardless
532 of how many messages there are and how large the maildrop is.
533
534 @vindex vm-pop-expunge-after-retrieving
535 After VM retrieves messages from the maildrop, the default action
536 is to delete the messages from there.  If you want VM to leave
537 messages in the remote maildrop until you explicitly request
538 their removal, set @code{vm-pop-expunge-after-retrieving} to
539 @code{nil}.  Messages will not be removed from the maildrop until you
540 run @code{vm-expunge-pop-messages}; only those messages that VM has
541 retrieved into the current folder will be expunged.
542
543 @vindex vm-pop-auto-expunge-alist
544 The variable @code{vm-pop-auto-expunge-alist} gives you a way to specify
545 on a per-maildrop basis which POP maildrops have messages
546 automatically removed when retrieved and which ones leave the
547 messages on the POP server.  The value of
548 @code{vm-pop-auto-expunge-alist} should be a list of POP mailboxes and
549 values specifying whether messages should be automatically
550 deleted from the mailbox after retrieval.  The format of the list
551 is:
552
553 @example
554 ((@var{MAILBOX} . @var{VAL}) (@var{MAILBOX} . @var{VAL}) ...)
555 @end example
556
557 @var{MAILBOX} should be an POP maildrop specification as described
558 in the documentation for the variable @code{vm-spool-files}.  If
559 you have the POP password specified in the @code{vm-spool-files}
560 entry, you do not have to specify it here as well.  Use @samp{*}
561 instead; VM will still understand that this mailbox is the same as
562 the one in @code{vm-spool-files} that contains the password.
563
564 @var{VAL} should be @code{nil} if retrieved messages should be left in the
565 corresponding POP mailbox, @code{t} if retrieved messages should be
566 removed from the mailbox immediately after retrieval.
567
568 Here is an example:
569
570 @example
571 (setq vm-pop-auto-expunge-alist
572    '(
573      ("odin.croc.net:110:pass:kyle:*" . nil)  ;; leave message on the server
574      ("hilo.harkie.org:110:pass:kyle:*" . t)  ;; expunge immediately
575     )
576 )
577 @end example
578
579 @node IMAP Spool Files,,, Spool Files
580 @section IMAP Spool Files
581 @cindex IMAP
582 VM can also use the IMAP protocol to access a mailbox on a remote 
583 host.  As with POP, instead of specifying a spool file name in
584 the @code{vm-spool-files} definition, you would give a string that tells 
585 VM how to access to remote maildrop.
586
587 An IMAP maildrop specification has the following format:
588
589 @example
590 ``imap:@var{HOST}:@var{PORT}:@var{MAILBOX}:@var{AUTH}:@var{USER}:@var{PASSWORD}''
591 @end example
592
593 Replace @samp{imap} in the example with @samp{imap-ssl} to have
594 VM speak IMAP over an SSL connection.  Use @samp{imap-ssh} to use
595 IMAP over an SSH connection.  
596
597 For SSL, you must have the stunnel program installed and the
598 variable @code{vm-stunnel-program} must name it in order for
599 IMAP over SSL to work.  The default value of this variable,
600 @samp{"stunnel"}, should be sufficient if the program is
601 installed in your normal command search path.
602
603 For SSH, you must have the ssh program installed and the variable
604 @code{vm-ssh-program} must name it in order for IMAP over SSH to
605 work.  When VM makes the SSH connection it must run a command on
606 the remote host so that the SSH session is maintained long
607 enough for the IMAP connection to be established.  By default that command
608 is @samp{"echo ready; sleep 10"}, but you can specify another
609 command by setting @code{vm-ssh-remote-command}.  Whatever
610 command you use must produce some output and hold the connection
611 open long enough for VM to establish a port-forwarded connection
612 to the IMAP server.  SSH must be able to authenticate without a password,
613 which means you must be using .shosts authentication or RSA.
614
615 @var{HOST} is the host name of the IMAP server.
616
617 @var{PORT} is the TCP port number to connect to (should normally be 143).
618 For IMAP over SSL connections the standard port is 993.
619
620 @var{MAILBOX} is the name of the mailbox on the IMAP server.  This should
621 be @samp{"inbox"}, to access your default IMAP maildrop on the
622 server.
623
624 @var{AUTH} is the authentication method used to convince the
625 server you should have access to the maildrop.  Acceptable values
626 are @samp{"preauth"}, @samp{"cram-md5"}, and @samp{"login"}.
627 @samp{"preauth"} causes VM to skip the authentication stage of
628 the protocol with the assumption that the session was
629 authenticated in some way external to VM.  The hook
630 @code{vm-imap-session-preauth-hook} is run, and it is expected to
631 return a process connected to an authenticated IMAP session.
632 @samp{"cram-md5} tells VM to use the CRAM-MD5 authentication
633 method as specificed in RFC 2195.  The advantage of this method
634 over the @samp{"login"} method is that it avoids sending your
635 password over the net unencrypted.  Not all IMAP servers support
636 @samp{"cram-md5"}; if you're not sure, ask your mail
637 administrator or just try it.  The other value, @samp{"login"},
638 tells VM to use the IMAP LOGIN command for authentication, which
639 sends your username and password in cleartext to the server.
640
641 @var{USER} is the user name used in authentication methods that
642 require such an identifier.  @samp{"login"} and @samp{"cram-md5"}
643 use it currently.
644
645 @var{PASSWORD} is the secret shared by you and the server for
646 authentication purposes.  If the @var{PASSWORD} is @samp{*}, VM
647 will prompt you for the password the first time you try to
648 retrieve mail from the maildrop.  If the password is valid, VM
649 will not ask you for the password again during this Emacs
650 session.
651
652 @vindex vm-imap-max-message-size
653 By default VM will retrieve all the messages from an IMAP maildrop
654 before returning control of Emacs to you.  If the maildrop is
655 large, the wait could be considerable.  If you set
656 @code{vm-imap-max-message-size} to a positive numeric value, VM will not 
657 automatically retrieve messages larger than this size.  If VM is
658 retrieving messages because you invoked @code{vm-get-new-mail}
659 interactively, then VM will ask whether it should retrieve the
660 large message.  If VM is retrieving messages automatically
661 (e.g. @code{vm-auto-get-new-mail} is set non-@code{nil}) then VM will skip the
662 large message and you can retrieve it later.
663
664 @vindex vm-imap-bytes-per-session
665 @vindex vm-imap-messages-per-session
666 The variable @code{vm-imap-messages-per-session} controls how many messages
667 VM will retrieve from an IMAP maildrop before returning control to
668 you.  Similarly, the variable @code{vm-imap-bytes-per-session} limits the
669 number of bytes VM will retrieve from an IMAP maildrop before returning
670 control to you.  By default, the value of both variables is nil, which
671 tells VM to retrieve all the messages in the IMAP maildrop regardless
672 of how many messages there are and how large the maildrop is.
673
674 @vindex vm-imap-expunge-after-retrieving
675 After VM retrieves messages from the maildrop, the default action
676 is to delete the messages from there.  If you want VM to leave
677 messages in the remote maildrop until you explicitly request
678 their removal, set @code{vm-imap-expunge-after-retrieving} to
679 @code{nil}.  Messages will not be removed from the maildrop until you
680 run @code{vm-expunge-imap-messages}; only those messages that VM has
681 retrieved into the current folder will be expunged.
682
683 @vindex vm-imap-auto-expunge-alist
684 The variable @code{vm-imap-auto-expunge-alist} gives you a way to specify
685 on a per-maildrop basis which IMAP maildrops have message
686 automatically removed when retrieved and which ones leave the
687 messages on the IMAP server.  The value of
688 @code{vm-imap-auto-expunge-alist} should be a list of IMAP mailboxes and
689 values specifying whether messages should be automatically
690 deleted from the mailbox after retrieval.  The format of the list
691 is:
692
693 @example
694 ((@var{MAILBOX} . @var{VAL}) (@var{MAILBOX} . @var{VAL}) ...)
695 @end example
696
697 @var{MAILBOX} should be an IMAP maildrop specification as described
698 in the documentation for the variable @code{vm-spool-files}.  If
699 you have the IMAP password specified in the @code{vm-spool-files}
700 entry, you do not have to specify it here as well.  Use @samp{*}
701 instead; VM will still understand that this mailbox is the same as
702 the one in @code{vm-spool-files} that contains the password.
703
704 @var{VAL} should be @code{nil} if retrieved messages should be left in the
705 corresponding IMAP mailbox, @code{t} if retrieved messages should be
706 removed from the mailbox immediately after retrieval.
707
708 Here is an example:
709
710 @example
711 (setq vm-imap-auto-expunge-alist
712    '(
713      ;; leave message on the server
714      ("imap:odin.croc.net:143:inbox:login:kyle:*" . nil)
715      ;; expunge immediately
716      ("imap:hilo.harkie.org:143:inbox:login:kyle:*" . t)
717     )
718 )
719 @end example
720
721 @node POP Folders,,, Spool Files
722 @section POP Folders
723 @cindex POP
724
725 @findex vm-visit-pop-folder
726 VM's traditional mode of operation is to treat all remote mail
727 sources as spool files, pulling all mail down from remote sources
728 into local folders and deleting the remote copies.  But sometimes
729 it is more convenient to treat a remote mail source as a folder
730 instead of a spool file, manipulating the remote source as if it
731 were a folder instead of just a holding area for incoming messages.
732
733 The command @code{vm-visit-pop-folder} allows you to visit a POP
734 mailbox as if it were a folder.  When you visit a POP folder, VM
735 will download copies of the messages that it finds there for you
736 to read.  If you delete and expunge messages in the folder, the
737 corresponding messages on the POP server will be removed when you
738 save the changes with @code{vm-save-folder}.
739
740 Message attributes (new, replied, filed, etc.) and labels cannot
741 be stored on the POP server but they will be maintained locally,
742 just as they are for ordinary folders.
743
744 @vindex vm-pop-folder-alist
745 In order for VM to know about POP folders that you can access, you
746 must declare them by setting the variable @code{vm-pop-folder-alist}.
747 The variable's value should be an associative list of the form:
748
749 @example
750  ((@var{POPDROP} @var{NAME}) ...)
751 @end example
752
753 @var{POPDROP} is a POP maildrop specification in the same format used
754 by @code{vm-spool-files}.
755
756 @var{NAME} is a string that should give a less cumbersome name that you
757 will use to refer to this maildrop when using @code{vm-visit-pop-folder}.
758
759 For example:
760
761 @example
762 (setq vm-pop-folder-alist
763       '(
764          ("pop:pop.mail.yahoo.com:110:pass:someuser:*" "Yahoo! mail")
765          ("pop:localhost:110:pass:someuser:*" "local mail")
766        )
767 )
768 @end example
769
770 @samp{Yahoo! mail} and @samp{local mail} are what you would type
771 when @code{vm-visit-pop-folder} asks for a folder name.
772
773 @node IMAP Folders,,, Spool Files
774 @section IMAP Folders
775 @cindex IMAP
776
777 @findex vm-visit-imap-folder
778 VM's traditional mode of operation is to treat all remote mail
779 sources as spool files, pulling all mail down from remote sources
780 into local folders and deleting the remote copies.  But sometimes
781 it is more convenient to treat a remote mail source as a folder
782 instead of a spool file, manipulating the remote source as if it
783 were a folder instead of just a holding area for incoming messages.
784
785 The command @code{vm-visit-imap-folder} allows you to visit a IMAP
786 mailbox as if it were a folder.  When you visit a IMAP folder, VM
787 will download copies of the messages that it finds there for you
788 to read.  If you delete and expunge messages in the local copy of
789 the folder, the corresponding messages on the IMAP server will be
790 removed when you save the changes with @code{vm-save-folder}.
791
792 Message attributes (new, replied, filed, etc.) are stored on the
793 IMAP server and are also cached locally.  Labels cannot be stored
794 on the IMAP server but you can use them lcoally.
795
796 @vindex vm-imap-server-list
797 In order for VM to know about IMAP servers that you can access, you
798 must declare them by setting the variable @code{vm-imap-server-list}.
799 The variable's value should be a list of the form:
800
801 @example
802  (@var{IMAPDROP} @var{IMAPDROP} ...)
803 @end example
804
805 @var{IMAPDROP} is a IMAP maildrop specification in the same format used
806 by @code{vm-spool-files}. @xref{IMAP Spool Files}.
807
808 For example:
809
810 @example
811 (setq vm-imap-server-list
812       '(
813          "imap-ssl:mail.foocorp.com:993:inbox:login:becky:*"
814          "imap:crickle.lex.ky.us:143:inbox:login:becky:*"
815        )
816 )
817 @end example
818
819 The mailbox (@samp{inbox} in the example) is ignored; when
820 when @code{vm-visit-imap-folder} asks for a folder name you can
821 enter any folder that is acessible to you on the IMAP server.
822
823 @node Getting New Mail, Crash Recovery, Spool Files, Starting Up
824 @section Getting New Mail
825
826 @findex vm-get-new-mail
827 Pressing @kbd{g} runs @code{vm-get-new-mail}, which will retrieve
828 mail from all the spool files associated with the current folder.
829 @xref{Spool Files}.  For POP folders, any newly arrived messages
830 at the POP server will be incorporated into the local copy of the
831 POP folder.
832
833 @vindex vm-auto-get-new-mail
834 If the value of the variable @code{vm-auto-get-new-mail} is non-@code{nil} VM
835 will retrieve mail for a folder whenever the folder is visited.  If the
836 value is a positive integer @var{n}, VM will also check for new mail
837 every @var{n} seconds for all folders currently being visited.  If new
838 mail is present, VM will retrieve it.
839
840 @vindex vm-mail-check-interval
841 If the value of the variable @code{vm-mail-check-interval} is a
842 positive integer @var{n}, VM will check for new mail every @var{n}
843 seconds, but instead of retrieving mail, the word ``Mail'' will
844 appear on the Emacs mode line of folders that have mail waiting.
845
846 @node Crash Recovery,, Getting New Mail, Starting Up
847 @section Crash Recovery
848
849 When Emacs crashes, its last action before dying is to try to
850 write out an autosave file that contains changes to files that
851 you were editing.  VM folders are file buffers inside Emacs, so
852 folders are autosaved also.  Changes, with regard to VM folders,
853 means attribute changes, label additions and deletions, message
854 edits, and expunges.  VM keeps track of whether a message is new
855 or old, whether it has been replied to, whether it is flagged
856 for deletion and so on, by writing special headers into the
857 folder buffer.  These headers are saved to disk when you save
858 the folder.  If Emacs crashes before the folder has been saved,
859 VM may forget some attribute changes unless they were written to
860 the autosave file.
861
862 Note that when VM retrieves mail from spool files it @emph{always}
863 writes them to disk immediately and at least one copy of the message is
864 on disk at all times.  So while you can lose attribute changes from
865 crashes, you should not lose messages unless the disk itself is
866 compromised.
867
868 When you visit a folder, VM checks for the existence of an
869 autosave file that has been modified more recently than the
870 folder file.  If such an autosave file exists, there is a good
871 chance that Emacs or your operating system crashed while VM
872 was visiting a folder.  VM will then write a message to the echo
873 area informing you of the existence of the autosave file and
874 visit the folder in read-only mode.  Visiting the folder in
875 read-only mode prevents you from modifying the folder, which
876 in turn prevents Emacs from wanting to write new changes to
877 the autosave file.  VM will not retrieve new mail for a folder
878 that is in read-only mode.  VM also skips summary
879 generation and MIME decoding to help catch your attention.
880
881 If you want to recover the lost changes, run @kbd{M-x recover-file} or
882 use the Recover toolbar button.  At the
883 @samp{Recover File: } prompt press @kbd{RET}.  Emacs will then
884 display a detailed directory listing showing the folder file and the
885 autosave file and ask if you want to recover from the autosave file.  A
886 good rule of thumb is to answer ``yes'' if the autosave file is larger
887 than the folder file.  If the autosave file is significantly smaller,
888 Emacs may not have completed writing the autosave file.  Or it could be
889 that the smaller autosave file reflects the results of an expunge that
890 you had not yet committed to disk before the crash.  If so, answering
891 ``no'' means you might have to do that expunge again, but this is better
892 than not knowing whether the autosave file was truncated.
893
894 Assuming you answered ``yes'', the folder buffer's contents will be
895 replaced by the contents of the autosave file and VM will reparse the
896 folder.  At this point the contents of the folder buffer and the disk
897 copy of the folder are different.  Therefore VM will not get new mail
898 for this folder until the two copies of the folder are synchronized.
899 When you are satisfied that the recovered folder is whole and intact,
900 type @kbd{S} to save it to disk.  After you do this, VM will allow you
901 to use @kbd{g} to retrieve any new mail that has arrived in the spool
902 files for the folder.
903
904 Assuming you answered ``no'' to the recovery question, you should type
905 @kbd{C-x C-q}, which is bound to @code{vm-toggle-read-only} in VM folder
906 buffers.  The folder will be taken out of read-only mode and you can
907 read and retrieve your mail normally.
908
909 @node Selecting Messages, Reading Messages, Starting Up, Top
910 @chapter Selecting Messages
911
912 @findex vm-next-message
913 @findex vm-previous-message
914 @kindex n
915 @kindex p
916 @vindex vm-skip-deleted-messages
917 @vindex vm-skip-read-messages
918 In order to read, delete, or do anything to a message, you need to
919 select it.  In other words, make the message the @dfn{current message}.
920
921 The primary commands for selecting messages in VM are @kbd{n}
922 (@code{vm-next-message}) and @kbd{p}
923 (@code{vm-previous-message}).  These commands move forward and
924 backward through the current folder.  By default, these commands
925 skip messages flagged for deletion.  This behavior can be
926 disabled by setting the value of the variable
927 @code{vm-skip-deleted-messages} to @code{nil}.  These commands
928 can also be made to skip messages that have been read; set
929 @code{vm-skip-read-messages} to @code{t} to do this.
930
931 The commands @kbd{n} and @kbd{p} also take prefix arguments that
932 specify the number of messages to move forward or backward.  If
933 the magnitude of the prefix argument is greater than 1, no
934 message skipping will be done regardless of the settings of the
935 skip variables.
936
937 @vindex vm-circular-folders
938 The variable @code{vm-circular-folders} determines whether VM folders
939 will be considered circular by various commands.  @dfn{Circular} means VM
940 will wrap from the end of the folder to the start and vice versa when
941 moving the message pointer, deleting, undeleting or saving messages
942 before or after the current message.
943
944 A value of @code{t} causes all VM commands to consider folders circular.
945 A value of @code{nil} causes all VM commands to signal an error if
946 the start or end of the folder would have to be passed to complete the
947 command.  For movement commands, this occurs after the message pointer
948 has been moved as far as it can go.  For other commands the error occurs
949 before any part of the command has been executed, i.e. no deletions, saves,
950 etc. will be done unless they can be done in their entirety.  A value
951 other than @code{nil} or @code{t} causes only VM's movement
952 commands to consider folders circular.  Saves, deletes and undeletes
953 will behave as if the value is @code{nil}.  The default value of
954 @code{vm-circular-folders} is @code{nil}.
955
956 @vindex vm-follow-summary-cursor
957 You can also select messages by using the summary window.
958 @xref{Summaries}.  Move the cursor to the summary line for the message
959 you want to select and press @kbd{RET}.  VM will select this message.
960 Instead of pressing @kbd{RET} you could run some other VM command that
961 operates based on the notion of a `current message'.  VM will select the
962 message under the cursor in the summary window before executing such
963 commands.  Example, if you type @kbd{d}, VM will select the message
964 under the cursor and then delete it.  Note that this occurs @emph{only}
965 when you execute a command when the cursor is in the summary buffer
966 window and only if the variable @code{vm-follow-summary-cursor} is
967 non-@code{nil}.
968
969 @vindex vm-jump-to-unread-messages
970 @vindex vm-jump-to-new-messages
971 When a folder is visited or when you type @kbd{g} and VM retrieves some
972 mail, the default action is to move to the first new or unread message
973 in the folder.  New messages are favored over old but unread messages.
974 If you set @code{vm-jump-to-new-messages} to @code{nil}, VM will favor old,
975 unread messages over new messages if the old, unread message appears
976 earlier in the folder.  If you set @code{vm-jump-to-unread-messages} to
977 @code{nil} also, VM will not search for new or unread messages.
978
979 Other commands to select messages:
980
981 @table @kbd
982 @findex vm-goto-message
983 @kindex RET
984 @item RET (@code{vm-goto-message})
985 Go to message number @var{n}.  @var{n} is the prefix argument, if
986 provided, otherwise it is prompted for in the minibuffer.
987 @findex vm-goto-message
988 @kindex TAB
989 @item TAB (@code{vm-goto-message-last-seen})
990 Go to message last previewed or read.
991 @findex vm-next-message-no-skip
992 @findex vm-previous-message-no-skip
993 @kindex N
994 @kindex P
995 @item N (@code{vm-next-message-no-skip})
996 @itemx P (@code{vm-previous-message-no-skip})
997 Go to the next (previous) message, ignoring the settings of the skip
998 control variables.
999 @findex vm-next-unread-message
1000 @findex vm-previous-unread-message
1001 @kindex M-n
1002 @kindex M-p
1003 @item M-n (@code{vm-next-unread-message})
1004 @itemx M-p (@code{vm-previous-unread-message})
1005 Move forward (backward) to the nearest new or unread message.
1006 @findex vm-isearch-forward
1007 @findex vm-isearch-backward
1008 @kindex M-s
1009 @comment @kindex M-r
1010 @vindex vm-search-using-regexps
1011 @item M-s (@code{vm-isearch-forward})
1012 @item M-x vm-isearch-backward
1013 These work just like Emacs' normal forward and backward incremental
1014 search commands, except that when the search ends, VM selects the
1015 message containing point.  If the value of the variable
1016 @code{vm-search-using-regexps} is non-@code{nil}, a regular expression
1017 may be used instead of a fixed string for the search pattern; VM
1018 defaults to the fixed string search.  If a prefix argument is given,
1019 the value of @code{vm-search-using-regexps} is temporarily reversed for
1020 the search.
1021 @xref{Incremental Search,,,emacs, the GNU Emacs Manual}.
1022 @end table
1023
1024 @node Reading Messages, Sending Messages, Selecting Messages, Top
1025 @chapter Reading Messages
1026
1027 Once a message has been selected, VM will show it to you.  By default,
1028 presentation is done in two stages: @dfn{previewing} and @dfn{paging}.
1029
1030 @menu
1031 * Previewing::                  Customizing message previews.
1032 * Paging::                      Scrolling through the current message.
1033 * Reading MIME Messages::       Using VM's MIME display features.
1034 @end menu
1035
1036 @node Previewing, Paging, Reading Messages, Reading Messages
1037 @section Previewing
1038
1039 @dfn{Previewing} means showing you a small portion of a message
1040 and allowing you to decide whether you want to read it.  Typing
1041 @key{SPC} exposes the body of the message, and from there you can
1042 repeatedly type @key{SPC} to page through the message.
1043
1044 By default, the sender, recipient, subject and date headers are shown
1045 when previewing; the rest of the message is hidden.  This behavior may
1046 be altered by changing the settings of three variables:
1047 @code{vm-visible-headers}, @code{vm-invisible-header-regexp} and
1048 @code{vm-preview-lines}.
1049
1050 @vindex vm-preview-lines
1051 If the value of @code{vm-preview-lines} is a number, it tells VM how
1052 many lines of the text of the message should be visible.  The default
1053 value of this variable is 0.  If @code{vm-preview-lines} is @code{nil},
1054 then previewing is not done at all; when a message is first presented it
1055 is immediately exposed in its entirety and is flagged as read.  If
1056 @code{vm-preview-lines} is @code{t}, the message body is displayed fully
1057 but the message is not flagged as read until you type @key{SPC}.
1058
1059 @vindex vm-visible-headers
1060 The value of @code{vm-visible-headers} should be a list of regular
1061 expressions matching the beginnings of headers that should be made
1062 visible when a message is presented.  The regexps should be listed in
1063 the preferred presentation order of the headers they match.
1064
1065 @vindex vm-invisible-header-regexp
1066 If non-@code{nil}, the variable @code{vm-invisible-header-regexp}
1067 specifies what headers should @emph{not} be displayed.  Its value should
1068 be a string containing a regular expression that matches all headers you
1069 do not want to see.  Setting this variable non-@code{nil} implies that
1070 you want to see all headers not matched by it; therefore the value of
1071 @code{vm-visible-headers} is only used to determine the order of the
1072 visible headers in this case.  Headers not matched by
1073 @code{vm-invisible-header-regexp} or @code{vm-visible-headers} are
1074 displayed last.
1075
1076 If you change the value of either @code{vm-visible-headers} or
1077 @code{vm-invisible-header-regexp} in the middle of a VM session the
1078 effects will not be immediate.  You will need to use the command
1079 @code{vm-discard-cached-data} on each message (bound to @kbd{j} by
1080 default) to force VM to rearrange the message headers.  A good way to do
1081 this is to mark all the messages in the folder and apply
1082 @code{vm-discard-cached-data} to the marked messages.  @xref{Message
1083 Marks}.
1084
1085 @vindex vm-highlighted-header-regexp
1086 @vindex vm-highlighted-header-face
1087 Another variable of interest is @code{vm-highlighted-header-regexp}.
1088 The value of this variable should be a single regular expression that
1089 matches the beginnings of any header that should be presented in inverse
1090 video when previewing.  For example, a value of
1091 @samp{"^From\\|^Subject"} causes the From and Subject headers to be
1092 highlighted.  Highlighted headers will be displayed using the face
1093 specified by @code{vm-highlighted-header-face}, which defaults to
1094 'bold.
1095
1096 @vindex vm-preview-read-messages
1097 By default, VM will not preview messages that are flagged as read.  To
1098 have VM preview all messages, set the value of
1099 @code{vm-preview-read-messages} to @code{t}.
1100
1101 @findex vm-expose-hidden-headers
1102 Typing @kbd{t} (@code{vm-expose-hidden-headers}) makes VM toggle
1103 between exposing and hiding headers that would ordinarily be hidden.
1104
1105 @node Paging, Reading MIME Messages, Previewing, Reading Messages
1106 @section Paging
1107
1108 @vindex vm-auto-next-message
1109 Typing @key{SPC} during a message preview exposes the body of the
1110 message.  If the message was new or previously unread, it will be
1111 flagged ``read''.  At this point you can use @key{SPC} to scroll
1112 forward, and @kbd{b} or @key{DEL} to scroll backward a windowful of
1113 text at a time.  A prefix argument @var{n} applied to these commands
1114 causes VM to scroll forward or backward @var{n} lines.  Typing space
1115 at the end of a message moves you to the next message.  If the value
1116 of @code{vm-auto-next-message} is @code{nil}, @key{SPC} will not
1117 move to the next message; you must type @kbd{n} explicitly.
1118
1119 If the value of @code{vm-honor-page-delimiters} is non-@code{nil}, VM
1120 will recognize and honor page delimiters.  This means that when you
1121 scroll through a document, VM will display text only up to the next page
1122 delimiter.  Text after the delimiter will be hidden until you type
1123 another @key{SPC}, at which point the text preceding the delimiter will
1124 become hidden.  The Emacs variable @code{page-delimiter} determines what
1125 VM will consider to be a page delimiter.
1126
1127 You can ``unread'' a message (so to speak) by typing @kbd{U}
1128 (@code{vm-unread-message}).  The current message will be flagged
1129 unread.
1130
1131 @vindex vm-paragraph-fill-column
1132 @vindex vm-fill-paragraphs-containing-long-lines
1133 Sometimes you will receive messages that contain lines that are
1134 too long to fit on your screen without wrapping.  If you set
1135 @code{vm-fill-paragraphs-containing-long-lines} to a positive
1136 numeric value @var{N}, VM will call @code{fill-paragraph} on all
1137 paragraphs that contain lines spanning @var{N} columns or more.
1138 As with other things VM does that modifies the way the
1139 message looks on the screen, this does not change message
1140 contents.  VM copies the message contents to a ``presentation''
1141 buffer before altering them.  The fill column that VM uses is
1142 controlled by @code{vm-paragraph-fill-column}.  Unlike the Emacs
1143 variable @code{fill-column}, this variable is not buffer-local
1144 by default.
1145
1146 @node Reading MIME Messages,, Paging, Reading Messages
1147 @chapter Reading MIME Messages
1148
1149 @vindex vm-display-using-mime
1150 If the variable @code{vm-display-using-mime} is non-@code{nil} VM will display
1151 messages using Multipurpose Internet Mail Extensions (MIME).  @dfn{MIME}
1152 is a set of extensions to the standard Internet message format that
1153 allows reliable transmission of arbitrary data including
1154 images, audio and video, as well as ordinary text.  A non-@code{nil} value for
1155 this variable means that VM will recognize MIME encoded messages and
1156 display them as specified by the various MIME standards specifications.
1157 A nil value means VM will display MIME messages as plain text messages.
1158
1159 @vindex vm-mime-base64-decoder-program
1160 @vindex vm-mime-base64-encoder-program
1161 @vindex vm-mime-base64-decoder-switches
1162 @vindex vm-mime-base64-encoder-switches
1163 @vindex vm-mime-qp-decoder-program
1164 @vindex vm-mime-qp-decoder-switches
1165 @vindex vm-mime-qp-encoder-program
1166 @vindex vm-mime-qp-encoder-switches
1167 @vindex vm-mime-uuencode-decoder-program
1168 @vindex vm-mime-uuencode-decoder-switches
1169 At its most basic MIME is a set of transfer encodings used to ensure
1170 error free transport, and a set of content types.  VM understands the
1171 two standard MIME transport encodings, Quoted-Printable and BASE64, and
1172 will decode messages that use them as necessary.  VM also will
1173 try to recognize and decode messages using the UNIX ``uuencode''
1174 encoding system.  While this is not an official MIME transfer
1175 encoding and never will be, enough old mailers still use it
1176 that it is worthwile to attempt to decode it.
1177 VM has Emacs-Lisp based Quoted-Printable and BASE64 encoders and
1178 decoders, but you can have VM use external programs to perform
1179 these tasks and the process will almost certainly be faster.
1180 The variables @code{vm-mime-qp-decoder-program},
1181 @code{vm-mime-qp-decoder-switches},
1182 @code{vm-mime-qp-encoder-program},
1183 @code{vm-mime-qp-encoder-switches},
1184 @code{vm-mime-base64-decoder-switches},
1185 @code{vm-mime-base64-encoder-switches},
1186 @code{vm-mime-base64-decoder-program},
1187 @code{vm-mime-base64-encoder-program},
1188 tell VM which programs to use
1189 and what command line switches to pass to them.  There are C
1190 programs at VM's distribution sites on the Internet to handle BASE64
1191 and Quoted-Printable.  VM does not have a builtin ``uuencode''
1192 decoder, so @code{vm-mime-uuencode-decoder-program} must be set
1193 non-@code{nil} for VM to decode uuencoded MIME objects.
1194
1195 By default VM will display as many content types as possible
1196 within Emacs.  Images and audio are also supported if
1197 support for images and audio has been compiled in.  Types that
1198 cannot be displayed internally within Emacs can be converted to a
1199 type that can, or be displayed using an external viewer.
1200
1201 @vindex vm-auto-decode-mime-messages
1202 @vindex vm-mime-decode-for-preview
1203 The first step in displaying a MIME message is decoding it to
1204 determine what object types it contains.  The variable
1205 @code{vm-auto-decode-mime-messages} controls when this happens.
1206 A value of @code{t} means VM should decode the message as soon as
1207 the message body is exposed, or during previewing if
1208 @code{vm-mime-decode-for-preview} is also set non-@code{nil}.  A
1209 @code{nil} value means wait until decoding is explicitly
1210 requested.  Type @kbd{D} (@code{vm-decode-mime-message}) to
1211 manually initiate MIME decoding.
1212
1213 @kindex $ |
1214 @kindex $ d
1215 @kindex $ RET
1216 @kindex $ s
1217 @kindex $ w
1218 @kindex $ p
1219 @kindex $ d
1220 @kindex $ e
1221 @vindex vm-auto-displayed-mime-content-types
1222 After decoding you will see either the decoded MIME objects or
1223 button lines that must be activated to attempt display of the
1224 MIME object.  The variable
1225 @code{vm-auto-displayed-mime-content-types} specifies the types
1226 that are displayed immediately.  Its value should be a list of
1227 MIME content types that should be displayed immediately after
1228 decoding.  Other types will be displayed as a button that you
1229 must activate to display the object.  To activate a button,
1230 either click the middle mouse button over it, or move the cursor
1231 to the line and press RET.  If you are running under a window
1232 system, you can use the right mouse button over a MIME button to
1233 display a menu of actions you can take on the MIME object.  If
1234 you prefer using keyboard commands, you can save the MIME object
1235 with @kbd{$ w}, print it with @kbd{$ p}, or pipe it to a shell
1236 command with @kbd{$ |}.  Use @kbd{$ s} to append an encapsulated
1237 message or USENET news article to a folder.  If you want to
1238 display the object with its characters displayed using Emacs'
1239 default face, use @kbd{$ RET}.  To display the object using an
1240 external viewer, type @kbd{$ e}.
1241
1242 @vindex vm-mime-confirm-delete
1243 Sometimes MIME objects are large and you may not want to save
1244 them along with the message that contains them.  If so, use
1245 @kbd{$ d} (@code{vm-delete-mime-object}) while the cursor is on
1246 the MIME button.  The object will be deleted and replaced with
1247 an object that indicates what the old object was and the fact
1248 that it is gone.  This is not an undoable operation, so use this
1249 command with care.  If you inadvertently delete an object, the
1250 only way to get it back is to quit visiting the current folder
1251 without saving and then revisit the folder.  This works because
1252 the object isn't removed from the disk copy of the folder until
1253 you save the folder.  By default VM will ask if you're sure
1254 about deleting an object before doing the deletion.  You can
1255 make VM not ask this question by setting
1256 @code{vm-mime-confirm-delete} to @code{nil}.
1257
1258 @vindex vm-auto-displayed-mime-content-types
1259 A value of t for @code{vm-auto-displayed-mime-content-types} means that
1260 all types should be displayed immediately.  A nil value means
1261 never display MIME objects immediately; only use buttons.  If
1262 the value of @code{vm-auto-displayed-mime-content-types} is a list, it
1263 should be a list of strings, which should all be MIME types or
1264 type/subtype pairs.  Example:
1265
1266 @example
1267 (setq vm-auto-displayed-mime-content-types '("text" "image/jpeg"))
1268 @end example
1269
1270 If a top-level type is listed without a subtype, all subtypes of that
1271 type are assumed to be included.  The example above specifies that all
1272 text types are displayed immediately, but only JPEG images are displayed
1273 this way.
1274
1275 @vindex vm-auto-displayed-mime-content-type-exceptions
1276 The variable @code{vm-auto-displayed-mime-content-type-exceptions}
1277 should be a list of MIME content types that should not be
1278 displayed immediately after decoding.  This variable acts as
1279 an exception list for @code{vm-auto-displayed-mime-content-types};
1280 all types listed there will be auto-displayed except those in
1281 the exception list.
1282
1283 The value of @code{vm-auto-displayed-mime-content-type-exceptions}
1284 should be either nil or a list of strings.  The strings should
1285 all be types or type/subtype pairs.  Example:
1286
1287 @example
1288 (setq vm-auto-displayed-mime-content-type-exceptions '("text/html"))
1289 @end example
1290
1291 Again, if a top-level type is listed without a subtype, all subtypes of
1292 that type are assumed to be included.
1293
1294 @vindex vm-mime-internal-content-types
1295 The variable @code{vm-mime-internal-content-types} specifies
1296 which types should be displayed internally within Emacs.  Like
1297 @code{vm-auto-displayed-mime-content-types} its value should be a
1298 list of MIME content types.  A value of t means that VM
1299 should always display an object internally if possible.  VM
1300 knows which object types can be displayed internally, so you
1301 can specify the types you want without worrying about errors
1302 if Emacs can't handle them.  A @code{nil} value means never
1303 display MIME objects internally, which means VM will have to
1304 run an external viewer to display all MIME objects.
1305
1306 If the value is a list, it should be a list of strings.  Example:
1307
1308 @example
1309 (setq vm-mime-internal-content-types '("text" "image/jpeg"))
1310 @end example
1311
1312 If a top-level type is listed without a subtype, all subtypes of that
1313 type are assumed to be included.  Note that multipart types are always
1314 handled internally regardless of the setting of this variable.
1315
1316 @vindex vm-mime-internal-content-type-exceptions
1317 The variable @code{vm-mime-internal-content-type-exceptions} serves as
1318 the exception list for @code{vm-mime-internal-content-types}.  Its value 
1319 should be a list of types that should not be displayed internally.
1320
1321 @vindex vm-mime-external-content-types-alist
1322 For types that you want displayed externally, set the value
1323 of @code{vm-mime-external-content-types-alist} to specify external
1324 viewers for the types.  The value of this variable should be an
1325 associative list of MIME content types and the external programs
1326 used to display them.  If VM cannot display a type internally or
1327 a type is not listed in @code{vm-mime-internal-content-types} VM will
1328 try to launch an external program to display that type.
1329
1330 The alist format is a list of lists, each sublist having the form
1331
1332 @example
1333 (@var{TYPE} @var{PROGRAM} @var{ARG} @var{ARG} ... )
1334 @end example
1335
1336 or
1337
1338 @example
1339 (@var{TYPE} @var{COMMAND-LINE})
1340 @end example
1341
1342 @var{TYPE} is a string specifying a MIME type or type/subtype pair.
1343 For example ``text'' or ``image/jpeg''.  If a top-level type is
1344 listed without a subtype, all subtypes of that type are assumed
1345 to be included.
1346
1347 In the first form, @var{PROGRAM} is a string naming a program to
1348 run to display an object.  Any @var{ARG}s will be passed to the
1349 program as arguments.  The octets that compose the object will be
1350 written into a temporary file and the name of the file can be
1351 inserted into an @var{ARG} string by writing @samp{%f} in the
1352 @var{ARG} string.  The filename is
1353 added as the last argument
1354 if @samp{%f} does not appear in any of the @var{ARG} strings.
1355
1356 If the @var{COMMAND-LINE} form is used, the program and its
1357 arguments are specified as a single string and that string is
1358 passed to the shell ("sh -c" typically) for execution.  Since
1359 the command line will be passed to the shell, you can use shell
1360 variables and input/output redirection if needed.  As with the
1361 @var{PROGRAM/ARGS} form, the name of the temporary file that
1362 contains the MIME object will be appended to the command line if
1363 @samp{%f} does not appear in the command line string.
1364
1365 In either the @var{PROGRAM/ARG} or @var{COMMAND-LINE} forms, all the
1366 program and argument strings will have any %-specifiers in
1367 them expanded as described in the documentation for the
1368 variable @code{vm-mime-button-format-alist}.  The only difference
1369 is that @samp{%f} refers to the temporary file VM creates to store
1370 the object to be displayed, not the filename that the sender
1371 may have associated with the attachment.
1372
1373 Example:
1374
1375 @example
1376 (setq vm-mime-external-content-types-alist
1377       '(
1378          ("text/html"   "netscape")
1379          ("image/gif"   "xv")
1380          ("image/jpeg"  "xv")
1381          ("video/mpeg"  "mpeg_play")
1382          ("video"       "xanim")
1383        )
1384 )
1385 @end example
1386
1387 The first matching list element will be used.
1388
1389 No multipart message will ever be sent to an external viewer.
1390
1391 External viewer processes are normally killed when you select a
1392 a new message in the current folder.  If you want viewer
1393 processes to not be killed, set
1394 @code{vm-mime-delete-viewer-processes} to a @code{nil} value.
1395
1396 Any type that cannot be displayed internally or externally or
1397 converted to a type that can be displayed, will be displayed as a
1398 button that allows you to save the body to a file.
1399
1400 @vindex vm-mime-external-content-type-exceptions
1401 As with the internal type list, there is an exception list that
1402 you can use to specify types that you do not want displayed
1403 externally.  When VM is considering whether it should
1404 automatically launch an external viewer, it will consult the
1405 variable @code{vm-mime-external-content-type-exceptions}.  If the 
1406 type to be displayed is listed, VM will not launch a viewer.
1407 This allows you to setup viewers for types that ordinarily you
1408 would not want VM to display or for types that you norally want
1409 to convert to some other type using @code{vm-mime-type-converter-alist}.
1410 You can still display such a type with anexternal viewer by using 
1411 @kbd{$ e}.
1412
1413 @vindex vm-mime-attachment-auto-suffix-alist
1414
1415 When a MIME object is displayed using an external viewer VM must
1416 first write the object to a temporary file.  The external viewer
1417 thne opens and displays that file.  Some viewers will not open a
1418 file unless the filename ends with some extention that it
1419 recognizes such as @samp{.html} or @samp{.jpg}.  You can use the
1420 variable @code{vm-mime-attachment-auto-suffix-alist} to map MIME
1421 types to extensions that your external viewers will recognize.
1422 The value of this variable should be a list of type and suffix
1423 pairs.  The list format is:
1424
1425 @example
1426 ((@var{TYPE} . @var{SUFFIX}) ...)
1427 @end example
1428
1429 @var{TYPE} is a string specifying a MIME top-level type or a type/subtype pair.
1430 If a top-level type is listed without a subtype, all subtypes of
1431 that type are matched.
1432
1433 @var{SUFFIX} is a string specifying the suffix that shoul be used for
1434 the accompanying type.
1435
1436 Example:
1437
1438 @example
1439 (setq vm-mime-attachment-auto-suffix-alist
1440       '(
1441         ("image/jpeg"           .       ".jpg")
1442         ("image/gif"            .       ".gif")
1443         ("image/png"            .       ".png")
1444         ("text"                 .       ".txt")
1445        )
1446 )
1447 @end example
1448
1449 VM will search the list for a matching type.  The suffix
1450 associated with the first type that matches will be used for the
1451 temporary filename.
1452
1453 @vindex vm-mime-type-converter-alist
1454 Types that cannot be displayed internally or externally are
1455 checked against an associative list of types that can be converted to other
1456 types.  If an object can be converted to a type that VM can
1457 display, then the conversion is done and the new object is
1458 subject to the auto-display rules which determine whether the
1459 object is displayed immediately or a button is displayed in its
1460 place.  The conversion list is stored in the variable
1461 @code{vm-mime-type-converter-alist}.
1462
1463 The alist format is
1464
1465 @example
1466 ( (START-TYPE END-TYPE COMMAND-LINE ) ... )
1467 @end example
1468
1469 @var{START-TYPE} is a string specifying a MIME type or type/subtype pair.
1470 Example @samp{"text"} or @samp{"image/jpeg"}.  If a top-level type is
1471 listed without a subtype, all subtypes of that type are assumed
1472 to be included.
1473
1474 @var{END-TYPE} must be an exact type/subtype pair.  This is the type
1475 to which @var{START-TYPE} will be converted.
1476
1477 @var{COMMAND-LINE} is a string giving a command line to be passed to
1478 the shell.  The octets that compose the object will be written to
1479 the standard input of the shell command.
1480
1481 Example:
1482
1483 @example
1484 (setq vm-mime-type-converter-alist
1485        '(
1486          ("image/jpeg"  "image/gif"     "jpeg2gif")
1487          ("text/html"   "text/plain"    "striptags")
1488         )
1489 )
1490 @end example
1491
1492 The first matching list element will be used.
1493
1494 For text type messages, MIME also requires that a character set
1495 be specified, so that the recipient's mail reader knows what
1496 character glyphs to use to display each character code.  To
1497 display a message properly VM needs to know how to choose a font
1498 for a given character set.
1499
1500 @vindex vm-mime-default-face-charsets
1501 The variable @code{vm-mime-default-face-charsets} tells VM what character
1502 sets your default face can display.  For most American and European
1503 users using X Windows, Emacs' default face displays the ISO-8859-1
1504 and US-ASCII characters, US-ASCII being a subset of ISO-8859-1.  The
1505 value of @code{vm-mime-default-face-charsets} must be a list of strings
1506 specifying the character sets that your default face can display.
1507 This variable is useful for making bogus, unregistered character sets
1508 that are slight variants of ISO-8859-1 visible.
1509 Example:
1510
1511 @example
1512 (add-to-list 'vm-mime-default-face-charsets "Windows-1251")
1513 (add-to-list 'vm-mime-default-face-charsets "Windows-1252")
1514 (add-to-list 'vm-mime-default-face-charsets "Windows-1257")
1515 @end example
1516
1517 Messages sent using such character sets would normally be
1518 considered undisplayable by VM, and a button would be displayed
1519 that offers to save the message body to a file.
1520
1521 @vindex vm-mime-charset-converter-alist
1522 Sometimes a charset that VM cannot display can be converted to a
1523 one that VM can display.  An example would be a message encoded
1524 using UTF-8 but in fact only contains Japanese characters.  In
1525 that case the message text could probably be converted to
1526 iso-2022-jp which VM running on a MULE-enabled Emacs could
1527 display.
1528
1529 VM offers a way to do such conversions.  The variable
1530 @code{vm-mime-charset-converter-alist} is an associative list of MIME
1531 charsets and programs that can convert between them.  If VM
1532 cannot display a particular character set, it will scan this list
1533 to see if the charset can be converted into a charset that it can
1534 display.
1535
1536 The alist format is:
1537
1538 @example
1539  ( ( START-CHARSET END-CHARSET COMMAND-LINE ) ... )
1540 @end example
1541
1542 @var{START-CHARSET} is a string specifying a MIME charset.
1543 Example @samp{"iso-8859-1"} or @samp{"utf-8"}.
1544
1545 @var{END-CHARSET} is a string specifying the charset to which
1546 @var{START-CHARSET} will be converted.
1547
1548 @var{COMMAND-LINE} is a string giving a command line to be passed to
1549 the shell.  The characters in @var{START-CHARSET} will be written to the
1550 standard input of the shell command and VM expects characters
1551 encoded in @var{END-CHARSET} to appear at the standard output of the
1552 @var{COMMAND-LINE}.  @var{COMMAND-LINE} is passed to the shell, so you can
1553 use pipelines, shell variables and redirections.
1554
1555 Example:
1556
1557 @example
1558 (setq vm-mime-charset-converter-alist
1559       '(
1560          ("utf-8" "iso-2022-jp" "iconv -f utf-8 -t iso-2022-jp")
1561        )
1562 )
1563 @end example
1564
1565 The first matching list element will be used.
1566
1567 @vindex vm-mime-charset-font-alist
1568 The variable @code{vm-mime-charset-font-alist} tells VM what font to use 
1569 to display a character set that cannot be displayed using
1570 the default face.  The value of this variable should be an
1571 assoc list of character sets and fonts that can be used to display
1572 them.  The format of the list is:
1573  
1574 ( (@var{CHARSET} . @var{FONT}) ...) 
1575  
1576 @var{CHARSET} is a string naming a MIME registered character set such 
1577 as @samp{"iso-8859-5"}.
1578  
1579 @var{FONT} is a string naming a font that can be used to display
1580 @var{CHARSET}.
1581  
1582 An example setup might be: 
1583  
1584 @example
1585 (setq vm-mime-charset-font-alist
1586   '(
1587     ("iso-8859-5" . "-*-*-medium-r-normal-*-16-160-72-72-c-80-iso8859-5")
1588    )
1589 )
1590 @end example
1591
1592 This variable is only useful for character sets whose characters
1593 can all be encoded in single 8-bit bytes.  Also multiple fonts
1594 can only be displayed if you're running under a window system
1595 e.g. X Windows.  So this variable will have no effect if you're
1596 running Emacs on a tty.
1597
1598 Note that under FSF Emacs 19 any fonts you use must be the
1599 same height as your default font.  XEmacs and Emacs 21 do not
1600 have this limitation.  Under Emacs 20 and beyond, and under
1601 any XEmacs version compiled with MULE support, the value of
1602 @code{vm-mime-charset-font-alist} has no effect.  This is
1603 because all characters are displayed using fonts discovered by
1604 MULE and VM has no control over them.
1605
1606 MIME allows a message to be sent with its content encoded in multiple
1607 formats, simultaneously, in the same message.  Such messages have a
1608 content type of multipart/alternative.  The idea is that the sender
1609 might have different MIME decoding or display capabilities than some
1610 of his recipients.  For instance, the sender may be able to compose a
1611 message using fancy text formatting constructs like tables, italics
1612 and equations but some of the recipients may only be able to display
1613 plain text.  The multipart/alternative type message is the solution
1614 to this dilemma.  Such a message would contain at least two text
1615 subparts, one in plaintext and the other in the full featured text
1616 formatting language that the sender used.
1617
1618 @vindex vm-mime-alternative-select-method
1619 To control how VM displays multipart/alternative messages, you must
1620 set the variable @code{vm-mime-alternative-select-method}.  Its value must be
1621 a symbol.  A value of @code{best} tells VM to display the message
1622 using the subpart closest in appearance to what the sender used to
1623 compose the message.  In the example above this would mean displaying
1624 the fully featured text subpart, if VM knows how to display that type.
1625 VM will display the type either internally or externally.  A
1626 value of @code{best-internal} tells VM to use the closest subpart that
1627 it can display internally.  External viewers won't be used in this
1628 case.
1629
1630 @vindex vm-infer-mime-types
1631 Some mailers incorrectly use the generic
1632 @samp{application/octet-stream} type when sending files that
1633 really have a specific MIME type.  For example, a JPEG image
1634 might be sent using @samp{application/octet-stream} type instead
1635 of @samp{image/jpeg}, which would be the correct type.  In many
1636 cases the filename sent along with the mistyped file
1637 (e.g. @file{foo.jpg}) suggests the correct type.  If the variable
1638 @code{vm-infer-mime-types} is set non-@code{nil}, VM will attempt to use 
1639 the filename sent with a MIME attachment to guess an attachment's 
1640 type if the attachment is of type @samp{application/octet-stream}.
1641
1642 @node Sending Messages, Saving Messages, Reading Messages, Top
1643 @chapter Sending Messages
1644
1645 When sending messages from within VM, you will be using the
1646 standard Mail major mode provided with GNU Emacs, plus some
1647 extensions added by VM.  @xref{Mail Mode,,,emacs, the GNU Emacs
1648 Manual}.  However, mail composition buffers created by VM have some
1649 extra command keys.
1650
1651 @table @kbd
1652
1653 @findex vm-yank-message
1654 @findex vm-yank-message-other-folder
1655 @kindex C-c C-y
1656 @item C-c C-y (@code{vm-yank-message})
1657 Copies a message from the folder that is the parent of this
1658 composition into the mail composition buffer.
1659 The message number is read from the minibuffer.  By default, each line of
1660 the copy is prepended with the value of the variable
1661 @code{vm-included-text-prefix}.  All message headers are yanked along
1662 with the text.  Point is left before the inserted text, the mark after.
1663 Any hook functions bound to @code{mail-yank-hooks} are run, after inserting
1664 the text and setting point and mark.  If a prefix argument is given,
1665 this tells VM to ignore @code{mail-yank-hooks}, don't set the mark, don't prepend the
1666 value of @code{vm-included-text-prefix} to every yanked line, and don't yank
1667 any headers other than those specified in
1668 @code{vm-visible-headers} and @code{vm-invisible-headers}.  To yank a message from
1669 a different folder than the parent of this composition, use
1670
1671 @key{M-x vm-yank-message-other-buffer}.
1672 @kindex C-c C-v
1673 @item C-c C-v <Any VM command key>
1674 All VM commands may be accessed in a VM Mail mode buffer by prefixing them
1675 with C-c C-v.
1676 @kindex C-c C-a
1677 @vindex vm-send-using-mime
1678 @item C-c C-a (@code{vm-mime-attach-file})
1679 Attaches a file to the composition.  When you send the message, VM 
1680 will insert the file and MIME encode it.  The variable
1681 @code{vm-send-using-mime} must be set non-@code{nil} for this command to work.
1682 You will be asked for the file's type, and a brief description of 
1683 the attachment.  The description is optional.  If the file's type
1684 is a text type, you will also be asked for the character set
1685 in which the text should be displayed.
1686 The new attachment will appear as a highlighted tag in the
1687 composition buffer.  You can use mouse button 3 on this tag
1688 to set the default content disposition of the attachment.  The
1689 content disposition gives a hint to the recipient's mailer how to 
1690 treat the attachment.  Specifically the disposition will indicate 
1691 whether the attachment should be displayed along with the message 
1692 or saved to a file.  Any text in the composition that appears
1693 before the tag will appear in a MIME text part before the
1694 attachment when the message is encoded and sent.  Similarly, any
1695 text after the tag will appear after the attachment in the
1696 encoded message.  If you change your mind about using the
1697 attachment, you can remove it from the composition with @key{C-k}.
1698 If you want to move the attachment to some other part of the message,
1699 you can kill it @key{C-k} and yank it back with @key{C-y}.
1700
1701 @kindex C-c C-m
1702 @item C-c C-m (@code{vm-mime-attach-message})
1703 Attaches a mail message to the composition.  If invoked with a
1704 prefix arg, the name of a folder read from the minibuffer and
1705 the message or messages to be attached are copied from that
1706 folder.  You will be prompted for the message number of the
1707 message to be attached.  If you invoke the command on marked
1708 messages by running
1709 @code{vm-next-command-uses-marks} first, the marked messages in
1710 the selected folder will be attached as a MIME digest.
1711 @kindex C-c C-b
1712 @item C-c C-b (@code{vm-mime-attach-buffer})
1713 Attaches an Emacs buffer to the composition.
1714
1715 @findex vm-mime-encode-composition
1716 @kindex C-c C-e
1717 @item C-c C-e (@code{vm-mime-encode-composition})
1718 Encodes the composition using MIME, but does not send it.  This
1719 is useful if you want to use PGP to sign a message before sending
1720 it.  After signing the message, you would use C-c C-c as usual to
1721 send the message.  Emacs' @code{undo} command can be used to undo
1722 the encoding, so that you can continue composing the unencoded
1723 message.
1724
1725 @findex vm-preview-composition
1726 @kindex C-c C-p
1727 @item C-c C-p (@code{vm-preview-composition})
1728 Previews the current composition.  The message is copied into a
1729 temporary folder and you can read the message and interact with
1730 it using normal VM mode commands to see how it might look to a
1731 recipient.  Type @key{q} to quit the temporary folder and resume
1732 composing your message.
1733
1734 @findex vm-postpone-composition
1735 @kindex C-c C-d
1736 @item C-c C-d (@code{vm-postpone-composition})
1737 Postpones the current composition.  The message is stored in the
1738 folder specified in @code{vm-postponed-folder}.  You can continue composing
1739 of messages by visiting @code{vm-postponed-folder}, selecting a messsage
1740 and @key{m} or by directly calling the function on any message in any folder
1741 @kbd{M-x vm-continue-postponed-message}.  When called with a prefix arg
1742 @code{vm-postpone-composition} will ask you for the folder to save the draft
1743 to, i.e. you might also save it to your inbox.
1744
1745 @end table
1746
1747 @findex vm-mail
1748 @kindex m
1749 The simplest command is @kbd{m} (@code{vm-mail}) which sends a mail
1750 message much as @kbd{M-x mail} does but allows the added commands
1751 described above.
1752
1753 @code{vm-mail} can be invoked outside of VM by typing @kbd{M-x vm-mail}.
1754 However, only (@code{vm-yank-message-other-folder}) will work; all the
1755 other commands require a parent folder.
1756
1757 If you send a message and it is returned by the mail system
1758 because it was undeliverable, you can resend the message by
1759 typing @kbd{M-r} (@code{vm-resend-bounced-message}).  VM will
1760 extract the old message and its pertinent headers from the
1761 returned message, and place you in a VM Mail mode buffer.  A
1762 Resent-To header will be added, which you can fill in with
1763 the corrected addresses of the recipients that bounced.  You
1764 can also added a Resent-Cc header, which has the same meaning
1765 as a Cc header in a normal message.  Mail will only be sent to
1766 the addresses in the Resent-To and Resent-Cc headers unless
1767 you delete both of those headers.  In that case the To and Cc
1768 headers will be used.
1769
1770 @menu
1771 * MIME Composition::    Sending a message using MIME attachments.
1772 * Replying::            Describes the various ways to reply to a message.
1773 * Forwarding Messages:: How to forward a message to a third party.
1774 @end menu
1775
1776 @node MIME Composition, Replying, Sending Messages, Sending Messages
1777 @section MIME Composition
1778
1779 @vindex vm-send-using-mime
1780 To use VM's MIME composition features, you must have
1781 @code{vm-send-using-mime} set to a non-@code{nil} value.  With MIME composition
1782 enabled, VM will allow you to add file attachments to your
1783 composition and will analyze your message when you send it and
1784 MIME encode it as necessary.
1785
1786 @kindex C-c C-a
1787 To attach a file to your composition, use @kbd{C-c C-a}
1788 (@code{vm-mime-attach-file}).  VM will ask you for the name of the file, 
1789 its type, a brief description and its character set if it is a
1790 text attachment.  The attachment will be represented in the
1791 composition as a tag line like this
1792
1793   [ATTACHMENT ~/sounds/chronophasia_scream.au, audio/basic]
1794
1795 You can type text before and after this tag and it will appear
1796 before or after the text in the final MIME message when VM encodes
1797 it.  You can kill the tag with @kbd{C-k} and yank it back with
1798 @kbd{C-y} to move it to another place in the message.  You can
1799 yank back the tag multiple times to duplicate the attachment in
1800 the message.  Or you can leave the tag killed and the attachment
1801 won't appear in the message when it is sent.
1802
1803 If you click the right mouse button on the attachment tag, a menu
1804 will appear that allows you to change the content disposition of
1805 the attachment.  The @dfn{content disposition} of a MIME object
1806 gives a mail reader a hint as to whether an object should be
1807 displayed inline or as an inert tag or button that you must
1808 activate in some fashion.  @dfn{Inline} display usually means
1809 that the object will be display within or alongside the message
1810 text, if that is possible.  @dfn{Attachment}, when used as a
1811 content disposition, means that the object will likely be
1812 displayed as a tag.  By default, VM specifies an inline
1813 disposition for all MIME types except @samp{application} and
1814 @samp{model} types.
1815
1816 @kindex C-c C-b
1817 To attach a buffer instead of a file, use @kbd{C-c C-b} (normally 
1818 bound to @code{vm-mime-attach-buffer}.  You must not kill the
1819 buffer that you attach until after the message has been sent.
1820
1821 @kindex C-c C-p
1822 To preview what a MIME message will look like to a recipient,
1823 use @kbd{C-c C-p} (@code{vm-mime-preview-composition}).  VM
1824 will encode a copy of the message and present it to you in a
1825 temporary mail folder.  You can scroll through the message
1826 using normal VM mail reading commands.  Typing @kbd{q} in this
1827 folder will return you to your composition where you can make
1828 further changes.
1829
1830 @kindex C-c C-e
1831 To encode a MIME message without sending it, use @kbd{C-c C-e}
1832 (@code{vm-mime-encode-composition}).  This is useful if you use
1833 PGP and want to sign a message before sending it.  VM will encode
1834 the message for transport, inserting all necessary headers and
1835 boundary markers.  You can then sign the message and send it with
1836 C-c C-c and be confident that VM won't invalidate the signature
1837 by making further modifications to the message.  Or if you want
1838 to resume editing the message you can run the Emacs @code{undo}
1839 (normally bound to @kbd{C-x u}) command which will revert the
1840 encoded MIME bodies back to tags and you can continue entering
1841 your composition.
1842
1843 @vindex vm-mime-7bit-composition-charset
1844 By default, when you type text into a composition buffer VM
1845 assumes that if all the character codes are less than 128, you
1846 are using the US-ASCII character set and that is the character
1847 set declared in the encoding of the message when it is sent.  If
1848 you are using some other character set, you must specify it by
1849 setting the variable @code{vm-mime-7bit-composition-charset}.  The
1850 value of this variable should be a string specifying the character
1851 set.
1852
1853 @vindex vm-mime-8bit-composition-charset
1854 If there are character codes in the composition greater than 128, the
1855 variable @code{vm-mime-8bit-composition-charset} tells VM what character 
1856 set to assume when encoding the message.  The default is
1857 @samp{iso-8859-1}.
1858
1859 Character codes greater than 128 may not be transported reliably
1860 across the Internet in mail messages.  Some machines will refuse
1861 to accept messages containing such characters and some will accept
1862 them but zero the eighth bit, garbling the message.  To avoid
1863 these problems, VM transfer encodes 8-bit text by default.
1864
1865 MIME has two transfer encodings that convert 8-bit data to 7-bit data
1866 for safe transport.  @dfn{Quoted-printable} leaves the text mostly
1867 readable even if the recipient does not have a MIME-capable mail
1868 reader.  @dfn{BASE64} is unreadable without a MIME-capable mail
1869 reader.
1870
1871 @vindex vm-mime-8bit-text-transfer-encoding
1872 VM's text transfer encoding behavior is controlled by the
1873 variable @code{vm-mime-8bit-text-transfer-encoding}.  Its value should
1874 be a symbol that specifies what kind of transfer encoding to do
1875 for 8-bit text.  A value of @samp{quoted-printable}, means to use
1876 quoted-printable encoding.  A value of @samp{base64} means to use
1877 BASE64 encoding.  A value of @samp{8bit} means to send the message as
1878 is.  Note that this variable usually only applies to textual MIME
1879 content types.  Images, audio, video, etc. typically will have
1880 some attribute that makes VM consider them to be ``binary'',
1881 which moves them outside the scope of this variable.  For
1882 example, messages with line lengths of 1000 characters or more
1883 are considered binary, as are messages that contain carriage
1884 returns (ASCII code 13) or NULs (ASCII code 0).
1885
1886 @node Replying, Forwarding Messages, MIME Composition, Sending Messages
1887 @section Replying
1888
1889 @vindex vm-reply-subject-prefix
1890 VM has special commands that make it easy to reply to a message.  When a
1891 reply command is invoked, VM fills in the subject and recipient headers
1892 for you, since it is apparent to whom the message should be sent and
1893 what the subject should be.  There is an old convention of prepending
1894 the string @samp{``Re: ''} to the subject of replies if the string isn't
1895 present already.  VM supports this indirectly by providing the variable
1896 @code{vm-reply-subject-prefix}.  Its value should be a string to prepend
1897 to the subject of replies, if the string isn't present already.  A
1898 @code{nil} value means don't prepend anything to the subject (this is
1899 the default).  In any case you can edit any of the message headers
1900 manually, if you wish.
1901
1902 @vindex vm-included-text-prefix
1903 VM also helps you quote material from a message to which you are
1904 replying by providing @dfn{included text} as a feature of some of the
1905 commands.  @dfn{Included text} is a copy of the message being replied to with
1906 some fixed string prepended to each line so that included text can be
1907 distinguished from the text of the reply.  The variable
1908 @code{vm-included-text-prefix} specifies what the prepended string will
1909 be.
1910
1911 @vindex vm-included-text-attribution-format
1912 The variable @code{vm-included-text-attribution-format} specifies the
1913 format for the attribution of included text.  This attribution is a line
1914 of text that tells who wrote the text that is to be included; it will be
1915 inserted before the included text.  If non-@code{nil}, the value of
1916 @code{vm-included-text-attribution-format} should be a string format
1917 specification similar to @code{vm-summary-format}.  @xref{Summaries}.  A
1918 @code{nil} value causes the attribution to be omitted.
1919
1920 @vindex vm-in-reply-to-format
1921 The variable @code{vm-in-reply-to-format} specifies the format of the
1922 In-Reply-To header that is inserted into the header section of the reply
1923 buffer.  Like @code{vm-included-text-attribution-format},
1924 @code{vm-in-reply-to-format} should be a string similar to that of
1925 @code{vm-summary-format}.  A @code{nil} value causes the In-Reply-To
1926 header to be omitted.
1927
1928 @vindex vm-strip-reply-headers
1929 The recipient headers generated for reply messages are created by
1930 copying the appropriate headers from the message to which you are
1931 replying.  This includes any full name information, comments, etc. in
1932 these headers.  If the variable @code{vm-strip-reply-headers} is
1933 non-@code{nil}, the recipient headers will be stripped of all information
1934 except the actual addresses.
1935
1936 The reply commands are:
1937
1938 @table @kbd
1939 @findex vm-reply
1940 @kindex r
1941 @item r (@code{vm-reply})
1942 Replies to the author of the current message.
1943 @findex vm-reply-include-text
1944 @kindex R
1945 @item R (@code{vm-reply-include-text})
1946 Replies to the author of the current message and provides included text.
1947 @findex vm-followup
1948 @kindex f
1949 @item f (@code{vm-followup})
1950 Replies to the all recipients of the current message.
1951 @findex vm-followup-include-text
1952 @kindex F
1953 @item F (@code{vm-followup-include-text})
1954 Replies to the all recipients of the current message and provides
1955 included text.
1956 @end table
1957
1958 These commands all accept a numeric prefix argument @var{n}, which if
1959 present, causes VM to reply to the next (or previous if the argument is
1960 negative) @var{n-1} messages as well as the current message.  Also, all
1961 the reply commands set the ``replied'' attribute of the messages to
1962 which you are responding, but only when the reply is actually sent.  The
1963 reply commands can also be applied to marked messages,
1964 @pxref{Message Marks}.
1965
1966 @vindex vm-reply-ignored-addresses
1967 If you are one of multiple recipients of a message and you use @kbd{f}
1968 and @kbd{F}, your address will be included in the recipients of the
1969 reply.  You can avoid this by judicious use of the variable
1970 @code{vm-reply-ignored-addresses}.  Its value should be a list of
1971 regular expressions that match addresses that VM should automatically
1972 remove from the recipient headers of replies.
1973
1974 @node Forwarding Messages,, Replying, Sending Messages
1975 @section Forwarding Messages
1976
1977 VM has three commands to forward messages: @kbd{z}
1978 (@code{vm-forward-message}), @key{@@} (@code{vm-send-digest}) and
1979 @kbd{B} (@code{vm-resend-message}).
1980
1981 @findex vm-forward-message
1982 @kindex z
1983 @vindex vm-forwarding-digest-type
1984 @vindex vm-forwarding-subject-format
1985 Typing @kbd{z} puts you into a VM Mail mode buffer just like @kbd{m},
1986 except the current message appears as the body of the message in the VM
1987 Mail mode buffer. The forwarded message encapsulated as specified by the
1988 variable @code{vm-forwarding-digest-type}.  Recognized values are
1989 @samp{"rfc934"}, @samp{"rfc1153"} and @samp{"mime"}.  If the variable
1990 @code{vm-forwarding-subject-format} is non-@code{nil} it should specify
1991 the format of the Subject header of the forwarded message.  A @code{nil}
1992 value causes the Subject header to be left blank.  The forwarded message
1993 is flagged ``forwarded'' when the message is sent.
1994 @findex vm-send-digest
1995 @vindex vm-digest-send-type
1996 @kindex @@
1997 The command @key{@@} (@code{vm-send-digest}) works like @kbd{z} except
1998 that a digest of all the messages in the current folder is made and
1999 inserted into the VM Mail mode buffer.  Also, @code{vm-send-digest} can
2000 be applied to just marked messages.  @xref{Message Marks}.  When applied
2001 to marked messages, @code{vm-send-digest} will only bundle marked
2002 messages, as opposed to the usual bundling of all messages in the
2003 current folder.  The message encapsulation method is specified by the
2004 variable @code{vm-digest-send-type}, which accepts the same values as
2005 @code{vm-forwarding-digest-type}.  All the messages included in the digest will
2006 be flagged ``forwarded'' when the digest message is sent.
2007
2008 @vindex vm-digest-preamble-format
2009 @vindex vm-digest-center-preamble
2010 If you give @code{vm-send-digest} a prefix argument, VM will insert a
2011 list of preamble lines at the beginning of the digest, one line per
2012 digestified message.  The variable @code{vm-digest-preamble-format}
2013 determines the format of the preamble lines.  If the value of
2014 @code{vm-digest-center-preamble} is non-@code{nil}, the preamble lines
2015 will be centered.
2016
2017 @findex vm-resend-message
2018 @kindex B
2019 If you wish to forward a message and want to send it without the
2020 encapsulation used by @code{vm-forward-message}, use @kbd{B}
2021 (@code{vm-resend-message}).  Instead of encapsulating the message, VM
2022 will use essentially the same message and headers and add a Resent-To
2023 header that you should fill in with the new recipients.  Use @kbd{C-c
2024 C-c} as usual to send the message.  The resent message will be flagged
2025 as ``redistributed''.
2026
2027 @node Saving Messages, Deleting Messages, Sending Messages, Top
2028 @chapter Saving Messages
2029
2030 Mail messages are normally saved to files that contain only mail
2031 messages.  Such files are called @dfn{folders}.  Folders are
2032 distinguished from spool files in that VM does not expect other
2033 programs to modify them while VM is visiting them.  This is
2034 important to remember.  VM does no locking of folders when
2035 visiting them.  If the disk copy of a folder is modified behind
2036 VM's back, Emacs will complain with the dreaded ``File changed
2037 on disk'' message when you try to save the folder.
2038
2039 @findex vm-save-message
2040 @kindex s
2041 The VM command to save a message to a folder is @kbd{s}
2042 (@code{vm-save-message}); invoking this command causes the current
2043 message to be saved to a folder whose name you specify in the
2044 minibuffer.  If @code{vm-save-message} is given a prefix argument
2045 @var{n}, the current message plus the next @var{n-1} messages are saved.
2046 If @var{n} is negative, the current message and the previous @var{n-1}
2047 messages are saved.  Messages saved with @code{vm-save-message} are
2048 flagged ``filed''.
2049
2050 @vindex vm-confirm-new-folders
2051 If the value of the variable @code{vm-confirm-new-folders} is
2052 non-@code{nil}, VM will ask for confirmation before creating a new
2053 folder on interactive saves.
2054
2055 @vindex vm-folder-directory
2056 If you have a directory where you keep all your mail folders, you should
2057 set the variable @code{vm-folder-directory} to point to it.  If this
2058 variable is set, @code{vm-save-message} will insert this directory name
2059 into the minibuffer before prompting you for a folder name; this will save
2060 you some typing. The default value of @code{vm-folder-directory} is 
2061 @code{~/Mail}.
2062
2063 @vindex vm-auto-folder-alist
2064 Another aid to selecting folders in which to save mail is the variable
2065 @code{vm-auto-folder-alist}.  The value of this variable should be a
2066 list of the form:
2067
2068 @display
2069 ((@var{header-name}
2070    (@var{regexp} . @var{folder-name}) ...)
2071   ...)
2072 @end display
2073
2074 where @var{header-name} and @var{regexp} are strings, and
2075 @var{folder-name} is a string or an s-expression that evaluates to a
2076 string.
2077
2078 If any part of the contents of the message header named by
2079 @var{header-name} is matched by the regular expression
2080 @var{regexp}, VM will evaluate the corresponding
2081 @var{folder-name} and use the result as the default when
2082 prompting for a folder to save the message in.  If the resulting
2083 folder name is a relative pathname it resolves to the directory
2084 named by @code{vm-folder-directory}, or the
2085 @code{default-directory} of the currently visited folder if
2086 @code{vm-folder-directory} is @code{nil}.
2087
2088 When @var{folder-name} is evaluated, the current buffer will contain only
2089 the contents of the header named by @var{header-name}.  It is safe to
2090 modify this buffer.  You can use the match data from any @samp{\( @dots{}
2091 \)} grouping constructs in @var{regexp} along with the function
2092 @code{buffer-substring} to build a folder name based on the header information.
2093 If the result of evaluating @var{folder-name} is a list, then the list will
2094 be treated as another auto-folder-alist and will be descended
2095 recursively.
2096
2097 @vindex vm-auto-folder-case-fold-search
2098 Whether matching is case sensitive depends on the value of the variable
2099 @code{vm-auto-folder-case-fold-search}.  A non-@code{nil} value makes
2100 matching case insensitive.  The default value is @code{t}, which means
2101 matching is case insensitive.  Note that the matching of header names is
2102 always case insensitive because the Internet message standard RFC 822
2103 specifies that header names are case indistinct.
2104
2105 @vindex vm-visit-when-saving
2106 VM can save messages to a folder in two distinct ways.  The message can be
2107 appended directly to the folder on disk, or the folder can be visited as
2108 Emacs would visit any other file and the message appended to that
2109 buffer.  In the latter method you must save the buffer yourself to change
2110 the on-disk copy of the folder.  The variable @code{vm-visit-when-saving}
2111 controls which method is used.  A value of @code{t} causes VM to always
2112 visit a folder before saving message to it.  A @code{nil} value causes VM
2113 to always append directly to the folder file.  In this case VM will not
2114 save messages to the disk copy of a folder that is being visited.  This
2115 restriction is necessary to insure that the buffer and on-disk copies of
2116 the folder are consistent. If the value of @var{vm-visit-when-saving} is
2117 not @code{nil} and not @code{t} (e.g. 0, the default), VM will append to
2118 the folder's buffer if the buffer is currently being visited, otherwise VM
2119 will append to the file itself.
2120
2121 @vindex vm-delete-after-saving
2122 @vindex vm-delete-after-archiving
2123 After a message is saved to a folder, the usual thing to do next is to
2124 delete it.  If the variable @code{vm-delete-after-saving} is
2125 non-@code{nil}, VM will flag messages for deletion automatically after
2126 saving them.  This applies only to saves to folders, not for the @kbd{w}
2127 or @kbd{A} commands (see below).  The variable @code{vm-delete-after-archiving}
2128 works like @code{vm-delete-after-saving} but applies to the @kbd{A}
2129 (@code{vm-auto-archive-messages}) command instead.
2130
2131 Other commands:
2132
2133 @table @kbd
2134 @findex vm-save-message-sans-headers
2135 @kindex w
2136 @item w (@code{vm-save-message-sans-headers})
2137 Saves a message or messages to a file without their headers.  This
2138 command responds to a prefix argument exactly as @code{vm-save-message}
2139 does.  Messages saved this way are flagged ``written''.
2140 @findex vm-auto-archive-messages
2141 @kindex A
2142 @item A (@code{vm-auto-archive-messages})
2143 Save all unfiled messages that auto-match a folder via
2144 @code{vm-auto-folder-alist} to their appropriate folders.  Messages that
2145 are flagged for deletion are not saved by this command.  If invoked with a
2146 prefix argument, confirmation will be requested for each save.
2147 @findex vm-pipe-message-to-command
2148 @kindex |
2149 @item | (@code{vm-pipe-message-to-command})
2150 Runs a shell command with some or all of the current message as input.
2151 By default, the entire message is used.@*
2152 @*
2153 If invoked with one @t{C-u} the text portion of the message is used.@*
2154 If invoked with two @t{C-u}'s the header portion of the message is used.@*
2155 @*
2156 If the shell command generates any output, it is displayed in a
2157 @samp{*Shell Command Output*} buffer.  The message itself is not altered.
2158 @end table
2159
2160 @vindex vm-berkeley-mail-compatibility
2161 A non-@code{nil} value of @var{vm-berkeley-mail-compatibility}
2162 means to read and write BSD @i{Mail(1)} style Status: headers.
2163 This makes sense if you plan to use VM to read mail archives
2164 created by @i{Mail}.
2165
2166 @node Deleting Messages, Editing Messages, Saving Messages, Top
2167 @chapter Deleting Messages
2168
2169 In VM, messages are flagged for deletion, and then are subsequently
2170 @dfn{expunged} or removed from the folder.  The messages are not removed
2171 from the on-disk copy of the folder until the folder is saved.
2172
2173 @table @kbd
2174 @findex vm-delete-message
2175 @kindex d
2176 @item d (@code{vm-delete-message})
2177 Flags the current message for deletion.  A prefix argument @var{n}
2178 causes the current message and the next @var{n-1} messages to be flagged.
2179 A negative @var{n} causes the current message and the previous @var{n-1}
2180 messages to be flagged.
2181 @findex vm-undelete-message
2182 @kindex u
2183 @item u (@code{vm-undelete-message})
2184 Removes the deletion flag from the current message.  A prefix argument @var{n}
2185 causes the current message and the next @var{n-1} messages to be undeleted.
2186 A negative @var{n} causes the current message and the previous @var{n-1}
2187 messages to be undeleted.
2188 @findex vm-kill-subject
2189 @kindex k
2190 @item k (@code{vm-kill-subject})
2191 Flags all messages with the same subject as the current message (ignoring
2192 ``Re:'') for deletion.
2193 @findex vm-expunge-folder
2194 @kindex ###
2195 @item ### (@code{vm-expunge-folder})
2196 Does the actual removal of messages flagged for deletion in the current
2197 folder.
2198 @end table
2199
2200 @vindex vm-move-after-deleting
2201 @vindex vm-move-after-killing
2202 @vindex vm-move-after-undeleting
2203 Setting the variable @code{vm-move-after-deleting} non-@code{nil} causes
2204 VM to move past the messages after flagging them for deletion.  Setting
2205 @code{vm-move-after-undeleting} non-@code{nil} causes similar movement
2206 after undeletes.  Setting @code{vm-move-after-killing} non-@code{nil}
2207 causes VM to move after killing messages with @code{vm-kill-subject}.
2208 Note that the movement is done by calling @code{vm-next-message} which
2209 means that the value of @code{vm-circular-folders} applies to the
2210 post-command motion as for a motion command, not as for a non-motion
2211 command.
2212
2213 @node Editing Messages, Message Marks, Deleting Messages, Top
2214 @chapter Editing Messages
2215
2216 To edit a message, type @kbd{e} (@code{vm-edit-message}).  The current
2217 message is copied into a temporary buffer, and this buffer is selected
2218 for editing.  The major mode of this buffer is controlled by the
2219 variable @code{vm-edit-message-mode}.  The default is Text mode.
2220
2221 Use @kbd{C-c ESC} (@code{vm-edit-message-end}) when you have finished
2222 editing the message.  The message will be inserted into its folder,
2223 replacing the old version of the message.  If you want to quit the edit
2224 without your edited version replacing the original, use @kbd{C-c C-]}
2225 (@code{vm-edit-message-abort}), or you can just kill the edit buffer
2226 with @kbd{C-x k} (@code{kill-buffer}).
2227
2228 If you give a prefix argument to @code{vm-edit-message}, then the
2229 current message will be flagged unedited.
2230
2231 As with VM Mail mode buffers, all VM commands can be accessed from
2232 the edit buffer through the command prefix @kbd{C-c C-v}.
2233
2234 @node Message Marks, Message Attributes, Editing Messages, Top
2235 @chapter Message Marks
2236
2237 VM provides general purpose @dfn{marks} that may be applied to any and
2238 all messages within a given folder.  Certain VM commands can be
2239 subsequently invoked only on those messages that are marked.
2240
2241 To mark the current message, type @kbd{M M}
2242 (@code{vm-mark-message}).  If you give a numeric prefix argument
2243 @var{n}, the next @var{n-1} messages will be marked as well.  A negative
2244 prefix argument means mark the previous @var{n-1}.  An asterisk
2245 (@samp{*}) will appear to the right of the message numbers of all marked
2246 messages in the summary window.
2247
2248 To remove a mark from the current message, use @kbd{M U}
2249 (@code{vm-unmark-message}).  Prefix arguments work as with
2250 @code{vm-mark-message}.
2251
2252 Use @kbd{M m} to mark all messages in the current folder; @kbd{M u}
2253 removes marks from all messages.
2254
2255 Other marking commands:
2256
2257 @table @kbd
2258 @findex vm-mark-matching-messages
2259 @kindex M C
2260 @item M C (@code{vm-mark-matching-messages})
2261 Mark all messages matched by a virtual folder selector.
2262 @xref{Virtual Folders}.
2263 @findex vm-unmark-matching-messages
2264 @kindex M c
2265 @item M c (@code{vm-unmark-matching-messages})
2266 Unmark all messages matched by a virtual folder selector.
2267 @findex vm-mark-thread-subtree
2268 @kindex M T
2269 @item M T (@code{vm-mark-thread-subtree})
2270 Mark all messages in the thread tree rooted at current message.
2271 @xref{Threading}.
2272 @findex vm-unmark-thread-subtree
2273 @kindex M t
2274 @item M t (@code{vm-unmark-thread-subtree})
2275 Unmark all messages in the thread tree rooted at current message.
2276 @findex vm-mark-messages-same-subject
2277 @kindex M S
2278 @item M S (@code{vm-mark-same-subject})
2279 Mark messages with the same subject as the current message.
2280 @findex vm-unmark-messages-same-subject
2281 @kindex M s
2282 @item M s (@code{vm-unmark-same-subject})
2283 Unmark messages with the same subject as the current message.
2284 @findex vm-mark-messages-same-author
2285 @kindex M A
2286 @item M A (@code{vm-mark-same-author})
2287 Mark messages with the same author as the current message.
2288 @findex vm-unmark-messages-same-author
2289 @kindex M a
2290 @item M a (@code{vm-unmark-same-author})
2291 Unmark messages with the same author as the current message.
2292 @end table
2293
2294 To apply a VM command to all marked messages you must prefix it with the
2295 key sequence @kbd{M N} (@code{vm-next-command-uses-marks}).  The next VM
2296 command will apply to all marked messages, provided the command can be
2297 applied to such messages in a meaningful and useful way.
2298
2299 @node Message Attributes, Sorting Messages, Message Marks, Top
2300 @chapter Message Attributes
2301
2302 Each message in a folder has a set of attributes that VM will remember
2303 from session to session.  Various VM commands set and unset these
2304 attributes.  Here are the attributes maintained by VM.
2305
2306 @table @code
2307 @item new
2308 The message was retrieved from a spool file during this
2309 visit of the current folder.
2310 @item unread
2311 The message was retrieved from a spool file during some
2312 past visit of the folder but is still unread.
2313 @item filed
2314 The message has been saved to some folder.
2315 @item written
2316 The body of the message has been saved to a file.
2317 @item edited
2318 The message has been altered (with @code{vm-edit-message}) since it arrived.
2319 @item deleted
2320 The message is deleted and will be removed from the folder
2321 at the next expunge.
2322 @item forwarded
2323 The message has been forwarded with either
2324 @code{vm-forward-message} or @code{vm-send-digest}.
2325 @item redistributed
2326 The message has been forwarded with the
2327 @code{vm-resend-message} command.
2328 @item replied
2329 The message has been replied to.
2330 @end table
2331
2332 You can set and unset these attributes directly by using @kbd{a}
2333 (@code{vm-set-message-attributes}).  You will be prompted in the
2334 minibuffer for names of the attributes and you can enter them with
2335 completion.  Every attribute has an ``un-'' prefixed name you can use
2336 to unset the attribute, excepting ``new'' and ``unread'', which are both
2337 negated by ``read''.  You can use a prefix argument with this command to
2338 affect multiple messages, and you can apply this command to marked
2339 messages with @kbd{M N}.
2340
2341 @findex vm-undo
2342 @kindex C-x u
2343 @kindex C-_
2344 @cindex undo
2345 VM provides a special form of undo which allows changes to message
2346 attributes to be undone.  Typing @kbd{C-x u} or @key{C-_}
2347 (@code{vm-undo}) undoes the last attribute change.  Consecutive
2348 @code{vm-undo}'s undo further and further back.  Any intervening command
2349 breaks the undo chain, after which the undo's themselves become undoable
2350 by subsequent invocations of @code{vm-undo}.
2351
2352 Note that expunges, saves and message edits are @emph{not} undoable.
2353
2354 @findex vm-add-message-labels
2355 @findex vm-delete-message-labels
2356 @kindex l a
2357 @kindex l d
2358 @cindex labels
2359 @dfn{Labels} are user-defined message attributes.  They can have any
2360 name and be assigned any meaning by you.  Labels are added with
2361 @kbd{l a} (@code{vm-add-message-labels} and @kbd{l e}
2362 (@code{vm-add-existing-message-labels}, and are removed by @kbd{l d}
2363 (@code{vm-delete-message-labels}).  BABYL format folders use labels to
2364 store basic attributed like ``deleted'' and ``unread''.  When visiting a
2365 BABYL folder VM uses these labels also in order to be compatible with
2366 other BABYL mailers.  The labels used are ``recent'', ``unseen'',
2367 ``deleted'', ``answered'', ``forwarded'', ``redistributed'', ``filed'',
2368 ``edited'' and ``written''.  If (and only if) you are using BABYL format
2369 folders, you should not use these label names for your own purposes.
2370
2371 @vindex vm-flush-interval
2372 All message attributes are stored in the folder.  In order for
2373 attribute changes to be saved to disk, they must be written to
2374 the folder's buffer prior to the buffer being saved.  The
2375 variable @code{vm-flush-interval} controls how often that is done.  A
2376 value of @code{t} means write the new attributes to the folder
2377 buffer whenever a change occurs.  A value of @code{nil} means
2378 wait until just before the folder is saved before writing out the
2379 attributes.  VM will work faster with this setting, but if Emacs
2380 or your system crashes, the autosave file will contain no useful
2381 data pertaining to message attribute changes.  The autosave file
2382 will still reflect message edits and expunges.  @xref{Crash
2383 Recovery}.  A positive integer value @var{n} instructs VM to write
2384 out attribute changes every @var{n} seconds.  The default value
2385 of this variable is @code{t}.
2386
2387 @node Sorting Messages, Reading Digests, Message Attributes, Top
2388 @chapter Sorting Messages
2389
2390 @cindex sorting
2391 @findex vm-sort-messages
2392 @vindex vm-move-messages-physically
2393 @kindex G
2394 In order to make numerous related messages easier to cope with, VM
2395 provides the command @kbd{G} (@code{vm-sort-messages}), which sorts
2396 all messages in a folder using one or more sort keys.
2397 By default the actual order of the messages in the folder is not
2398 altered; that is, if you looked at the folder file outside of VM the
2399 message order would be unchanged.  VM numbers and presents the messages
2400 in a different order internally.  If you want the message order to be
2401 changed in the folder so that other programs can see the change, you
2402 can either invoke @code{vm-sort-messages} with a prefix argument, or
2403 you can set @code{vm-move-messages-physically} non-@code{nil} before
2404 sorting.  Either way, VM will shift the actual messages around in the
2405 folder buffer, and when you save the folder, the order change will be
2406 visible to other programs.
2407
2408 Valid sort keys are: ``date'', ``reversed-date'', ``author'',
2409 ``reversed-author'', ``subject'', ``reversed-subject'', ``recipients'',
2410 ``reversed-recipients'', ``line-count'', ``reversed-line-count'',
2411 ``byte-count'', ``reversed-byte-count'', ``physical-order'', and
2412 ``reversed-physical-order''.
2413
2414 @vindex vm-subject-ignored-prefix
2415 @vindex vm-subject-ignored-suffix
2416 When sorting by subject (or threading using subjects, or killing
2417 messages by subject) the subject of the message is
2418 @dfn{normalized} before comparisons are done.  A @dfn{normalized}
2419 subject has uninteresting prefixes and suffixes stripped off, and
2420 multiple consecutive whitespace characters are collapsed to a single
2421 space.  The variable @code{vm-subject-ignored-prefix} should be
2422 a regular expression that matches all strings at the beginning of
2423 a subject that you do not want to be considered when message
2424 subjects are compared.  A @code{nil} value means VM should not ignore
2425 any prefixes.  The analogous variable for subject suffixes is
2426 @code{vm-subject-ignored-suffix}.
2427
2428 @vindex vm-subject-significant-chars
2429 Once the subject has been normalized, the variable
2430 @code{vm-subject-significant-chars} controls how much of what
2431 remains is considered significant for matching purposes.  The
2432 first @code{vm-subject-significant-chars} will be considered
2433 significant.  Characters beyond this point in the subject string
2434 will be ignored.  A @code{nil} value for this variable means all
2435 characters in the subject are significant.
2436
2437 If you want to move messages around by hand, use @kbd{C-M-n}
2438 (@code{vm-move-message-forward}) and @kbd{C-M-p}
2439 (@code{vm-move-message-backward}).  The default is to move the current
2440 message forward or backward by one message in the message list.  A
2441 prefix argument @var{n} can specify a longer move.  The value of
2442 @code{vm-move-messages-physically} applies to these commands.
2443
2444 @menu
2445 * Threading::   Using subjects and message IDs to group messages.
2446 @end menu
2447
2448 @node Threading,,, Sorting Messages
2449 @section Threading
2450 @cindex threading
2451 A @dfn{thread} is a group of messages that are either related by subject
2452 or that have a common ancestor.  @dfn{Threading} is the process of
2453 determining the relationship between such messages and displaying them so
2454 that those relationships are evident.
2455
2456 @findex vm-toggle-threads-display
2457 @vindex vm-summary-thread-indent-level
2458 To enable and disable threading, type @kbd{C-t}
2459 (@code{vm-toggle-threads-display}.  In the summary buffer related
2460 messages are grouped together and the subject part of the summary
2461 listings of messages are indented to show hierarchical relationships.
2462 Parent messages are displayed before their children and children are
2463 indented a default two spaces to the right for each level of descendence
2464 from their ancestors.  The amount of indentation per level is controlled by the
2465 variable @code{vm-summary-thread-indent-level}.
2466
2467 @vindex vm-thread-using-subject
2468 Message relationships are discovered by examining References,
2469 In-Reply-To, and Subject headers.  The first two headers are more
2470 reliable sources of information but not all mailers provide them.
2471 If you don't want VM to use Subject headers, set the variable
2472 @code{vm-thread-using-subject} to @code{nil}.
2473
2474 If you want VM to always display messages using threads, you should set
2475 the default value of the variable @code{vm-summary-show-threads}
2476 non-@code{nil} in your VM init file.  Exmaple:
2477
2478 @example
2479 (setq-default vm-summary-show-threads t)
2480 @end example
2481
2482 Do not use @code{setq}, as this will only set the value of the variable in
2483 a single buffer.  Once you've started VM you should not change the value
2484 of this variable.  Rather you should use @kbd{C-t} to control the thread
2485 display.
2486
2487 Note that threading is really a specialized form of sorting, and so the
2488 value of the variable @code{vm-move-messages-physically} applies.
2489
2490 @node Reading Digests, Summaries, Sorting Messages, Top
2491 @chapter Reading Digests
2492
2493 A @dfn{digest} is one or more mail messages encapsulated within another
2494 message.
2495
2496 VM supports digests by providing a command to ``burst'' them into their
2497 individual messages.  These messages can then be handled like any other
2498 messages under VM.
2499
2500 @findex vm-burst-digest
2501 @kindex *
2502 The command @kbd{*} (@code{vm-burst-digest}) bursts a digest into its
2503 individual messages and appends them to the current folder.  These
2504 messages are then assimilated into the current folder as new messages.
2505 The original digest message is not altered, and the messages extracted
2506 from it are not part of the on-disk copy of the folder until a save is
2507 done.  You will be prompted for the type of digest to burst.  VM
2508 understands three formats, ``rfc934'', ``rfc1154'' and ``mime''.  If you
2509 don't know what kind of digest you've received, type ``guess'' and VM
2510 will try to figure out the digest type on its own.  VM is pretty smart
2511 about digests and will usually make the correct choice if the digest is
2512 properly formatted.
2513
2514 @node Summaries, Virtual Folders, Reading Digests, Top
2515 @chapter Summaries
2516
2517 @findex vm-summarize
2518 @vindex vm-auto-center-summary
2519 @vindex vm-summary-arrow
2520 @kindex h
2521 Typing @kbd{h} (@code{vm-summarize}) causes VM to display a summary of
2522 contents of the current folder.  The information in the summary is
2523 automatically updated as changes are made to the current folder.  An
2524 arrow @samp{->} appears to the left of the line summarizing the current
2525 message.  The variable @code{vm-auto-center-summary} controls whether VM
2526 will keep the summary arrow vertically centered within the summary
2527 window.  A value of @code{t} causes VM to always keep the arrow
2528 centered.  A value of @code{nil} (the default) means VM will never
2529 bother centering the arrow.  A value that is not @code{nil} and not
2530 @code{t} causes VM to center the arrow only if the summary window is not
2531 the only existing window.  You can change what the summary arrow looks
2532 like by setting vm-summary-arrow to a string depicting the new arrow.
2533 You should set this variable before VM creates the summary buffer.
2534
2535 @vindex vm-summary-format
2536 The variable @code{vm-summary-format} controls the format of each
2537 message's summary.  Its value should be a string.  This string should
2538 contain printf-like ``%'' conversion specifiers which substitute
2539 information about the message into the final summary.
2540
2541 Recognized specifiers are:
2542 @table @code
2543 @item a
2544 attribute indicators (always four characters wide)
2545 @*
2546 The first char is  `D', `N', `U' or ` ' for deleted, new, unread
2547 and read messages respectively.
2548 @*
2549 The second char is `F', `W' or ` ' for filed (saved) or written
2550 messages.
2551 @*
2552 The third char is `R', `Z' or ` ' for messages replied to,
2553 and forwarded messages.
2554 @*
2555 The fourth char is `E' if the message has been edited, ` ' otherwise.
2556 @item A
2557 longer version of attributes indicators (seven characters
2558 wide).@*
2559 @*
2560 The first char is  `D', `N', `U' or ` ' for deleted, new, unread
2561 and read messages respectively.
2562 @*
2563 The second is `r' or ` ', for message replied to.
2564 @*
2565 The third is `z' or ` ', for messages forwarded.
2566 @*
2567 The fourth is `b' or ` ', for messages redistributed.
2568 @*
2569 The fifth is `f' or ` ', for messages filed.
2570 @*
2571 The sixth is `w' or ` ', for messages written.
2572 @*
2573 The seventh is `e' or ` ', for messages that have been edited.
2574 @item c
2575 number of characters in message (ignoring headers)
2576 @item d
2577 numeric day of month message sent
2578 @item f
2579 author's address
2580 @item F
2581 author's full name (same as f if full name not found)
2582 @item h
2583 hour:min:sec message sent
2584 @item H
2585 hour:min message sent
2586 @item i
2587 message ID
2588 @item I
2589 thread indentation
2590 @item l
2591 number of lines in message (ignoring headers)
2592 @item L
2593 labels (as a comma list)
2594 @item m
2595 month message sent
2596 @item M
2597 numeric month message sent (January = 1)
2598 @item n
2599 message number
2600 @item s
2601 message subject
2602 @item t
2603 addresses of the recipients of the message, in a comma-separated list
2604 @item T
2605 full names of the recipients of the message, in a comma-separated list
2606 If a full name cannot be found, the corresponding address is used
2607 instead.
2608 @item U
2609 user defined specifier.  The next character in the format
2610 string should be a letter.  VM will call the function
2611 vm-summary-function-<letter> (e.g. vm-summary-function-A for
2612 ``%UA'') in the folder buffer with the message being summarized
2613 bracketed by (point-min) and (point-max).  The function
2614 will be passed a message struct as an argument.
2615 The function should return a string, which VM will insert into
2616 the summary as it would for information from any other summary
2617 specifier.
2618 @item w
2619 day of the week message sent
2620 @item y
2621 year message sent
2622 @item z
2623 timezone of date when the message was sent
2624 @item *
2625 `*' if the message is marked, ` ' otherwise
2626 @item (
2627 starts a group, terminated by %).  Useful for specifying
2628 the field width and precision for the concatentation of
2629 group of format specifiers.  Example: \"%.35(%I%s%)\"
2630 specifies a maximum display width of 35 characters for the
2631 concatenation of the thread indentation and the subject.
2632 @item )
2633 ends a group.
2634 @end table
2635
2636 Use ``%%'' to get a single ``%''.
2637
2638 A numeric field width may be specified between the ``%'' and the
2639 specifier; this causes right justification of the substituted string.  A
2640 negative field width causes left justification.  The field width may be
2641 followed by a ``.'' and a number specifying the maximum allowed length
2642 of the substituted string.  If the string is longer than this value, it
2643 is truncated.
2644
2645 @vindex vm-summary-uninteresting-senders
2646 @vindex vm-summary-uninteresting-senders-arrow
2647 If you save copies of all your outbound messages in a folder and
2648 later visit that folder, the @samp{%F} format specifier will normally
2649 display your own name.  If you would rather see the recipient
2650 addresses in this case, set the variable
2651 @code{vm-summary-uninteresting-senders}. This variable's value,
2652 if non-@code{nil}, should be a regular expression that matches
2653 addresses that you don't consider interesting enough to appear in
2654 the summary.  When such senders would be displayed by the @samp{%F} or
2655 @samp{%f} summary format specifiers VM will substitute the value of
2656 @code{vm-summary-uninteresting-senders-arrow} (default "To: ")
2657 followed by what would be shown by the @samp{%T} and @samp{%t} specifiers
2658 respectively.
2659
2660 The summary format need not be one line per message but it must end with
2661 a newline, otherwise the message pointer will not be displayed correctly
2662 in the summary window.
2663
2664 You can have a summary generated automatically at VM startup
2665 by setting the variable @code{vm-startup-with-summary} non-nil.
2666 @xref{Starting Up}.
2667
2668 @vindex vm-follow-summary-cursor
2669 All VM commands are available in the summary buffer just as they are in
2670 the folder buffer itself.  If you set @code{vm-follow-summary-cursor}
2671 non-@code{nil}, VM will select the message under the cursor in the
2672 summary window before executing commands that operate on the current
2673 message.  Note that this occurs @emph{only} when executing a command
2674 from the summary buffer window.
2675
2676 @vindex vm-gargle-uucp
2677 A non-@code{nil} value of @var{vm-gargle-uucp} means to use a crufty
2678 regular expression that does surprisingly well at beautifying UUCP
2679 addresses that are substituted for @samp{%f} and @samp{%t} as part
2680 of summary and attribution formats.
2681
2682 @node Virtual Folders, Frames and Windows, Summaries, Top
2683 @chapter Virtual Folders
2684
2685 A @dfn{virtual folder} is a mapping of messages from one or more
2686 real folders into a container that in most ways acts like a
2687 real folder but has no real existence outside of VM.  You can have a
2688 virtual folder that contains a subset of messages in a real folder
2689 or several real folders.  A virtual folder can also contain a
2690 subset of messages from another virtual folder.
2691
2692 A virtual folder is defined by its name, the folders that it contains
2693 and its selectors.  The variable @code{vm-virtual-folder-alist} is a list of
2694 the definitions of all named virtual folders.  In order to visit a
2695 virtual folder with the @code{vm-visit-virtual-folder} (@kbd{V V}) command,
2696 a virtual folder must have an entry in vm-virtual-folder-alist.
2697
2698 Each virtual folder definition should have the following form:
2699
2700 @example
2701 (@var{VIRTUAL-FOLDER-NAME}
2702   ( (@var{FOLDER-NAME} ...)
2703     (@var{SELECTOR} [@var{ARG} ...]) ... )
2704   ... )
2705 @end example
2706
2707 @var{VIRTUAL-FOLDER-NAME} is the name of the virtual folder being defined.
2708 This is the name by which you and VM will refer to this folder.
2709
2710 @var{FOLDER-NAME} should be the name of a real folder.  There may
2711 be more than one @var{FOLDER-NAME} listed, the @var{SELECTOR}s within
2712 that sublist will apply to them all.  If @var{FOLDER-NAME} is a
2713 directory, VM will assume this to mean that all the folders in
2714 that directory should be searched.
2715
2716 The @var{SELECTOR} is a Lisp symbol that tells VM how to
2717 decide whether a message from one of the folders specified by
2718 the @var{FOLDER-NAME}s should be included in the virtual
2719 folder.  Some @var{SELECTOR}s require an argument @var{ARG};
2720 unless otherwise noted @var{ARG} may be omitted.
2721
2722 @table @code
2723 @item author
2724 matches message if @var{ARG} matches the author; @var{ARG} should be a
2725 regular expression.
2726 @item author-or-recipient
2727 matches message if @var{ARG} matches the author of
2728 the message or any of its recipients; @var{ARG}
2729 should be a regular expression.
2730 @item and
2731 matches the message if all its argument
2732 selectors match the message.  Example:
2733 @example
2734 (and (author "Derek McGinty") (new))
2735 @end example
2736 matches all new messages from Derek McGinty.
2737 @code{and} takes any number of arguments.
2738 @item any
2739 matches any message.
2740 @item deleted
2741 matches message if it is flagged for deletion.
2742 @item edited
2743 matches message if it has been edited.
2744 @item filed
2745 matches message if it has been saved with its headers.
2746 @item forwarded
2747 matches message if it has been forwarded using
2748 a variant of @code{vm-forward-message} or @code{vm-send-digest}.
2749 @item header
2750 matches message if @var{ARG} matches any part of the header
2751 portion of the message; @var{ARG} should be a
2752 regular expression.
2753 @item header-or-text
2754 matches message if @var{ARG} matches any part of the
2755 headers or the text portion of the message;
2756 @var{ARG} should be a regular expression.
2757 @item label
2758 matches message if message has a label named @var{ARG}.
2759 @item less-chars-than
2760 matches message if message has less than @var{ARG}
2761 characters.  @var{ARG} should be a number.
2762 @item less-lines-than
2763 matches message if message has less than @var{ARG}
2764 lines.  @var{ARG} should be a number.
2765 @item more-chars-than
2766 matches message if message has more than @var{ARG}
2767 characters.  @var{ARG} should be a number.
2768 @item more-lines-than
2769 matches message if message has more than @var{ARG}
2770 lines.  @var{ARG} should be a number.
2771 @item marked
2772 matches message if it is marked, as with
2773 @code{vm-mark-message}.
2774 @item new
2775 matches message if it is new.
2776 @item not
2777 matches message only if its selector argument
2778 does NOT match the message.  Example:
2779 @example
2780 (not (deleted))
2781 @end example
2782 matches messages that are not deleted.
2783 @item or
2784 matches the message if any of its argument
2785 selectors match the message.  Example:
2786 @example
2787 (or (author "Dave Weckl") (subject "drum"))
2788 @end example
2789 matches messages from Dave Weckl or messages
2790 with the string ``drum'' in their Subject header.
2791 @code{or} takes any number of arguments.
2792 @item read
2793 matches message if it is neither new nor unread.
2794 @item recent
2795 matches message if it is new.
2796 @item recipient
2797 matches message if @var{ARG} matches any part of the recipient
2798 list of the message.  @var{ARG} should be a regular expression.
2799 @item redistributed
2800 matches message if it has been redistributed using
2801 @code{vm-resend-message}.
2802 @item replied
2803 matches message if it has been replied to.
2804 @item sent-after
2805 matches message if it was sent after the date @var{ARG}.
2806 A fully specified date looks like this:
2807 @example
2808 ``31 Dec 1999 23:59:59 GMT''
2809 @end example
2810 although the parts can appear in any order.
2811 You can leave out any part and it will
2812 default to the current date's value for that
2813 part, with the exception of the @samp{hh:mm:ss}
2814 part which defaults to midnight.
2815 @item sent-before
2816 matches message if it was sent before the date @var{ARG}.
2817 A fully specified date looks like this:
2818 @example
2819 ``31 Dec 1999 23:59:59 GMT''
2820 @end example
2821 although the parts can appear in any order.
2822 You can leave out any part and it will
2823 default to the current date's value for that
2824 part, with the exception of the hh:mm:ss
2825 part which defaults to midnight.
2826 @item subject
2827 matches message if @var{ARG} matches any part of the message's
2828 subject; @var{ARG} should be a regular expression.
2829 @item text
2830 matches message if @var{ARG} matches any part of the text
2831 portion of the message; @var{ARG} should be a
2832 regular expression.
2833 @item unanswered
2834 matches message if it has not been replied to.
2835 Same as the @code{unreplied} selector.
2836 @item undeleted
2837 matches message if it has not been deleted.
2838 @item unedited
2839 matches message if it has not been edited.
2840 @item unfiled
2841 matches message if it has not been saved with its
2842 headers.
2843 @item unforwarded
2844 matches message if it has not been forwarded using
2845 @code{vm-forward-message} or @code{vm-send-digest} or one
2846 of their variants.
2847 @item unread
2848 matches message if it is not new and hasn't been read.
2849 @item unseen
2850 matches message if it is not new and hasn't been read.
2851 Same as the @code{unread} selector.
2852 @item unredistributed
2853 matches message if it has not been redistributed using
2854 @code{vm-resend-message}.
2855 @item unreplied
2856 matches message if it has not been replied to.
2857 @item virtual-folder-member
2858 matches message if the message is already a
2859 member of some virtual folder currently
2860 being visited.
2861 @item written
2862 matches message if it has been saved without its headers.
2863 @item older-than
2864 matches message if it is atleast @var{ARG} days old
2865 @item eval
2866 matches message if evaluating the sexpr @var{ARG} yields @code{t}.
2867 @item outgoing
2868 matches message if your are the author of it, i.e. if the yuthor matches
2869 @code{vm-summary-uninteresting-senders}
2870 @item spam-score
2871 matches message if its spam score is atleast @var{ARG}.  See
2872 @code{vm-vs-spam-score-headers} for configuration.
2873 @item spam-word
2874 matches message if it contains a word from @code{vm-spam-words-file}
2875 @item folder-name
2876 matches message if it is from a folder matching @code{ARG}
2877 @item in-bbdb
2878 matches if the addresses from the message are in the BBDB. With an option
2879 first argument you might select the address class and with an optional second
2880 argument if only the first address should be checked.  
2881 @example
2882 (in-bbdb authors)
2883 @end example
2884 @example
2885 (in-bbdb recipients t)
2886 @end example
2887 @item attachment
2888 matches if a message contains an attachment resp. its text matched
2889 @code{vm-vs-attachment-regexp}
2890 @item vm-mode
2891 matches the message if in vm-mode and one of its argument
2892 selectors match the message.
2893 @item mail-mode
2894 matches the message if in mail-mode and one of its argument
2895 selectors match the message.
2896 @end table
2897
2898 Here is an example that you may find useful as a template to
2899 create virtual folder definitions.
2900
2901 @example
2902 (setq vm-virtual-folder-alist
2903    '(
2904      ;; start virtual folder definition
2905      ("virtual-folder-name"
2906       (("/path/to/folder" "/path/to/folder2")
2907        (header "foo")
2908        (header "bar")
2909       )
2910       (("/path/to/folder3" "/path/to/folder4")
2911        (and (header "baz") (header "woof"))
2912       )
2913      )
2914      ;; end of virtual folder definition
2915    )
2916 )
2917 @end example
2918
2919 Again, you visit virtual folders you have defined in
2920 @code{vm-virtual-folder-alist} with @kbd{V V}.  Once you've
2921 visited a virtual folder most VM commands work as they do in a
2922 normal folder.  There are exceptions.  If you use @kbd{S}
2923 (@code{vm-save-folder}, the folder save command will be invoked
2924 on each real folder in turn.  Similarly if you use @kbd{g}
2925 (@code{vm-get-new-mail} in a virtual folder, mail is retrieved
2926 from the spool files associated with each of the real folders.
2927 If any of the retrieved messages are matched by the virtual
2928 folder's selector, they will be added to the virtual folder.
2929
2930 These commands will signal an error when invoked if the current
2931 folder is a virtual folder:
2932
2933 @display
2934     vm-save-buffer
2935     vm-write-file
2936     vm-change-folder-type
2937     vm-expunge-imap-messages
2938     vm-expunge-pop-messages
2939 @end display
2940
2941 Normally messages in a virtual folder share attributes with the
2942 underlying real messages.  For example, if you delete a message
2943 in a virtual folder, it is also flagged as deleted in the real
2944 folder.  If you then run @code{vm-expunge-folder} in the virtual folder,
2945 the deleted message is expunged from the virtual folder and from
2946 the real folder.  Labels are shared between virtual and real
2947 messages.  However virtual folders have their own set of message
2948 marks.
2949
2950 To make virtual folders not share message attributes with real
2951 folders by default, set the variable @code{vm-virtual-mirror} to nil.
2952 This should be done in your VM init file and you should use
2953 @code{setq-default}, as this variable is automatically local to all
2954 buffers.
2955
2956 @example
2957 (setq-default vm-virtual-mirror nil)
2958 @end example
2959
2960 If you want to change whether the currently visited virtual
2961 folder shares attributes with the underlying real folders, use the 
2962 command @code{vm-toggle-virtual-mirror} (bound to @kbd{V M}).  If the
2963 virtual folder is currently sharing attributes it will no longer
2964 be.  If it is not sharing attributes with the underlying folders
2965 then it will be.
2966
2967 The command @code{vm-create-virtual-folder} (bound to @kbd{V C}) lets
2968 you interactively create a virtual folder from the messages of
2969 the current folder, using exactly one selector to choose the
2970 messages.  If you type @kbd{V C header RET pigs}, VM will create
2971 a folder containing only those messages that contain the string
2972 @samp{pigs} in the header.
2973
2974 The command @code{vm-apply-virtual-folder} (bound to @kbd{V X}) tries
2975 the selectors of a named virtual folder against the messages of
2976 the current folder and creates a virtual folder containing the
2977 matching messages.
2978
2979 The keys @kbd{V S} and @kbd{V A} invoke
2980 @code{vm-create-virtual-folder-same-subject} and
2981 @code{vm-create-virtual-folder-same-author} which create virtual folders
2982 containing all the messages in the current folder with the same
2983 subject or author as the current message.
2984
2985 The keys @kbd{V O} @code{vm-virtual-omit-message} will omit a message from the
2986 virtual folder and @kbd{V U} @code{vm-virtual-update-folders} will force an
2987 update of the virtual folder.
2988
2989 @kbd{M-x vm-virtual-check-selector-interactive} allows to test selectors
2990 interactively and will emit debug information when called with a prefix
2991 argument.
2992
2993 Automatical marking of messages for deletion based on a selector can be
2994 achived with @code{vm-virtual-auto-delete-message} for interactive use and the
2995 function and @code{vm-virtual-auto-delete-messages} when added to the VM hook
2996 @code{vm-arrived-messages-hook}.  This can be quite handy for marking spam for
2997 deletion.
2998
2999 @kbd{M-x vm-virtual-save-message} can be used to save messages to the 
3000 folder corresponging to the first matching selector and the function 
3001 @kbd{vm-virtual-auto-archive-messages} can file messages based on
3002 selectors (see also @code{vm-auto-archive-messages}). 
3003
3004 @node Frames and Windows, Toolbar, Virtual Folders, Top
3005 @chapter Frames and Windows
3006
3007 VM uses Emacs frames and windows to display messages and summaries
3008 and to provide a place for you to compose messages.  Using VM's
3009 frame configuration facilities you can control when VM creates new
3010 frames and the size and attributes associated with new frames.
3011 Inside each frame you can associate different window setups with
3012 commands and classes of commands by using VM's window configuration
3013 facilities.
3014
3015 @vindex vm-mutable-frames
3016 To use VM's frame configuration features, the variable
3017 @code{vm-mutable-frames} must be set non-@code{nil}.  This is the default.  If
3018 @code{vm-mutable-frames} is set to nil VM will only use the current
3019 frame, and VM will not create, delete or resize frames.
3020
3021 @vindex vm-mutable-windows
3022 To use window configurations, the variable @code{vm-mutable-windows}
3023 must be set non-@code{nil}.  If @code{vm-mutable-windows} is set to nil, VM
3024 will only use the selected window, and will not create, delete or
3025 resize windows.
3026
3027 @menu
3028 * Frame Configuration::         How to configure frame use and appearance.
3029 * Window Configuration::        How to configure window use and appearance.
3030 @end menu
3031
3032 @node Frame Configuration, Window Configuration, Frames and Windows, Frames and Windows
3033 @section Frame Configuration
3034
3035 VM has a set of variables that let you specify when VM creates
3036 frames and what attributes the new frames will have.
3037
3038 @vindex vm-frame-per-folder
3039 If @code{vm-frame-per-folder} is set non-@code{nil}, when you visit a folder,
3040 VM will create a new frame and display that folder in the new
3041 frame.  When you quit the folder, VM will delete the frame.
3042
3043 @vindex vm-frame-per-summary
3044 If @code{vm-frame-per-summary} is set non-@code{nil}, the @code{vm-summarize}
3045 command will create a new frame in which to display a folder's summary
3046 buffer.  This works best if a full-screen window configuration has
3047 been assigned to the @code{vm-summarize} command.  When you quit the folder
3048 or kill the summary, VM will delete the frame.
3049
3050 @vindex vm-frame-per-composition
3051 Setting @code{vm-frame-per-composition} non-@code{nil} causes VM to create a
3052 new frame for the composition buffer when you run any of VM's
3053 message composition commands.  E.g. @code{vm-reply-include-text},
3054 @code{vm-mail}, @code{vm-forward-message}.  When you finish editing the
3055 composition and send it, or when you kill the composition buffer, 
3056 the frame will be deleted.
3057
3058 @vindex vm-frame-per-edit
3059 The variable @code{vm-frame-per-edit}, if non-@code{nil}, tells VM to create a
3060 new frame when the vm-edit-message command is run.  When you
3061 finish editing the message, or abort the edit, the frame will be
3062 deleted.
3063
3064 @vindex vm-frame-per-help
3065 If @code{vm-frame-per-help} is set non-@code{nil}, VM will create a new frame
3066 to display any help buffer produced by the vm-help command.
3067
3068 @vindex vm-frame-per-completion
3069 If @code{vm-frame-per-completion} is set non-@code{nil}, VM will create a new
3070 frame on mouse initiated completing reads.  A mouse initiated
3071 completing read occurs when you invoke a VM command using the
3072 mouse, either with a menu or a toolbar button.  That command
3073 must then prompt you for information, and there must be a
3074 limited set of valid responses.  If these conditions are met
3075 and @code{vm-frame-per-completion}'s value is non-@code{nil}, VM will
3076 create a new frame containing a list of responses that you can
3077 select with the mouse.
3078
3079 @vindex vm-search-other-frames
3080 When VM is deciding whether to create a new frame, it checks
3081 other existing frames to see if a buffer that it wants to display in a
3082 frame is already being displayed somewhere.  If so, then VM will
3083 not create a new frame.  If you don't want VM to search other
3084 frames, set the variable @code{vm-search-other-frames} to @code{nil}.  VM will 
3085 still search the currently selected frame and will not create a
3086 new frame if the buffer that it wants to display is visible there.
3087
3088 @vindex vm-frame-parameter-alist
3089 The variable @code{vm-frame-parameter-alist} allows you to specify the
3090 frame parameters for newly created frames.
3091
3092 The value of @code{vm-frame-parameter-alist} should be of this form
3093
3094 @example
3095 ((@var{SYMBOL} @var{PARAMLIST}) (@var{SYMBOL2} @var{PARAMLIST2}) ...)
3096 @end example
3097
3098 @var{SYMBOL} must be one of ``completion'', ``composition'', ``edit'',
3099 ``folder'', ``primary-folder'' or ``summary''.  It specifies the type
3100 of frame that the following @var{PARAMLIST} applies to.
3101
3102 @table @code
3103 @item completion
3104 specifies parameters for frames that display lists of
3105 choices generated by a mouse-initiated completing read.
3106 (See @code{vm-frame-per-completion}.)
3107 @item composition
3108 specifies parameters for mail composition frames.
3109 @item edit
3110 specifies parameters for message edit frames
3111 (e.g. created by @code{vm-edit-message-other-frame})
3112 @item folder
3113 specifies parameters for frames created by `vm' and the
3114 @code{vm-visit-} commands.
3115 @item primary-folder
3116 specifies parameters for the frame created by running
3117 @code{vm} without any arguments.
3118 @item summary
3119 specifies parameters for frames that display a summary buffer
3120 (e.g. created by @code{vm-summarize-other-frame})
3121 @end table
3122 @var{PARAMLIST} is a list of pairs as described in the documentation for
3123 the function @code{make-frame}.
3124
3125 @node Window Configuration,, Frame Configuration, Frames and Windows
3126 @section Window Configuration
3127
3128 Window configurations allow you to specify how the windows within
3129 a frame should look for a particular command or class of
3130 commands.  Each command can have a configuration associated with
3131 it and you can also associate a configuration with command
3132 classes like ``reading-message'' or ``composing-message''.  To
3133 setup a window configuration, first use Emacs' window management
3134 commands (@code{split-window}, @code{enlarge-window}, etc.)  to make the
3135 windows in the frame look the way you want.  Then use the
3136 switch-to-buffer command to put the buffers you want to see into
3137 the windows.  Next type @kbd{W S}, which invokes the
3138 @code{vm-save-window-configuration} command.  Type the name of the
3139 command or class of commands to which you want the configuration
3140 to apply.  Nearly all VM commands can be entered here.  Valid
3141 classes are:
3142
3143 @display
3144     default
3145     startup
3146     quitting
3147     reading-message
3148     composing-message
3149     marking-message
3150     searching-message
3151 @end display
3152
3153 When a VM command is executed, window configurations are searched 
3154 for as follows.  First, a command specific configuration is
3155 searched for.  If one is found, it is used.  Next a class
3156 configuration is searched for.  Not all commands are in command
3157 classes.  Message composition commands are in the
3158 ``composing-message'' class.  All the @code{vm-quit*} commands are in the
3159 ``quitting'' class.  All the VM commands that set and clear
3160 message marks are in the ``marking-message'' class, and so on.
3161 If such a class configuration is found it is used.  If no
3162 matching class configuration is found, the ``default'' class
3163 configuration is used, if it is defined.
3164
3165 Note that when a window configuration is saved the selected
3166 window at that time will be the selected window when that window
3167 configuration is used.  So if you prefer for the cursor to be in
3168 a particular window, make sure you invoke
3169 @code{vm-save-window-configuration} window from that window.  Remember
3170 that you can invoke the command with @kbd{M-x} if VM's normal
3171 keymap is not in effect.
3172
3173 To delete a window configuration, use @kbd{W D} which is bound to
3174 @code{vm-delete-window-configuration}.  You will be prompted for the
3175 name of the configuration to delete.
3176
3177 To see what an existing configuration looks like, type @kbd{W W}
3178 which invokes @code{vm-apply-window-configuration}.
3179
3180 @vindex vm-window-configuration-file
3181 VM saves information about your window configurations in the file
3182 named by the variable @code{vm-window-configuration-file}.  The default
3183 location of the configuration file is @samp{"~/.vm.windows"}.
3184 Do not make @code{vm-window-configuration-file} point to the same
3185 location as @code{vm-init-file}, as the window configuration save
3186 commands will then overwrite the content of your init file.
3187
3188 @node Toolbar, Menus, Frames and Windows, Top
3189 @chapter Toolbar
3190
3191 VM can display a toolbar that allows you to run VM commands with
3192 a single mouse click.  By default the toolbar is displayed on the
3193 left of the Emacs frame and is only visible if you're running
3194 under a window system like X Windows or Microsoft Windows.
3195
3196 @vindex vm-use-toolbar
3197 To make VM not display the toolbar, set @code{vm-use-toolbar} to nil.
3198 To configure what buttons are displayed on the toolbar, you must
3199 change the value of @code{vm-use-toolbar}.  If non-@code{nil}, the value of
3200 @code{vm-use-toolbar} should be a list of symbols and integers, which
3201 specify which buttons appear on the toolbar and the layout of the
3202 buttons.  These are the allowed symbols along with the buttons
3203 they represent.
3204
3205 @table @code
3206 @item autofile
3207 The AutoFile button.  Clicking on this button runs the command
3208 @code{vm-toolbar-autofile-message}.  This command will save the current
3209 message into the folder matched by @code{vm-auto-folder-alist}, if there
3210 is a match.
3211 @item compose
3212 The Compose button.  Clicking on this button runs the command
3213 @code{vm-toolbar-compose-command}.  This command is normally just an
3214 alias for the @code{vm-mail} command.  If you want the Compose button to 
3215 do something else, redefine @code{vm-toolbar-compose-command} using
3216 either @code{fset} or @code{defun}.
3217 @item delete/undelete
3218 The Delete/Undelete button.  If the current message is marked for 
3219 deletion, this button displays as an Undelete button.  Otherwise
3220 it displays as a Delete button.
3221 @item file
3222 The File button.  Clicking on this button runs the command
3223 @code{vm-toolbar-file-command}.  This command is normally just an
3224 alias for the @code{vm-mail} command.  If you want the File button to 
3225 do something else, redefine @code{vm-toolbar-file-command} using
3226 either @code{fset} or @code{defun}.
3227 @item getmail
3228 The Get Mail button.  Clicking on this button runs the command
3229 @code{vm-toolbar-getmail-command}.  This command is normally just an
3230 alias for the @code{vm-get-new-mail} command.  If you want the
3231 Get Mail button to 
3232 do something else, redefine @code{vm-toolbar-getmail-command} using
3233 either @code{fset} or @code{defun}.
3234 @item help
3235 The Helper button.  Clicking on this button runs the command
3236 @code{vm-toolbar-helper-command}.  This command normally just runs
3237 @code{vm-help}, but it also does context specific things under certain
3238 conditions.  If the current message is a MIME message that needs
3239 decoding, the Helper button becomes the Decode MIME button.  If the 
3240 current folder has an autosave file that appears to be the result 
3241 of an Emacs or system crash, the Helper button becomes the Recover 
3242 button.  Clicking on the Recover button runs @code{recover-file}, 
3243 so you can recover your folder from an existing autosave file.
3244 @item mime
3245 The Decode MIME button.  Clicking on this button runs the command
3246 @code{vm-toolbar-mime-command}.  This command is normally just an
3247 alias for the @code{vm-decode-mime-message} command.
3248 @item next
3249 The Next button.  Clicking on this button runs the command
3250 @code{vm-toolbar-next-command}.  This command is normally just an
3251 alias for the @code{vm-next-message} command.  If you want the Next button to 
3252 do something else, redefine @code{vm-toolbar-next-command} using
3253 either @code{fset} or @code{defun}.
3254 @item previous
3255 The Previous button.  Clicking on this button runs the command
3256 @code{vm-toolbar-previous-command}.  This command is normally just an
3257 alias for the @code{vm-previous-message} command.  If you want the Previous button to 
3258 do something else, redefine @code{vm-toolbar-previous-command} using
3259 either @code{fset} or @code{defun}.
3260 @item print
3261 The Print button.  Clicking on this button runs the command
3262 @code{vm-toolbar-print-command}.  This command is normally just an
3263 alias for the @code{vm-print-message} command.  If you want the
3264 Print button to 
3265 do something else, redefine @code{vm-toolbar-print-command} using
3266 either @code{fset} or @code{defun}.
3267 @item quit
3268 The Quit button.  Clicking on this button runs the command
3269 @code{vm-toolbar-quit-command}.  This command is normally just an
3270 alias for the @code{vm-quit} command.  If you want the Quit button to 
3271 do something else, redefine @code{vm-toolbar-quit-command} using
3272 either @code{fset} or @code{defun}.
3273 @item reply
3274 The Reply button.  Clicking on this button runs the command
3275 @code{vm-toolbar-reply-command}.  This command is normally just an
3276 alias for the @code{vm-reply-include-text} command.  If you want
3277 the Reply button to
3278 do something else, redefine @code{vm-toolbar-reply-command} using
3279 either @code{fset} or @code{defun}.
3280 @item visit
3281 The Visit button.  Clicking on this button runs the command
3282 @code{vm-toolbar-visit-command}.  This command is normally just an
3283 alias for the @code{vm-visit-folder} command.  If you want the Visit button to 
3284 do something else, redefine @code{vm-toolbar-visit-command} using
3285 either @code{fset} or @code{defun}.
3286 @item nil
3287 If nil appears in the list, it must appear exactly once.  The
3288 buttons associated with symbols that appear after nil in the
3289 list will be display flushright for top and bottom toolbars, and
3290 flushbottom for left and right toolbars.
3291 @end table
3292
3293 If an positive integer appears in the the @code{vm-use-toolbar} list, it
3294 specifies the number of pixels of blank space to display between
3295 the button that comes before and the button that comes after the
3296 integer.
3297
3298 @vindex vm-toolbar-orientation
3299 The variable @code{vm-toolbar-orientation} controls on which side of the 
3300 frame the toolbar is displayed.  E.g.
3301
3302 @example
3303 (setq vm-toolbar-orientation 'top)
3304 @end example
3305
3306 causes the toolbar to be displayed at the top of the frame.  The
3307 @code{top} in the example can be replaced with @code{bottom},
3308 @code{right} and @code{left} to make the toolbar appear in those
3309 places instead.
3310
3311 @vindex vm-toolbar-pixmap-directory
3312 VM finds the images for the toolbar in the directory specified by
3313 @code{vm-toolbar-pixmap-directory}.  This variable should already be set
3314 properly by whoever installed VM on your system, so you should
3315 not need to set it.
3316
3317 @node Menus, Faces, Toolbar, Top
3318 @chapter Menus
3319
3320 @vindex vm-popup-menu-on-mouse-3
3321 VM uses Emacs' menubar and popup menus when they are available to 
3322 give you access to more of VM's commands.  By default VM puts a
3323 context sensitive popup menu on mouse button 3 (usually the
3324 rightmost mouse button).  If you don't want this menu, set the
3325 variable @code{vm-popup-menu-on-mouse-3} to nil.
3326
3327 @vindex vm-use-menus
3328 If you set @code{vm-use-menus} to nil, VM will not generate a menubar
3329 for VM folder buffers and VM won't use popup menus either.  If
3330 you set @code{vm-use-menus} to @samp{1}, VM will add a single @samp{VM}
3331 entry to the existing menubar instead of using the whole menubar
3332 for its purposes.  That single entry will have all the VM command
3333 submenus under it.
3334
3335 To make VM use the whole menubar, you must set variable @code{vm-use-menus}
3336 to a list of symbols.  The symbols and the order in which they are listed
3337 determine which menus will be in the menubar and how they are ordered.
3338 Valid symbol values are:
3339 @table @code
3340 @item dispose
3341 This is menu of commands that are commonly used to dispose of a
3342 message.  E.g. reply, print, save, delete.
3343 @item emacs
3344 This is actually a menu button that causes the menubar to change
3345 to the global Emacs menubar.  On that menubar you will find
3346 a VM button that will return you to the VM menubar.
3347 @item folder
3348 This is a menu of folder related commands.  You can visit a
3349 folder, save a folder, quit a folder and so on.
3350 @item help
3351 This is a menu of commands that provide information for you if
3352 you don't know what to do next.
3353 @item label
3354 This is a menu of commands that let you add and remove message
3355 labels from messages.
3356 @item mark
3357 This is a menu of commands that you can use to mark and unmark
3358 messages based on various criteria.  @xref{Message Marks}.
3359 @item motion
3360 This is a menu of commands to move around inside messages and
3361 inside folders.
3362 @item send
3363 This is a menu of commands you use to compose and send messages.
3364 @item sort
3365 This is a menu of commands to sort a folder by various criteria.
3366 @item undo
3367 This is a menu button that invokes the @code{vm-undo} command.
3368 @item virtual
3369 This is a menu of commands that let you visit and create virtual
3370 folders.
3371 @item nil
3372 If nil appears in the list, it should appear exactly once.  All
3373 menus after nil in the list will be displayed flushright in
3374 the menubar.
3375 @end table
3376
3377 @node Faces, Using the Mouse, Menus, Top
3378 @chapter Faces
3379
3380 VM uses Emacs faces to emphasize text in the folder and summary
3381 buffers.  Instead of defining VM specific faces, VM's face usage
3382 is controlled by customization variables that can point to faces.
3383 This allows you to use standard Emacs faces, or to create your
3384 own.  So when you want to change which face is used, write code
3385 like this:
3386
3387 @example
3388 (setq vm-summary-highlight-face 'bold-italic)
3389 @end example
3390
3391 In the summary buffer, VM displays the summary entry for the current
3392 message using the face specified by the @code{vm-summary-highlight-face}
3393 variable.  The value of this variable should be a symbol that names a
3394 face, or nil which means don't display the summary entry of the
3395 current message in a special way.
3396
3397 @vindex vm-mouse-track-summary
3398 The variable @code{vm-mouse-track-summary} controls whether summary
3399 entries are highlighted when the mouse pointer passes over
3400 them.  The highlighting is done using the standard Emacs
3401 @code{highlight} face.
3402
3403 @vindex vm-highlighted-header-regexp
3404 @vindex vm-highlighted-header-face
3405 In the folder buffer, the header contents of headers matched by
3406 the @code{vm-highlighted-header-regexp} variable are displayed using
3407 the face named by @code{vm-highlighted-header-face}.  This variable is
3408 ignored under XEmacs if @code{vm-use-lucid-highlighting} is non-@code{nil}.
3409 The XEmacs @code{highlight-headers} package is used instead.  See the
3410 documentation for the function @code{highlight-headers} to find out
3411 how to customize header highlighting using this package.
3412
3413 @vindex vm-highlight-url-face
3414 @vindex vm-url-search-limit
3415 URL's that occur in message bodies are displayed using the face
3416 named by @code{vm-highlight-url-face}.  Searching for URLs in a
3417 large message can take a long time.  Since URLs often occur near
3418 the beginning and near the end of messages, VM offers a way to
3419 search just those parts of a message for URLs.  The variable
3420 @code{vm-url-search-limit} specifies how much of a message to search.
3421 If @code{vm-url-search-limit} has a positive numeric value @var{N}, VM 
3422 will search the first @math{@var{N} / 2} characters and the last
3423 @math{@var{N} / 2} characters in the message for URLs.
3424
3425 @vindex vm-mime-button-face
3426 The face named by @code{vm-mime-button-face} is used to display the
3427 textual buttons that trigger the display of MIME objects.
3428
3429 @node Using the Mouse, Hooks, Faces, Top
3430 @chapter Using the Mouse
3431
3432 VM uses the following layout for the mouse buttons in the folder
3433 and summary buffers.
3434
3435 @table @asis
3436 @item button-1 (left button usually)
3437 Unchanged.
3438 @item button-2 (middle button usually)
3439 Activate.  If you click on a summary entry, that message will be
3440 selected and become the current message.  If you click on a
3441 highlighted URL in the body of a message, that URL will be sent
3442 to the browser specified by @code{vm-url-browser}.
3443 @item button-3 (right button usually)
3444 Context Menu.  If the mouse pointer is over the contents of the
3445 From header, button-3 pops up a menu of actions that can be taken 
3446 using the author of the message as a parameter.  For instance,
3447 you may want to create a virtual folder containing all the
3448 messages in the current folder written by this author.  If the
3449 mouse pointer is over the contents of the Subject header, a menu
3450 of actions to be performed on the current message's subject is
3451 produced.  If button-3 is clicked over a highlighted URL, a menu
3452 of Web browsers is produced.  Otherwise the normal VM mode
3453 specific menu is produced.
3454 @end table
3455
3456 In mail composition buffers only mouse button-3 is affected.
3457 Context sensitive menus are produced when that button is clicked.
3458
3459 @node Hooks, Key Index, Using the Mouse, Top
3460 @chapter Hooks
3461
3462 VM has many hook variables that allow you to run functions when
3463 certain events occur.  Here is a list of the hooks and when they
3464 are run.  (If you don't write Emacs-Lisp programs you 
3465 can skip this chapter.)
3466
3467 @table @code
3468 @vindex vm-select-new-message-hook
3469 @item vm-select-new-message-hook
3470 List of hook functions called every time a message with the ``new''
3471 attribute is made to be the current message.  When the hooks are run, the
3472 current buffer will be the folder containing the message and the
3473 start and end of the message will be bracketed by (point-min) and
3474 (point-max).
3475
3476 @item vm-select-unread-message-hook
3477 @vindex vm-select-unread-message-hook
3478 List of hook functions called every time a message with the ``unread''
3479 attribute is made to be the current message.  When the hooks are run, the
3480 current buffer will be the folder containing the message and the
3481 start and end of the message will be bracketed by (point-min) and
3482 (point-max).
3483
3484 @item vm-select-message-hook
3485 @vindex vm-select-message-hook
3486 List of hook functions called every time a message
3487 is made to be the current message.  When the hooks are run, the
3488 current buffer will be the folder containing the message and the
3489 start and end of the message will be bracketed by (point-min) and
3490 (point-max).
3491
3492 @item vm-arrived-message-hook
3493 @vindex vm-arrived-message-hook
3494 List of hook functions called once for each message gathered from the
3495 system mail spool, or from another folder with @code{vm-get-new-mail},
3496 or from a digest with @code{vm-burst-digest}.  When the hooks are run,
3497 the current buffer will be the folder containing the message and the
3498 start and end of the message will be bracketed by (point-min) and
3499 (point-max).
3500
3501 @item vm-spooled-mail-waiting-hook
3502 @vindex vm-spooled-mail-waiting-hook
3503 List of functions called when VM first notices mail is spooled
3504 for a folder.  The folder buffer will be current when the hooks are
3505 run.
3506
3507 @item vm-arrived-messages-hook
3508 @vindex vm-arrived-messages-hook
3509 List of hook functions called after VM has gathered a group
3510 of messages from the system mail spool, or from another
3511 folder with @code{vm-get-new-mail}, or from a digest with
3512 @code{vm-burst-digest}.  When the hooks are run, the new
3513 messages will have already been added to the message list
3514 but may not yet appear in the summary.  When the hooks are
3515 run the current buffer will be the folder containing the
3516 messages.
3517
3518 @item vm-reply-hook
3519 @vindex vm-reply-hook
3520 List of hook functions to be run after a Mail mode composition
3521 buffer has been created for a reply.  VM runs this hook and then
3522 runs @code{vm-mail-mode-hook} before leaving you in the Mail
3523 mode buffer.
3524
3525 @item vm-forward-message-hook
3526 @vindex vm-forward-message-hook
3527 List of hook functions to be run after a Mail mode
3528 composition buffer has been created to forward a message.  VM
3529 runs this hook and then runs @code{vm-mail-mode-hook} before leaving the
3530 user in the Mail mode buffer.
3531
3532 @item vm-resend-bounced-message-hook
3533 @vindex vm-resend-bounced-message-hook
3534 List of hook functions to be run after a Mail mode
3535 composition buffer has been created to resend a bounced message.
3536 VM runs this hook and then runs @code{vm-mail-mode-hook} before leaving
3537 you in the Mail mode buffer.
3538
3539 @item vm-resend-message-hook
3540 @vindex vm-resend-message-hook
3541 List of hook functions to be run after a Mail mode composition
3542 buffer has been created to resend a message.  VM runs this hook
3543 and then runs @code{vm-mail-mode-hook} before leaving you in
3544 the Mail mode buffer.
3545
3546 @item vm-send-digest-hook
3547 @vindex vm-send-digest-hook
3548 List of hook functions to be run after a Mail mode composition
3549 buffer has been created to send a digest.  VM runs this hook and
3550 then runs @code{m-mail-mode-hook} before leaving you in the Mail
3551 mode buffer.
3552
3553 @item vm-mail-hook
3554 @vindex vm-mail-hook
3555 List of hook functions to be run after a Mail mode
3556 composition buffer has been created to send a non specialized
3557 message, i.e. a message that is not a reply, forward, digest,
3558 etc.  VM runs this hook and then runs @code{vm-mail-mode-hook} before
3559 leaving you in the Mail mode buffer.
3560
3561 @item vm-summary-update-hook
3562 @vindex vm-summary-update-hook
3563 List of hook functions called just after VM updates an existing
3564 entry in a folder summary buffer.
3565
3566 @item vm-summary-redo-hook
3567 @vindex vm-summary-redo-hook
3568 List of hook functions called just after VM adds or deletes
3569 entries from a folder summary buffer.
3570
3571 @item vm-visit-folder-hook
3572 @vindex vm-visit-folder-hook
3573 List of hook functions called just after VM visits a folder.
3574 It doesn't matter if the folder buffer already exists, this hook
3575 is run each time @code{vm} or @code{vm-visit-folder} is called interactively.
3576 It is @emph{not} run after @code{vm-mode} is called.
3577
3578 @item vm-retrieved-spooled-mail-hook
3579 @vindex vm-retrieved-spooled-mail-hook
3580 List of hook functions called just after VM has retrieved
3581 a group of messages from your system mailbox(es).  When these
3582 hooks are run, the messages have been added to the folder buffer
3583 but not the message list or summary.  When the hooks are run, the
3584 current buffer will be the folder where the messages were
3585 incorporated.
3586
3587 @item vm-edit-message-hook
3588 @vindex vm-edit-message-hook
3589 List of hook functions to be run just before a message is edited.
3590 This is the last thing @code{vm-edit-message} does before leaving you
3591 in the edit buffer.
3592
3593 @item vm-mail-mode-hook
3594 @vindex vm-mail-mode-hook
3595 List of hook functions to be run after a Mail mode
3596 composition buffer has been created.  This is the last thing VM
3597 does before leaving you in the Mail mode buffer.
3598
3599 @item vm-mode-hook
3600 @vindex vm-mode-hook
3601 List of hook functions to run when a buffer enters @code{vm-mode}.
3602 These hook functions should generally be used to set key bindings
3603 and local variables.
3604
3605 @item vm-mode-hooks
3606 @vindex vm-mode-hooks
3607 Old name for @code{vm-mode-hook}.
3608 Supported for backward compatibility.
3609 You should use the new name.
3610
3611 @item vm-summary-mode-hook
3612 @vindex vm-summary-mode-hook
3613 List of hook functions to run when a VM summary buffer is created.
3614 The current buffer will be that buffer when the hooks are run.
3615
3616 @item vm-summary-mode-hooks
3617 @vindex vm-summary-mode-hooks
3618 Old name for @code{vm-summary-mode-hook}.
3619 Supported for backward compatibility.
3620 You should use the new name.
3621
3622 @item vm-virtual-mode-hook
3623 @vindex vm-virtual-mode-hook
3624 List of hook functions to run when a VM virtual folder buffer is created.
3625 The current buffer will be that buffer when the hooks are run.
3626
3627 @item vm-presentation-mode-hook
3628 @vindex vm-presentation-mode-hook
3629 List of hook functions to run when a VM presentation buffer is
3630 created.  The current buffer will be the new presentation buffer
3631 when the hooks are run.  Presentation buffers are used to display
3632 messages when some type of decoding must be done to the message
3633 to make it presentable.  E.g. MIME decoding.
3634
3635 @item vm-quit-hook
3636 @vindex vm-quit-hook
3637 List of hook functions to run when you quit VM.
3638 This applies to any VM quit command.
3639
3640 @item vm-summary-pointer-update-hook
3641 @vindex vm-summary-pointer-update-hook
3642 List of hook functions to run when the VM summary pointer is updated.
3643 When the hooks are run, the current buffer will be the summary buffer.
3644
3645 @item vm-display-buffer-hook
3646 @vindex vm-display-buffer-hook
3647 List of hook functions that are run every time VM wants to
3648 display a buffer.  When the hooks are run, the current buffer will
3649 be the buffer that VM wants to display.  The hooks are expected
3650 to select a window and VM will display the buffer in that
3651 window.
3652
3653 If you use display hooks, you should not use VM's builtin window
3654 configuration system as the result is likely to be confusing.
3655
3656 @item vm-undisplay-buffer-hook
3657 @vindex vm-undisplay-buffer-hook
3658 List of hook functions that are run every time VM wants to
3659 remove a buffer from the display.  When the hooks are run, the
3660 current buffer will be the buffer that VM wants to disappear.
3661 The hooks are expected to do the work of removing the buffer from
3662 the display.  The hook functions should not kill the buffer.
3663
3664 If you use undisplay hooks, you should not use VM's builtin
3665 window configuration system as the result is likely to be
3666 confusing.
3667
3668 @item vm-iconify-frame-hook
3669 @vindex vm-iconify-frame-hook
3670 List of hook functions that are run whenever VM iconifies a frame.
3671
3672 @item vm-menu-setup-hook
3673 @vindex vm-menu-setup-hook
3674 List of hook functions that are run just after all menus are initialized.
3675
3676 @item vm-mime-display-function
3677 @vindex vm-mime-display-function
3678 If non-@code{nil}, this should name a function to be called inside 
3679 @code{vm-decode-mime-message} to do the MIME display of the current
3680 message.  The function is called with no arguments, and at the
3681 time of the call the current buffer will be the @dfn{presentation
3682 buffer} for the folder, which is a temporary buffer that VM uses
3683 for the display of MIME messages.  A copy of the current message
3684 will be in the presentation buffer at that time.  The normal work
3685 that @code{vm-decode-mime-message} would do is not done, because this
3686 function is expected to subsume all of it.
3687
3688 @item vm-mail-send-hook
3689 @vindex vm-mail-send-hook
3690 List of hook functions to call just before sending a message.
3691 The hooks are run after confirming that you want to send the
3692 message (see @code{vm-confirm-mail-send} but before MIME encoding
3693 and FCC processing.
3694
3695 @item mail-yank-hooks
3696 @vindex mail-yank-hooks
3697 Hooks called after a message is yanked into a mail composition buffer.
3698
3699 (This hook is deprecated, you should use mail-citation-hook instead.)
3700
3701 The value of this hook is a list of functions to be run.  Each
3702 hook function can find the newly yanked message between point
3703 and mark.  Each hook function should return with point and mark
3704 around the yanked message.
3705
3706 See the documentation for @code{vm-yank-message} to see when VM will run
3707 these hooks.
3708
3709 @item mail-citation-hook
3710 @vindex mail-citation-hook
3711 Hook for modifying a citation just inserted in the mail buffer.
3712 Each hook function can find the citation between (point) and (mark t).
3713 And each hook function should leave point and mark around the citation
3714 text as modified.
3715
3716 If this hook is entirely empty, i.e. @code{nil}, a default action is taken
3717 instead of no action.
3718 @end table
3719
3720 @node Key Index, Command Index, Hooks, Top
3721 @unnumbered Key Index
3722 @printindex ky
3723
3724 @node Command Index, Variable Index, Key Index, Top
3725 @unnumbered Command Index
3726 @printindex fn
3727
3728 @node Variable Index, License, Command Index, Top
3729 @unnumbered Variable Index
3730 @printindex vr
3731
3732 @node License,, Variable Index, Top
3733 @unnumbered GNU GENERAL PUBLIC LICENSE
3734 @center Version 2, June 1991
3735
3736 @display
3737 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
3738 675 Mass Ave, Cambridge, MA 02139, USA
3739
3740 Everyone is permitted to copy and distribute verbatim copies
3741 of this license document, but changing it is not allowed.
3742 @end display
3743
3744 @unnumberedsec Preamble
3745
3746   The licenses for most software are designed to take away your
3747 freedom to share and change it.  By contrast, the GNU General Public
3748 License is intended to guarantee your freedom to share and change free
3749 software---to make sure the software is free for all its users.  This
3750 General Public License applies to most of the Free Software
3751 Foundation's software and to any other program whose authors commit to
3752 using it.  (Some other Free Software Foundation software is covered by
3753 the GNU Library General Public License instead.)  You can apply it to
3754 your programs, too.
3755
3756   When we speak of free software, we are referring to freedom, not
3757 price.  Our General Public Licenses are designed to make sure that you
3758 have the freedom to distribute copies of free software (and charge for
3759 this service if you wish), that you receive source code or can get it
3760 if you want it, that you can change the software or use pieces of it
3761 in new free programs; and that you know you can do these things.
3762
3763   To protect your rights, we need to make restrictions that forbid
3764 anyone to deny you these rights or to ask you to surrender the rights.
3765 These restrictions translate to certain responsibilities for you if you
3766 distribute copies of the software, or if you modify it.
3767
3768   For example, if you distribute copies of such a program, whether
3769 gratis or for a fee, you must give the recipients all the rights that
3770 you have.  You must make sure that they, too, receive or can get the
3771 source code.  And you must show them these terms so they know their
3772 rights.
3773
3774   We protect your rights with two steps: (1) copyright the software, and
3775 (2) offer you this license which gives you legal permission to copy,
3776 distribute and/or modify the software.
3777
3778   Also, for each author's protection and ours, we want to make certain
3779 that everyone understands that there is no warranty for this free
3780 software.  If the software is modified by someone else and passed on, we
3781 want its recipients to know that what they have is not the original, so
3782 that any problems introduced by others will not reflect on the original
3783 authors' reputations.
3784
3785   Finally, any free program is threatened constantly by software
3786 patents.  We wish to avoid the danger that redistributors of a free
3787 program will individually obtain patent licenses, in effect making the
3788 program proprietary.  To prevent this, we have made it clear that any
3789 patent must be licensed for everyone's free use or not licensed at all.
3790
3791   The precise terms and conditions for copying, distribution and
3792 modification follow.
3793
3794 @iftex
3795 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3796 @end iftex
3797 @ifnottex
3798 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3799 @end ifnottex
3800
3801 @enumerate 0
3802 @item
3803 This License applies to any program or other work which contains
3804 a notice placed by the copyright holder saying it may be distributed
3805 under the terms of this General Public License.  The ``Program'', below,
3806 refers to any such program or work, and a ``work based on the Program''
3807 means either the Program or any derivative work under copyright law:
3808 that is to say, a work containing the Program or a portion of it,
3809 either verbatim or with modifications and/or translated into another
3810 language.  (Hereinafter, translation is included without limitation in
3811 the term ``modification''.)  Each licensee is addressed as ``you''.
3812
3813 Activities other than copying, distribution and modification are not
3814 covered by this License; they are outside its scope.  The act of
3815 running the Program is not restricted, and the output from the Program
3816 is covered only if its contents constitute a work based on the
3817 Program (independent of having been made by running the Program).
3818 Whether that is true depends on what the Program does.
3819
3820 @item
3821 You may copy and distribute verbatim copies of the Program's
3822 source code as you receive it, in any medium, provided that you
3823 conspicuously and appropriately publish on each copy an appropriate
3824 copyright notice and disclaimer of warranty; keep intact all the
3825 notices that refer to this License and to the absence of any warranty;
3826 and give any other recipients of the Program a copy of this License
3827 along with the Program.
3828
3829 You may charge a fee for the physical act of transferring a copy, and
3830 you may at your option offer warranty protection in exchange for a fee.
3831
3832 @item
3833 You may modify your copy or copies of the Program or any portion
3834 of it, thus forming a work based on the Program, and copy and
3835 distribute such modifications or work under the terms of Section 1
3836 above, provided that you also meet all of these conditions:
3837
3838 @enumerate a
3839 @item
3840 You must cause the modified files to carry prominent notices
3841 stating that you changed the files and the date of any change.
3842
3843 @item
3844 You must cause any work that you distribute or publish, that in
3845 whole or in part contains or is derived from the Program or any
3846 part thereof, to be licensed as a whole at no charge to all third
3847 parties under the terms of this License.
3848
3849 @item
3850 If the modified program normally reads commands interactively
3851 when run, you must cause it, when started running for such
3852 interactive use in the most ordinary way, to print or display an
3853 announcement including an appropriate copyright notice and a
3854 notice that there is no warranty (or else, saying that you provide
3855 a warranty) and that users may redistribute the program under
3856 these conditions, and telling the user how to view a copy of this
3857 License.  (Exception: if the Program itself is interactive but
3858 does not normally print such an announcement, your work based on
3859 the Program is not required to print an announcement.)
3860 @end enumerate
3861
3862 These requirements apply to the modified work as a whole.  If
3863 identifiable sections of that work are not derived from the Program,
3864 and can be reasonably considered independent and separate works in
3865 themselves, then this License, and its terms, do not apply to those
3866 sections when you distribute them as separate works.  But when you
3867 distribute the same sections as part of a whole which is a work based
3868 on the Program, the distribution of the whole must be on the terms of
3869 this License, whose permissions for other licensees extend to the
3870 entire whole, and thus to each and every part regardless of who wrote it.
3871
3872 Thus, it is not the intent of this section to claim rights or contest
3873 your rights to work written entirely by you; rather, the intent is to
3874 exercise the right to control the distribution of derivative or
3875 collective works based on the Program.
3876
3877 In addition, mere aggregation of another work not based on the Program
3878 with the Program (or with a work based on the Program) on a volume of
3879 a storage or distribution medium does not bring the other work under
3880 the scope of this License.
3881
3882 @item
3883 You may copy and distribute the Program (or a work based on it,
3884 under Section 2) in object code or executable form under the terms of
3885 Sections 1 and 2 above provided that you also do one of the following:
3886
3887 @enumerate a
3888 @item
3889 Accompany it with the complete corresponding machine-readable
3890 source code, which must be distributed under the terms of Sections
3891 1 and 2 above on a medium customarily used for software interchange; or,
3892
3893 @item
3894 Accompany it with a written offer, valid for at least three
3895 years, to give any third party, for a charge no more than your
3896 cost of physically performing source distribution, a complete
3897 machine-readable copy of the corresponding source code, to be
3898 distributed under the terms of Sections 1 and 2 above on a medium
3899 customarily used for software interchange; or,
3900
3901 @item
3902 Accompany it with the information you received as to the offer
3903 to distribute corresponding source code.  (This alternative is
3904 allowed only for noncommercial distribution and only if you
3905 received the program in object code or executable form with such
3906 an offer, in accord with Subsection b above.)
3907 @end enumerate
3908
3909 The source code for a work means the preferred form of the work for
3910 making modifications to it.  For an executable work, complete source
3911 code means all the source code for all modules it contains, plus any
3912 associated interface definition files, plus the scripts used to
3913 control compilation and installation of the executable.  However, as a
3914 special exception, the source code distributed need not include
3915 anything that is normally distributed (in either source or binary
3916 form) with the major components (compiler, kernel, and so on) of the
3917 operating system on which the executable runs, unless that component
3918 itself accompanies the executable.
3919
3920 If distribution of executable or object code is made by offering
3921 access to copy from a designated place, then offering equivalent
3922 access to copy the source code from the same place counts as
3923 distribution of the source code, even though third parties are not
3924 compelled to copy the source along with the object code.
3925
3926 @item
3927 You may not copy, modify, sublicense, or distribute the Program
3928 except as expressly provided under this License.  Any attempt
3929 otherwise to copy, modify, sublicense or distribute the Program is
3930 void, and will automatically terminate your rights under this License.
3931 However, parties who have received copies, or rights, from you under
3932 this License will not have their licenses terminated so long as such
3933 parties remain in full compliance.
3934
3935 @item
3936 You are not required to accept this License, since you have not
3937 signed it.  However, nothing else grants you permission to modify or
3938 distribute the Program or its derivative works.  These actions are
3939 prohibited by law if you do not accept this License.  Therefore, by
3940 modifying or distributing the Program (or any work based on the
3941 Program), you indicate your acceptance of this License to do so, and
3942 all its terms and conditions for copying, distributing or modifying
3943 the Program or works based on it.
3944
3945 @item
3946 Each time you redistribute the Program (or any work based on the
3947 Program), the recipient automatically receives a license from the
3948 original licensor to copy, distribute or modify the Program subject to
3949 these terms and conditions.  You may not impose any further
3950 restrictions on the recipients' exercise of the rights granted herein.
3951 You are not responsible for enforcing compliance by third parties to
3952 this License.
3953
3954 @item
3955 If, as a consequence of a court judgment or allegation of patent
3956 infringement or for any other reason (not limited to patent issues),
3957 conditions are imposed on you (whether by court order, agreement or
3958 otherwise) that contradict the conditions of this License, they do not
3959 excuse you from the conditions of this License.  If you cannot
3960 distribute so as to satisfy simultaneously your obligations under this
3961 License and any other pertinent obligations, then as a consequence you
3962 may not distribute the Program at all.  For example, if a patent
3963 license would not permit royalty-free redistribution of the Program by
3964 all those who receive copies directly or indirectly through you, then
3965 the only way you could satisfy both it and this License would be to
3966 refrain entirely from distribution of the Program.
3967
3968 If any portion of this section is held invalid or unenforceable under
3969 any particular circumstance, the balance of the section is intended to
3970 apply and the section as a whole is intended to apply in other
3971 circumstances.
3972
3973 It is not the purpose of this section to induce you to infringe any
3974 patents or other property right claims or to contest validity of any
3975 such claims; this section has the sole purpose of protecting the
3976 integrity of the free software distribution system, which is
3977 implemented by public license practices.  Many people have made
3978 generous contributions to the wide range of software distributed
3979 through that system in reliance on consistent application of that
3980 system; it is up to the author/donor to decide if he or she is willing
3981 to distribute software through any other system and a licensee cannot
3982 impose that choice.
3983
3984 This section is intended to make thoroughly clear what is believed to
3985 be a consequence of the rest of this License.
3986
3987 @item
3988 If the distribution and/or use of the Program is restricted in
3989 certain countries either by patents or by copyrighted interfaces, the
3990 original copyright holder who places the Program under this License
3991 may add an explicit geographical distribution limitation excluding
3992 those countries, so that distribution is permitted only in or among
3993 countries not thus excluded.  In such case, this License incorporates
3994 the limitation as if written in the body of this License.
3995
3996 @item
3997 The Free Software Foundation may publish revised and/or new versions
3998 of the General Public License from time to time.  Such new versions will
3999 be similar in spirit to the present version, but may differ in detail to
4000 address new problems or concerns.
4001
4002 Each version is given a distinguishing version number.  If the Program
4003 specifies a version number of this License which applies to it and ``any
4004 later version'', you have the option of following the terms and conditions
4005 either of that version or of any later version published by the Free
4006 Software Foundation.  If the Program does not specify a version number of
4007 this License, you may choose any version ever published by the Free Software
4008 Foundation.
4009
4010 @item
4011 If you wish to incorporate parts of the Program into other free
4012 programs whose distribution conditions are different, write to the author
4013 to ask for permission.  For software which is copyrighted by the Free
4014 Software Foundation, write to the Free Software Foundation; we sometimes
4015 make exceptions for this.  Our decision will be guided by the two goals
4016 of preserving the free status of all derivatives of our free software and
4017 of promoting the sharing and reuse of software generally.
4018
4019 @iftex
4020 @heading NO WARRANTY
4021 @end iftex
4022 @ifnottex
4023 @center NO WARRANTY
4024 @end ifnottex
4025
4026 @item
4027 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
4028 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW@.  EXCEPT WHEN
4029 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
4030 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
4031 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4032 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE@.  THE ENTIRE RISK AS
4033 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU@.  SHOULD THE
4034 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
4035 REPAIR OR CORRECTION.
4036
4037 @item
4038 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
4039 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
4040 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
4041 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
4042 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
4043 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
4044 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
4045 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
4046 POSSIBILITY OF SUCH DAMAGES.
4047 @end enumerate
4048
4049 @iftex
4050 @heading END OF TERMS AND CONDITIONS
4051 @end iftex
4052 @ifnottex
4053 @center END OF TERMS AND CONDITIONS
4054 @end ifnottex
4055
4056 @page
4057 @unnumberedsec How to Apply These Terms to Your New Programs
4058
4059   If you develop a new program, and you want it to be of the greatest
4060 possible use to the public, the best way to achieve this is to make it
4061 free software which everyone can redistribute and change under these terms.
4062
4063   To do so, attach the following notices to the program.  It is safest
4064 to attach them to the start of each source file to most effectively
4065 convey the exclusion of warranty; and each file should have at least
4066 the ``copyright'' line and a pointer to where the full notice is found.
4067
4068 @smallexample
4069 @var{one line to give the program's name and an idea of what it does.}
4070 Copyright (C) 19@var{yy}  @var{name of author}
4071
4072 This program is free software; you can redistribute it and/or
4073 modify it under the terms of the GNU General Public License
4074 as published by the Free Software Foundation; either version 2
4075 of the License, or (at your option) any later version.
4076
4077 This program is distributed in the hope that it will be useful,
4078 but WITHOUT ANY WARRANTY; without even the implied warranty of
4079 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@.  See the
4080 GNU General Public License for more details.
4081
4082 You should have received a copy of the GNU General Public License
4083 along with this program; if not, write to the Free Software
4084 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4085 @end smallexample
4086
4087 Also add information on how to contact you by electronic and paper mail.
4088
4089 If the program is interactive, make it output a short notice like this
4090 when it starts in an interactive mode:
4091
4092 @smallexample
4093 Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
4094 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
4095 type `show w'.  This is free software, and you are welcome
4096 to redistribute it under certain conditions; type `show c' 
4097 for details.
4098 @end smallexample
4099
4100 The hypothetical commands @samp{show w} and @samp{show c} should show
4101 the appropriate parts of the General Public License.  Of course, the
4102 commands you use may be called something other than @samp{show w} and
4103 @samp{show c}; they could even be mouse-clicks or menu items---whatever
4104 suits your program.
4105
4106 You should also get your employer (if you work as a programmer) or your
4107 school, if any, to sign a ``copyright disclaimer'' for the program, if
4108 necessary.  Here is a sample; alter the names:
4109
4110 @smallexample
4111 @group
4112 Yoyodyne, Inc., hereby disclaims all copyright
4113 interest in the program `Gnomovision'
4114 (which makes passes at compilers) written 
4115 by James Hacker.
4116
4117 @var{signature of Ty Coon}, 1 April 1989
4118 Ty Coon, President of Vice
4119 @end group
4120 @end smallexample
4121
4122 This General Public License does not permit incorporating your program into
4123 proprietary programs.  If your program is a subroutine library, you may
4124 consider it more useful to permit linking proprietary applications with the
4125 library.  If this is what you want to do, use the GNU Library General
4126 Public License instead of this License.
4127
4128 @summarycontents
4129 @contents
4130 @bye