nmh-workers
[Top] [All Lists]

Re: Unexpected behaviour of `pick'

1998-02-16 11:53:03
My inbox currently contains 1-100 and 104.  I was rather
surprised to see this behaviour, where given this
.mh_profile entry:

previous-sequence: bang

(I call it bang by analogy with the csh history mechanism)
it appears that `pick' sets bang to all.

I don't think pick _should_ set previous sequence at all,
and if it does it should be to the sequence that is picked.

$ foo=3D"`pick -from someuser`"
violet:/u/igb/oncore 09:40:47 (652)
$ cat ~/Mail/inbox/.mh_sequences=20
cur: 104
bang: 1-100 104

The previous-sequence is set to the messages that are the
argument to a command, not the result.

If you do not specifiy an message argument to pick, it defaults
to searching the whole folder.  That's why the previous-sequence
is set to everything.

If you want to put the results of pick into a sequence, then
use the -sequence switch

    pick -from someuser -seq picked

A better example of why the previous-sequence is set this way,
is if you wanted to make several consecutive pick's over the same
group of messages.

    pick -from user1 arg1 arg2 arg3 arg4 arg5
    pick -from user2 bang
    pick -from user3 bang
    pick -from user4 bang

As you can can, you want pick to be the argument to, not the
result of the previous pick.

--
Richard Coleman
coleman(_at_)math(_dot_)gatech(_dot_)edu


<Prev in Thread] Current Thread [Next in Thread>