From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id LAA27669 for ; Fri, 19 Jul 1996 11:17:30 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id VAA13168; Thu, 18 Jul 1996 21:11:08 -0400 (EDT) Resent-Date: Thu, 18 Jul 1996 21:11:08 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199607190054.CAA02547@hzoli.ppp.cs.elte.hu> Subject: Re: quoting of !'s in print -s: not! To: pws@ifh.de (Peter Stephenson) Date: Fri, 19 Jul 1996 02:54:42 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199607150945.LAA00445@hydra.ifh.de> from Peter Stephenson at "Jul 15, 96 11:45:07 am" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"meipE1.0.eD3.h2kxn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1702 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Somebody pointed this out to me a short while ago and I ought to > report it: print -s doesn't quote bangs correctly (indeed at all). > > % print -s echo \!hello\! > > % echo !hello! > zsh: event not found: hello! > > I suspect if anybody is going to alter this it will be Zoltan. I > don't now how easy it is. It is not too easy. One solution is to use doespandhist() with !" prepended to the string we are adding to the history (the lexer is unavoidable here since only unquoted bangs should be quoted and '!' shouldn't). For that we have to save/restore several zle variables to avoid surprises when print is called while zle is active. I think it is not really a bug. What happens is the given arguments are added to the history unchanged. Quoting may be undesirable sometions. E.g. single ! or != operators look better if they are left unquoted. Zoltan