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

Re: Global History Substitution



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Nov 4, 11:30am, Peter Stephenson wrote:
> } 
> } It does mean
> } 
> }   !!:s/foo/bar/:gs/this/that/
> } 
> } will change meaning, associating the g with the preceeding substitution
> 
> Do you mean the following substitution?

No, I did mean the preceeding; that was the change of meaning.  Before it
would have meant an s followed by a gs.  With the original proposal it
would have meant an s...:g followed by an s.

> } Hmm, how about
> } 
> }   !!:s/foo/bar/:G
> 
> Yes, I think that would be OK, especially because it also disambiguates
> !!:s/foo/bar/:Gs/this/that/ -- the :G can always apply to the preceding
> substitution and :g always to the following one.
> 
> That just leaves the question of whether the G is ignored in the case
> !!:Gs/foo/bar/ (where there is no preceding substitution).

I think it's probably simpler always to require g at the start and :G at
the end.  I'll commit it in that form.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



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