bb43993d5846a885102414aa5833d46873975f76
[mmh] / man / sortm.man
1 .\"
2 .\" %nmhwarning%
3 .\" $Id$
4 .\"
5 .\" include the -mh macro file
6 .so %etcdir%/tmac.h
7 .\"
8 .TH SORTM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
9 .SH NAME
10 sortm \- sort messages
11 .SH SYNOPSIS
12 .in +.5i
13 .ti -.5i
14 sortm
15 \%[+folder] \%[msgs]
16 \%[\-datefield\ field]
17 \%[\-textfield\ field]
18 .br
19 \%[\-notextfield]
20 \%[\-limit days] \%[\-nolimit]
21 \%[\-verbose]
22 .br
23 \%[\-noverbose]
24 \%[\-version]
25 \%[\-help]
26 .in -.5i
27 .SH DESCRIPTION
28 \fISortm\fR sorts the specified messages in the named folder according
29 to the chronological order of the \*(lqDate:\*(rq field of each message.
30
31 The `\-verbose' switch directs \fIsortm\fR to tell the user the general
32 actions that it is taking to place the folder in sorted order.
33
34 The `\-datefield\ field' switch tells \fIsortm\fR the name of the field to
35 use when making the date comparison.  If the user has a special field in
36 each message, such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq,
37 then the `\-datefield' switch can be used to direct \fIsortm\fR which
38 field to examine.
39
40 The `\-textfield\ field' switch causes \fIsortm\fR to sort messages
41 by the specified text field.  If this field is \*(lqsubject\*(rq, any
42 leading "re:" is stripped off.  In any case, all characters except
43 letters and numbers are stripped and the resulting strings are sorted
44 datefield\-major, textfield\-minor, using a case insensitive comparison.
45
46 With `\-textfield\ field', if `\-limit\ days' is specified, messages
47 with similar textfields that are dated within `days' of each other
48 appear together.  Specifying `\-nolimit' makes the limit infinity.
49 With `\-limit 0', the sort is instead made textfield\-major, date\-minor.
50
51 .\"Ex
52 For example, to order a folder by date-major, subject-minor, use:
53
54 .ti +.5i
55 sortm -textfield subject +folder
56
57 .Fi
58 ^$HOME/\&.mh\(ruprofile~^The user profile
59 .Pr
60 ^Path:~^To determine the user's nmh directory
61 .Ps
62 ^Current\-Folder:~^To find the default current folder
63 .Sa
64 folder (1)
65 .De
66 `+folder' defaults to the current folder
67 .Ds
68 `msgs' defaults to all
69 .Ds
70 `\-datefield date'
71 .Ds
72 `\-notextfield'
73 .Ds
74 `\-noverbose'
75 .Ds
76 `\-nolimit'
77 .Co
78 If a folder is given, it will become the current folder.  If the current
79 message is moved, \fIsortm\fR will preserve its status as current.
80 .Hi
81 Timezones used to be ignored when comparing dates: they aren't any more.
82
83 Messages which were in the folder, but not specified by `msgs', used to
84 be moved to the end of the folder; now such messages are left untouched.
85
86 \fISortm\fP sometimes did not preserve the message numbering in a folder
87 (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after
88 sorting).  This was a bug, and has been fixed.  To compress the message
89 numbering in a folder, use \*(lq\fIfolder\ \-pack\fR\|\*(rq as always.
90 .Bu
91 If \fIsortm\fR encounters a message without a date\-field, or if the
92 message has a date\-field that \fIsortm\fR cannot parse, then \fIsortm\fR
93 attempts to keep the message in the same relative position.  This does
94 not always work.  For instance, if the first message encountered lacks
95 a date which can be parsed, then it will usually be placed at the end
96 of the messages being sorted.
97
98 When \fIsortm\fR complains about a message which it can't temporally
99 order, it complains about the message number \fIprior\fR to sorting.
100 It should indicate what the message number will be \fIafter\fR sorting.
101 .En