VM User's Manual. Node: Sorting Messages

PREV Message Attributes UP Top NEXT Reading Digests

Chapter 11: Sorting Messages

In order to make numerous related messages easier to cope with, VM provides the command G (vm-sort-messages), which sort all messages in a folder using one or more sort keys. By default the actual order of the messages in the folder is not altered; that is if you looked at the folder file outside of VM the message order would be unchanged. VM numbers and presents the message in a different order internally. If you want the message order to be changed in the folder so that other programs can see the change, you can either invoke (vm-sort-messages) with a prefix argument, or you can set (vm-move-message-physically non-nil before sorting. Either way, VM will shift the actual messages around in the folder buffer, and when you save the folder, the order change will be visible to other programs.

Valid sort keys are: ``date'', ``reversed-date'', ``author'', ``reversed-author'', ``subject'', ``reversed-subject'', ``recipients'', ``reversed-recipients'', ``line-count'', ``reversed-line-count'', ``byte-count'', ``reversed-byte-count'', ``physical-order'', and ``reversed-physical-order''.

When sorting by subject (or threading using subjects, or killing messages by subject) the subject of the message is normalized before comparisons are done. A normalized subject has uninteresting prefixes and suffixes stripped off, and multiple consecutive whitespace characters collapsed to a single space. The variable vm-subject-ignored-prefix should be a regular expression that matches all strings at the beginning of a subject that you do not want to be considered when message subjects are compared. A nil value means VM should not ignore any prefixes. The analogous variable for subject suffixes is vm-subject-ignored-suffix.

Once the subject has been normalized, the variable vm-subject-significant-chars controls how much of what remains is considered significant for matching purposes. The first vm-subject-significant-chars will be considered significant. Characters beyond this point in the subject string will be ignored. A nil value for this variable means all characters in the subject are significant.

If you want to move messages around by hand, use C-M-n (vm-move-message-forward) and C-M-p (vm-move-message-backward). The default is to move the current message forward or backward by one message in the message list. A prefix argument n can specify a longer move. The value of vm-move-messages-physically applies to these commands.

  • Threading Using subjects and message IDs to group messages.
  • PREV Message Attributes UP Top NEXT Reading Digests