Fixed sortm(1) verbose message and man page to reflect that with
[mmh] / man / sortm.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH SORTM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 sortm \- sort messages
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B sortm
11 .RI [ +folder ]
12 .RI [ msgs ]
13 .RB [ \-all | \-noall ]
14 .RB [ \-datefield
15 .IR field ]
16 .RB [ \-textfield
17 .IR field ]
18 .RB [ \-notextfield ]
19 .RB [ \-limit
20 .IR days ]
21 .RB [ \-nolimit ]
22 .RB [ \-verbose " | " \-noverbose ]
23 .RB [ \-version ]
24 .RB [ \-help ]
25 .ad
26 .SH DESCRIPTION
27 .B Sortm
28 sorts the specified messages in the named folder according
29 to the chronological order of the \*(lqDate:\*(rq field of each message.
30 .PP
31 If no messages are specified, the default is all messages in the folder.
32 However, if no messages are specified and the
33 .B \-noall
34 switch is enabled, then
35 .B sortm
36 reports that as an error and exits with non-zero status.
37 .B \-noall
38 is most useful in the user's profile, to avoid inadvertant sorting of
39 an entire folder.  The
40 .B \-all
41 switch can then be used on the command line to disable it.  Of course,
42 a message specification of
43 .I all
44 can be used in any case.
45 .PP
46 The
47 .B \-verbose
48 switch directs
49 .B sortm
50 to tell the user the general
51 actions that it is taking to place the folder in sorted order.
52 .PP
53 The
54 .B \-datefield
55 .I field
56 switch tells
57 .B sortm
58 the name of the field to
59 use when making the date comparison.  If the user has a special field in
60 each message, such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq,
61 then the
62 .B \-datefield
63 switch can be used to direct
64 .B sortm
65 which field to examine.
66 .PP
67 The
68 .B \-textfield
69 .I field
70 switch causes
71 .B sortm
72 to sort messages by the specified text field.  All characters except
73 letters and numbers are stripped and the resulting strings are sorted
74 datefield\-major, textfield\-minor, using a case insensitive
75 comparison.  If this field is \*(lqsubject\*(rq, any leading "re:" is
76 stripped off.
77 .PP
78 With
79 .B \-textfield
80 .IR field ,
81 if
82 .B \-limit
83 .I days
84 is specified, messages
85 with the same textfields that are dated within `days' of each other
86 appear together.  Specifying
87 .B \-nolimit
88 makes the limit infinity.
89 With
90 .B \-limit
91 .IR 0 ,
92 the sort is instead simply textfield\-major.
93 .PP
94 For example, to order a folder by date-major, grouping messages with
95 the same subject on the same date together, use:
96 .PP
97 .RS 5
98 sortm -textfield subject +folder
99 .RE
100
101 .SH FILES
102 .fc ^ ~
103 .nf
104 .ta \w'%etcdir%/ExtraBigFileName  'u
105 ^$HOME/\&.mh\(ruprofile~^The user profile
106 .fi
107
108 .SH "PROFILE COMPONENTS"
109 .fc ^ ~
110 .nf
111 .ta 2.4i
112 .ta \w'ExtraBigProfileName  'u
113 ^Path:~^To determine the user's nmh directory
114 ^Current\-Folder:~^To find the default current folder
115 .fi
116
117 .SH "SEE ALSO"
118 folder(1)
119
120 .SH DEFAULTS
121 .nf
122 .RB ` +folder "' defaults to the current folder"
123 .RB ` msgs"' defaults to all without -noall, no default with -noall"
124 .RB ` \-all '
125 .RB ` \-datefield "' defaults to date"
126 .RB ` \-notextfield '
127 .RB ` \-noverbose '
128 .RB ` \-nolimit '
129 .fi
130
131 .SH CONTEXT
132 If a folder is given, it will become the current folder.  If the current
133 message is moved,
134 .B sortm
135 will preserve its status as current.
136
137 .SH HISTORY
138 Timezones used to be ignored when comparing dates: they aren't any more.
139 .PP
140 Messages which were in the folder, but not specified by `msgs', used to
141 be moved to the end of the folder; now such messages are left untouched.
142 .PP
143 .B Sortm
144 sometimes did not preserve the message numbering in a folder
145 (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after
146 sorting).  This was a bug, and has been fixed.  To compress the message
147 numbering in a folder, use
148 .RB \*(lq "folder\ \-pack" \*(rq
149 as always.
150
151 .SH BUGS
152 If
153 .B sortm
154 encounters a message without a date\-field, or if the
155 message has a date\-field that
156 .B sortm
157 cannot parse, then
158 .B sortm
159 attempts to keep the message in the same relative position.  This does
160 not always work.  For instance, if the first message encountered lacks
161 a date which can be parsed, then it will usually be placed at the end
162 of the messages being sorted.
163 .PP
164 When
165 .B sortm
166 complains about a message which it can't temporally
167 order, it complains about the message number
168 .B prior
169 to sorting.
170 It should indicate what the message number will be
171 .B after
172 sorting.