## 8 Marking Messages ¶

VM provides a way to mark selected messages so that subsequent operations can be applied to them. This is similar to marking in other parts of Emacs, e.g., See Dired Marks, but arguably more powerful. For example, one can mark all messages from a particular sender and save them to a folder, or mark all messages with a particular subject and print them. One can also mark messages by searching for particular strings in their text.

To mark the current message, type `M M` (`vm-mark-message`). If you give a numeric prefix argument n, the next n-1 messages will be marked as well. A negative prefix argument means mark the previous n-1. An asterisk (‘`*`’) will appear to the right of the message numbers of all marked messages in the summary window.

To remove a mark from the current message, use `M U` (`vm-unmark-message`). Prefix arguments work as with `vm-mark-message`.

Use `M m` to mark all messages in the current folder; `M u` removes marks from all messages.

Other marking commands:

`M C (`vm-mark-matching-messages`)` ¶

  Mark all messages matched by a virtual folder selector. See Virtual Folders.

`M c (`vm-unmark-matching-messages`)`

  Unmark all messages matched by a virtual folder selector.

`M T (`vm-mark-thread-subtree`)`

  Mark all messages in the thread tree rooted at current message. See Threading.

`M t (`vm-unmark-thread-subtree`)`

  Unmark all messages in the thread tree rooted at current message.

`M S (`vm-mark-same-subject`)`

  Mark messages with the same subject as the current message.

`M s (`vm-unmark-same-subject`)`

  Unmark messages with the same subject as the current message.

`M A (`vm-mark-same-author`)`

  Mark messages with the same author as the current message.

`M a (`vm-unmark-same-author`)`

  Unmark messages with the same author as the current message.

While the above commands can be used in any VM buffer, the following commands can be used in a Summary buffer to mark or unmark a region of message summary lines.

`M R (`vm-mark-summary-region`)` ¶

  Mark all messages in the current region in a Summary buffer

`M r (`vm-unmark-summary-region`)`

  Unmark all messages in the current region in a Summary buffer

To apply a VM command to all marked messages you must prefix it with the key sequence `M N` (`vm-next-command-uses-marks`). The next VM command will apply to all marked messages, provided the command can be applied to such messages in a meaningful and useful way. Unfortunately, as of this writing, this mechanism works only if the next command invoked is a keyboard command. Commands invoked by `M-x` are unable to access the marked messages. So, to invoke a complex command, you might temporarily bind it to an unused key, e.g.,

    M-x local-set-key C vm-forward-message-all-headers
    M N C

forwards marked messages with all headers included.

It is possible to use marking to execute operations on message threads. For example, the sequence of key strokes:

    MuMTMNsMu

saves a thread of messages. However, there are faster methods to operate on message threads. See Thread Operations.