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