[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The region allows you to conveniently process blocks of messages, but what if you want to handle an arbitrary set of messages? Af uses tags to let you mark a set of messages and process them quickly.
Tags are only available in mail buffers; they wouldn't make any sense in the minibuffer or the mail buffer.
13.1 Tag Concepts An introduction to af's tags. 13.2 Setting and Removing Tags How to set and remove tags. 13.3 Using Tags How you can process tagged messages.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A tag is a single-character mark which is set on a message. A message can have any number of tags set on it. There are two types of tags: system tags which are automatically set by af for various reasons, and user tags which you can set and unset yourself. You cannot set or remove system tags, but you can use them in exactly the same ways as you can user tags.
There are many commands which operate on tagged messages; and you can use either single tags or a combination of them to specify a set of messages to operate on. Tags are central to advanced use of af; they provide a way for you to easily set up a set of messages, which you can then work with in several ways.
13.1.1 System Tags Tags which reflect a message's status. 13.1.2 User Tags Tags which you can set and unset yourself. 13.1.3 Tag Lists Format of lists of tags to (un)set. 13.1.4 Tag Expressions Expressions you can use to select messages.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The system tags are all upper-case letters, which give information on the status of messages. The possible system tags are:
viewable-charsets
variable. When you read the message then it
will be displayed as usual, which may not be ideal.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The user tags you can use are the lower case letters, and `+'. `+' is sometimes called the default tag, since it is the default whenever you are asked about tags.
Normally, the user tags are considered transient, and are lost when you
exit af. If you would like to keep some or all of the tags across mail
reading sessions, then you can set the variable persistent-tags
to the tags you would like to be preserved. For example, setting the
value of persistent-tags
to `aeiou', would mean that the
user tags `a', `e', `i', `o', and `u' will be
preserved whenever you save a folder, but the other tags will be lost.
You cannot make the default tag (`+') persistent.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Whenever you are setting or removing tags, af will expect you to enter a tag list. Tag lists consist of one or more user tags, which may be separated by spaces. For example, `abcd' and `a b c d', both specify a list of four tags, `a', `b', `c', and `d'.
Whenever you are prompted for a tag list, you can just hit return to use the default tag (`+').
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When you are using tags to define a set of messages to apply some command to, you will be expected to enter a tag expression. That tag expression is then compared to the tags of each message in the buffer, and the command will operate on the message if the expression is true for that message. We often refer to the messages which match a tag expression as the tagset.
Tag expressions are made up of sub-expressions, which may be system or user tags. You can use operators to combine subexpressions, and build arbitrarily complex expressions. Any tag will evaluate to true if the message being checked has that tag set, false otherwise. The possible operators are, in decreasing precedence:
Here are some examples of tag expressions, with their meanings.
a & b | c & d |
True if `a' and `b' are both set, or `c' and `d' are both set.
a & (b | c) & d |
True if `a', `d', and either `b' or `c' are set.
a & !b |
True if `a' is set and `b' is not set.
a & !(b | c) |
True if `a' is set and neither of `b' or `c' are set.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
tag-message
).
untag-message
).
remove-tag
).
To tag the current message, use C-t t. You will be prompted for the tags to set; simply type in the tag list to set. The tags in the list will be added to those already set on the message.
To remove one or more tags from the current message use C-t u. You will be prompted for the tags to remove. The tags you specify will be removed from the message's tags.
To remove one or more tags from all the messages in the buffer, use C-t r. You will be prompted for the tags to remove. The tags you specify will be removed from all the messages in the buffer.
The experimental command M-x tag-thread tags RET tags all the messages in a thread of conversation, a set of messages which are all sent as replies to other related messages. (This is similar to the concept of threading found in most news readers.) This command works, but at the moment there are too many mail composers which don't include references to messages when they generate a reply, so that the threads are often broken by replies which af can't detect as a part of the thread. It is probably best not to use this command for the moment, unless you can be sure that all the participants are using a mail composer that does include references to messages in replies.
There is also a command to set tags on messages which match search criteria. See section 15.3 Tagging Matching Messages.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Once you have tagged messages in the region, you can use single tags or tag expressions to operate on them. Here are some of the ways in which you can operate on tagged messages:
kill-tagset
). See section 14. Killing and Yanking.
copy-tagset-as-kill
). See section 14. Killing and Yanking.
save-tagset
).
This command handles the argument in the same way as M-+
(save-message
). See section 11.1 Saving Messages.
print-tagset
). This command handles the argument in the same
way as M-p (print-message
). See section 11.2 Printing Messages.
pipe-tagset
). Again, this command handles
the argument in the same way as M-| (pipe-message
)
See section 11.3 Piping Messages.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |