html2
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A virtual folder is a mapping of messages from one or more real folders into a container that in most ways acts like a real folder but has no real existence outside of VM. You can have a virtual folder that contains a subset of messages in a real folder or several real folders. A virtual folder can also contain a subset of messages from another virtual folder.
A virtual folder is defined by its name, the folders that it contains
and its selectors. The variable vm-virtual-folder-alist
is a list of
the definitions of all named virtual folders. In order to visit a
virtual folder with the vm-visit-virtual-folder
(V V) command,
a virtual folder must have an entry in vm-virtual-folder-alist.
Each virtual folder definition should have the following form:
(VIRTUAL-FOLDER-NAME ( (FOLDER ...) (SELECTOR [ARG ...]) ... ) ... ) |
VIRTUAL-FOLDER-NAME is the name of the virtual folder being defined. This is the name by which you and VM will refer to this folder.
FOLDER should be the specification of a real folder: a file path for a local folder or a maildrop specification for a POP/IMAP folder. There may be more than one FOLDER listed, the SELECTORs within that sublist will apply to them all. If FOLDER is a directory, VM will assume this to mean that all the folders in that directory should be searched.
The SELECTOR is a Lisp symbol that tells VM how to decide whether a message from one of the folders specified by the FOLDER-NAMEs should be included in the virtual folder. Some SELECTORs require an argument ARG; unless otherwise noted, ARG may be omitted.
any
matches any message.
author
matches message if ARG matches the author; ARG should be a regular expression.
author-or-recipient
matches message if ARG matches the author of the message or any of its recipients; ARG should be a regular expression.
recipient
matches message if ARG matches any part of the recipient list of the message. ARG should be a regular expression.
outgoing
matches message if your are the author of it, i.e. if the author matches
vm-summary-uninteresting-senders
in-bbdb
matches if the addresses from the message are in the BBDB. With an option first argument you might select the address class and with an optional second argument if only the first address should be checked.
(in-bbdb authors) |
(in-bbdb recipients t) |
subject
matches message if ARG matches any part of the message’s subject; ARG should be a regular expression.
text
matches message if ARG matches any part of the text portion of the message; ARG should be a regular expression.
sent-after
matches message if it was sent after the date ARG. A fully specified date looks like this:
``31 Dec 1999 23:59:59 GMT'' |
although the parts can appear in any order. You can leave out any part and it will default to the current date’s value for that part, with the exception of the ‘hh:mm:ss’ part which defaults to midnight.
sent-before
matches message if it was sent before the date ARG. A fully specified date looks like this:
``31 Dec 1999 23:59:59 GMT'' |
although the parts can appear in any order. You can leave out any part and it will default to the current date’s value for that part, with the exception of the hh:mm:ss part which defaults to midnight.
older-than
matches message if it is more than ARG days old
newer-than
matches message if it is at most ARG days old
header
matches message if ARG matches any part of the header portion of the message; ARG should be a regular expression.
header-or-text
matches message if ARG matches any part of the headers or the text portion of the message; ARG should be a regular expression.
spam-score
matches message if its spam score is at least ARG. See
vm-vs-spam-score-headers
for configuration.
spam-word
matches message if it contains a word from vm-spam-words-file
deleted
matches message if it is flagged for deletion.
undeleted
matches message if it has not been deleted.
edited
matches message if it has been edited.
unedited
matches message if it has not been edited.
filed
matches message if it has been saved with its headers.
unfiled
matches message if it has not been saved with its headers.
written
matches message if it has been saved without its headers.
new
matches message if it is new.
recent
matches message if it is new. Same as the new
selector.
read
matches message if it is neither new nor unread.
unread
matches message if it is not new and hasn’t been read.
unseen
matches message if it is not new and hasn’t been read.
Same as the unread
selector.
replied
matches message if it has been replied to.
answered
matches message if it has been replied to. Same as the replied
selector.
unreplied
matches message if it has not been replied to.
unanswered
matches message if it has not been replied to.
Same as the unreplied
selector.
forwarded
matches message if it has been forwarded using
a variant of vm-forward-message
or vm-send-digest
.
unforwarded
matches message if it has not been forwarded using
vm-forward-message
or vm-send-digest
or one
of their variants.
redistributed
matches message if it has been redistributed using
vm-resend-message
.
unredistributed
matches message if it has not been redistributed using
vm-resend-message
.
marked
matches message if it is marked, as with
vm-mark-message
.
attachment
matches if a message contains an attachment resp. its text matched
vm-vs-attachment-regexp
less-chars-than
matches message if message has less than ARG characters. ARG should be a number.
less-lines-than
matches message if message has less than ARG lines. ARG should be a number.
more-chars-than
matches message if message has more than ARG characters. ARG should be a number.
more-lines-than
matches message if message has more than ARG lines. ARG should be a number.
eval
matches message if evaluating the sexpr ARG yields t
.
and
matches the message if all its argument selectors match the message. Example:
(and (author "Derek McGinty") (new)) |
matches all new messages from Derek McGinty.
and
takes any number of arguments.
not
matches message only if its selector argument does NOT match the message. Example:
(not (deleted)) |
matches messages that are not deleted.
or
matches the message if any of its argument selectors match the message. Example:
(or (author "Dave Weckl") (subject "drum")) |
matches messages from Dave Weckl or messages
with the string “drum” in their Subject header.
or
takes any number of arguments.
folder-name
matches message if it is from a folder matching ARG
virtual-folder-member
matches message if the message is already a member of some virtual folder currently being visited.
vm-mode
matches the message if in vm-mode and one of its argument selectors match the message.
mail-mode
matches the message if in mail-mode and one of its argument selectors match the message.
Here is an example that you may find useful as a template to create virtual folder definitions.
(setq vm-virtual-folder-alist '( ;; start virtual folder definition ("virtual-folder-name" (("/path/to/folder" "/path/to/folder2") (header "foo") (header "bar") ) (("/path/to/folder3" "/path/to/folder4") (and (header "baz") (header "woof")) ) ) ;; end of virtual folder definition ) ) |
The text
selector provides a particularly effective way to search
for strings in messages. It is better than the
vm-isearch-forward/backward
functions because it avoids searching
inside encoded attachments, hence faster.
Again, you visit virtual folders you have defined in
vm-virtual-folder-alist
with V V. Once you’ve
visited a virtual folder most VM commands work as they do in a
normal folder. There are exceptions. If you use S
(vm-save-folder
, the folder save command will be invoked
on each real folder in turn. Similarly if you use g
(vm-get-new-mail
in a virtual folder, mail is retrieved
from the spool files associated with each of the real folders.
If any of the retrieved messages are matched by the virtual
folder’s selector, they will be added to the virtual folder.
These commands will signal an error when invoked if the current folder is a virtual folder:
vm-save-buffer vm-write-file vm-change-folder-type vm-expunge-imap-messages vm-expunge-pop-messages |
Normally messages in a virtual folder share attributes with the
underlying real messages. For example, if you delete a message
in a virtual folder, it is also flagged as deleted in the real
folder. If you then run vm-expunge-folder
in the virtual folder,
the deleted message is expunged from the virtual folder and from
the real folder. Labels are shared between virtual and real
messages. However virtual folders have their own set of message
marks.
To make virtual folders not share message attributes with real
folders by default, set the variable vm-virtual-mirror
to nil.
This should be done in your VM init file and you should use
setq-default
, as this variable is automatically local to all
buffers.
(setq-default vm-virtual-mirror nil) |
If you want to change whether the currently visited virtual
folder shares attributes with the underlying real folders, use the
command vm-toggle-virtual-mirror
(bound to V M). If the
virtual folder is currently sharing attributes it will no longer
be. If it is not sharing attributes with the underlying folders
then it will be.
The command vm-create-virtual-folder
(bound to V C) lets
you interactively create a virtual folder from the messages of
the current folder, using exactly one selector to choose the
messages. If you type V C header RET pigs, VM will create
a folder containing only those messages that contain the string
‘pigs’ in the header.
The command vm-apply-virtual-folder
(bound to V X) tries
the selectors of a named virtual folder against the messages of
the current folder and creates a virtual folder containing the
matching messages.
The keys V S and V A invoke
vm-create-virtual-folder-same-subject
and
vm-create-virtual-folder-same-author
which create virtual folders
containing all the messages in the current folder with the same
subject or author as the current message.
The keys V O vm-virtual-omit-message
will omit a message from the
virtual folder and V U vm-virtual-update-folders
will force an
update of the virtual folder.
M-x vm-virtual-check-selector-interactive allows to test selectors interactively and will emit debug information when called with a prefix argument.
Automatic marking of messages for deletion based on a selector can be
achieved with vm-virtual-auto-delete-message
for interactive use and the
function and vm-virtual-auto-delete-messages
when added to the VM hook
vm-arrived-messages-hook
. This can be quite handy for marking spam for
deletion.
M-x vm-virtual-save-message can be used to save messages to the
folder corresponding to the first matching selector and the function
vm-virtual-auto-archive-messages can file messages based on
selectors (see also vm-auto-archive-messages
).
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by root on April 29, 2013 using texi2html 1.82.