🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mush
Article #295

Re: current message location after folder update

#295
From: Barton E. Schaefer
Date: Wed, 06 Dec 1989 17:22
34 lines
2427 bytes
In article <1989Dec6.031050.12607@semi.harris-atd.com> del@thrush.semi.harris-atd.com (Don Lewis) writes:
} It would be real nice if when a folder is updated, the current message
} location is preserved, rather than setting the current message back to
} the beginning of the folder.  This is gets a little tricky if the
} current message gets deleted from the folder in the update.  In this
} case, the current message should get set to the nearest following (or
} preceeding) message that will be saved in the folder.

It gets a little tricky if *any* messages preceding the current one are
deleted, let alone if the current one is deleted.  The current message
is stored only as an offset into an array of messages, and that array
is completely flushed and reloaded by an update.  It might be possible
to do some arithmetic in the process of re-writing the folder to compute
what the "new" current message number should be ....

In any case, you can create much the same effect yourself.

	cmd update '\
	eval -h set current_id = %i; \update;\
	pick -h message-id "$current_id" | from -'

By cmding "update" to call itself (note the backslash to prevent a
recursive cmd) you will cause *all three* modes (line, curses, tool)
to perform this operation!  The curses [update] command and toolmode
<Update> button will call your "update" cmd.  (I *hope* the "from -"
doesn't cause toolmode problems; it won't in the next release.)

Of course, not all messages in all folders have a message-id, so you might
choose some other highly-likely-to-be-unique field, like the date.
-- 
Bart Schaefer     "I seem to have run into a novel problem with the electronic
                       mail.  My computer's demanding an electronic female."
schaefer@cse.ogi.edu
(used to be cse.ogc.edu)                              "Preferably brunette."
Technical Details
Message-ID: <5995@ogicse.ogc.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caesar.cs.montana.edu!blake!ogicse!schaefer
References: <1989Dec6.031050.12607@semi.harris-atd.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caesar.cs.montana.edu!blake!ogicse!schaefer
From: schaefer@ogicse.ogc.edu (Barton E. Schaefer)
Newsgroups: comp.mail.mush
Subject: Re: current message location after folder update
Message-ID: <5995@ogicse.ogc.edu>
Date: 6 Dec 89 17:22:15 GMT
References: <1989Dec6.031050.12607@semi.harris-atd.com>
Reply-To: schaefer@ogicse.UUCP (Barton E. Schaefer)
Organization: Oregon Graduate Institute (formerly OGC), Beaverton, OR
Lines: 34