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