Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: print -S uses lexical history



On Tue, 31 May 2011 23:24:36 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 31,  9:37pm, Peter Stephenson wrote:
> }
> } As we've had all the pain of the HIST_LEX_WORDS option, which almost no
> } one is using, to split a history line into words using the lexical
> } analyser, it's worth making this available directly using a relative of
> } "print -s" imaginatively called "print -S".
> 
> This is nice, but I have to ask ... why not just make the behavior of
> "print -s" dependend on the current setting of the option?  In what
> circumstances would one wish to (be able to choose at the level of
> individual commands to) have part of the history in lexed form and
> part of it not?

"print -s" allows you to pick your own words; the different arguments
become the words in the history.  "print -S", on the other hand, takes a
single argument which is the entire command line that will be split.  It
didn't seem appropriate to me to change the behaviour of "print -s" to
do automatic splitting.

What would be a bit neater would be to be able to have the option for an
option, i.e. -s with a variant rather than a completely separate
option.  But we don't have anything like that.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author