zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayne@opencoder.net>
To: Zsh list <zsh-workers@zsh.org>
Subject: Non-escaped special chars from var expansion
Date: Fri, 2 Nov 2018 13:39:26 -0700	[thread overview]
Message-ID: <CAHSx_Svj04+0L2Lcxymegscn9aG+fsuE6jnv7cQvD67oprE1mA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

Hi, folks! Long time no see...

I have a particular compinit setup where special-chars from a var (other
than spaces) are not backslash-escaped.  To duplicate:

zsh -f
autoload -Uz compinit
compinit
zstyle ':completion:*' completer _oldlist _expand _complete _match _ignored
_files _prefix
zstyle ':completion:*:expand:*' tag-order all-expansions
bindkey -e
bindkey '\t' complete-word
mkdir 'foo; bar (baz)'
cd !:1
cd $PWD<tab>

The result is "cd foo;\ bar\ (baz)" instead of "cd foo\;\ bar\ \(baz\)". If
the <tab> instead executes expand-or-complete rather than complete-word
then it is expanded correctly, but I like to avoid var expansion in a path
unless I'm expanding the var itself (e.g. I don't want "vim
$OLDPWD/fname<TAB>" to expand $OLDPWD since I'm not tabbing right next to
the var).

The bug has been around for ages, and is still in the current git source.
I'm guessing that the _expand script needs a tweak, but I didn't see what
might be wrong after a quick glance.

..wayne..

             reply	other threads:[~2018-11-02 20:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 20:39 Wayne Davison [this message]
2018-11-02 22:06 ` Peter Stephenson
2018-11-03 19:49   ` Peter Stephenson
2018-11-02 23:21 ` Wayne Davison
2019-11-17  6:00 ` Wayne Davison

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=CAHSx_Svj04+0L2Lcxymegscn9aG+fsuE6jnv7cQvD67oprE1mA@mail.gmail.com \
    --to=wayne@opencoder.net \
    --cc=zsh-workers@zsh.org \
    /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).