nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] [PATCH] scan message numbers from stdin


From: Eric Gillespie
Subject: Re: [Nmh-workers] [PATCH] scan message numbers from stdin
Date: Mon, 18 Aug 2008 11:53:20 -0700

Peter Maydell writes:

> Robert Elz wrote:
> >I'm not sure this is a great idea.
> 
> I'm not quite that negative about it, but...
> 
> >Fairly trivially, as documented in the proposed manual update, it
> >implies that
> >
> >     echo 1 2 3 4 5 | scan -
> >
> >would be the same as
> >
> >     scan 1 2 3 4 5

Actually, it will throw an error.  I've changed the man page to
clarify this:

If `-' is specified for
.RI msgs
.B scan
will read message numbers from the standard input and scan those.  Each line
must have exactly one message number.  Lines beginning with `+' are ignored.

So, you want

  printf '%s\n' 1 2 3 4 5 | scan -

> >but that isn't what the implementation does.
> 
> ...I do think that this isn't a good idea.
> 
> I think that it would be nice if 'scan 4 1 2' actually output the messages
> in the order stated on the command line. I also think that it would be

I, too, would rather 'scan 3 4' print the lines in that order
(first 3, then 4).  In any case, having scan - sort the messages
entirely defeats its purpose (scan as you go).

> better if all programs accepting multiple messages allowed you to specify
> '-' to read from standard input -- why should 'scan' in particular be
> special?

I suppose it shouldn't.  Which other commands should take the -?
Not show or repl; editors and pagers are likely not going to
appreciate standard input being connected to an empty pipe.
refile I suppose.  Hmm, 'foo | pick - | scan -' :)?  Sure, why
not?  Anything else?

> (Extra bonus UI question: if we make scan process messages in the order
> stated rather than always sorted order, what should 'scan sequencename'
> do if the sequence as defined in the .mh_sequences file isn't in order?)

I say it should scan messages in the order it finds them in
.mh_sequences, and mh itself should continue to write messages
into that file sorted.  If any sequence is listed with messages
in some non-sorted order, the user must have put them that way
for a reason.

> So I guess I like the idea but not the implementation.

Hmm, you didn't say a word above about the implementation.
You voted (unless I misread you) for scan not sorting the
messages, so I guess that's not what you're against (and even if
you were, that's a design choice, not implementation).  Can you
lay out your objections, so that I may address them in my patch,
or realize that the change is not going in?

-- 
Eric Gillespie <*> address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]