zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: pws@ifh.de (Peter Stephenson)
Cc: zsh-workers@math.gatech.edu
Subject: Re: quoting of !'s in print -s: not!
Date: Fri, 19 Jul 1996 02:54:42 +0200 (MET DST)	[thread overview]
Message-ID: <199607190054.CAA02547@hzoli.ppp.cs.elte.hu> (raw)
In-Reply-To: <199607150945.LAA00445@hydra.ifh.de> from Peter Stephenson at "Jul 15, 96 11:45:07 am"

> 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\!
> <up-arrow>
> % 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



      reply	other threads:[~1996-07-19  1:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-15  9:45 Peter Stephenson
1996-07-19  0:54 ` Zoltan Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199607190054.CAA02547@hzoli.ppp.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).