[comp.mail.mush] Sort by Date - time zones

crehta@tasu74.UUCP (Ran Ever-Hadani) (02/05/90)

How hard should it be to fix the folder sort-by-date to take
time zones into consideration?  With America 6-10 hours behind
us (so to speak) the date mix-up is an inconvenience, especially
in folders containing an e-mail conversation of the quick
on-line type;  all of my messages are put first, then all 
those of the other side.

Since there is no cut-and-paste function in mush to move messages
around in a folder (or is there?) I usually end up sorting the
messages manually with an editor.  I am not too happy about that.

-- Ran
-----------------------------------------------
Reply-To: crehta@taux01.nsc.com (Ran Ever-Hadani)
Disclaimer: The above is to be attributed to me only, not to any organization.
Apology: Bad English.  E-mailed spelling and style corrections are welcome.

schaefer@ogicse.ogc.edu (Barton E. Schaefer) (02/06/90)

In article <3257@taux01.UUCP> crehta@taux01.nsc.com (Ran Ever-Hadani) writes:
} How hard should it be to fix the folder sort-by-date to take
} time zones into consideration?

Mush currently does absolutely *nothing* with time zones -- it doesn't
even store them in its internal representation of the date.  I've begun
working on some code for timezones but it isn't anywhere near finished.
The main problem, after retrieving the timezone from any of the two dozen
different places it can appear in different date formats, is parsing all
the different symbolic forms.  That's what I've been working on.  Once
that's out of the way, it's only necessary to figure out how to munge
mush's internal date format to canonicalize the times.  Then the sort
function can finally get fixed.

} Since there is no cut-and-paste function in mush to move messages
} around in a folder (or is there?) I usually end up sorting the
} messages manually with an editor.  I am not too happy about that.

Of course you can cut and paste.  It just isn't obvious. :-}  No there's
no "cut"/"paste" command pair, though there will be eventually.  But you
can accomplish the same thing:

    cmd cut 'save -f \!* /tmp/cut$$ | d'
    cmd paste 'save \!* -$ {`:d`} /tmp/cut$$ | d; Paste'
    cmd Paste 'merge -N /tmp/cut$$'

Usage is

	cut [msg-list]		(cuts current message by default)
	paste number		(you *must* give a number)
	Paste			(appends at the end of the folder)

The cut message(s) are pasted above the message whose number is given.
This is a bit sloppy because it uses a temp file to do the rearranging.

You can also move messages "locally" by piping a range into sort:

    3-5 | sort d

sorts only messages 3-5 by date.  The sort must be contiguous, though --
you *can't* use "1 4 12 | sort".  If you can figure out a "pick" search
pattern that selects by GMT hours or somthing, you can use the cmds above
and do

    pick time-you-want | cut
    Paste | sort d			# note capital P

Or you can figure out the message numbers yourself and use sort criteria
other than the date to cause the local rearrangements you want.  Sort by
status is handy here; use the "flags" command to change the status of the
messages you want rearranged, sort by status, then restore the original
status with "flags" again.
-- 
Bart Schaefer          "February.  The hangnail on the big toe of the year."
                                                                    -- Duffy

schaefer@cse.ogi.edu (used to be cse.ogc.edu)

argv%turnpike@Sun.COM (Dan Heller) (02/06/90)

A small modification to bart's message -- he has:
>     cmd cut 'save -f \!* /tmp/cut$$ | d'
>     cmd paste 'save \!* -$ {`:d`} /tmp/cut$$ | d; Paste'
>     cmd Paste 'merge -N /tmp/cut$$'
But this doesn't take into account the fact that you may already have
deleted messages.  Instead, I recommend:

    cmd cut 'save -f \!* /tmp/cut$$ | d | set cut_msgs'
    cmd paste 'save \!* -$ { $cut_msgs } /tmp/cut$$ | d; Paste'

dan
-----------------------------------------------------------
		    O'Reilly && Associates
		argv@sun.com / argv@ora.com
	   632 Petaluma Ave, Sebastopol, CA 95472 
     800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104