zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: PATCH: Handle completer filenames with funny characters in them
Date: Sat, 8 Jun 2024 17:49:22 +0200	[thread overview]
Message-ID: <CAHYJk3SUz4m=+qbrXBQ+9ps5dq1KboeA5QKU1HUfzWiD7hYZAQ@mail.gmail.com> (raw)
In-Reply-To: <0392B2D7-E833-4634-B237-76A833E2BEC8@kba.biglobe.ne.jp>

On Sat, Jun 8, 2024 at 3:56 PM Jun. T <takimoto-j@kba.biglobe.ne.jp> wrote:
>
>
> > 2024/03/19 0:17、Mikael Magnusson <mikachu@gmail.com>のメール:
> >
> > For example, a file called _foo;bar will cause this to happen:
> > % hello [press tab]zsh: command not found: _foo
> > zsh: command not found: bar
>
> With this patch the following has stopped working:
>
> % compdef '_files -g "*.h"' foo
> % foo <TAB>
> foo (eval):1: command not found: _files -g "*.h"
>
> > @@ -412,7 +412,7 @@ compdef() {
> >             svc=
> >             fi
> >             if [[ -z "$new" || -z "${_comps[$1]}" ]]; then
> > -              _comps[$cmd]="$func"
> > +              _comps[$cmd]="${(q)func}"
> >             [[ -n "$svc" ]] && _services[$cmd]="${1#*\=}"
> >           fi
>
> I don't know what is the best solution.
> Quote only if $func is a single word?,
> or quote only the first word of $func?

Hmm, I thought I was clever, but not clever enough. I should probably
move my quoting to the place that calls compdef with the filename
arguments instead of quoting it inside compdef.

-- 
Mikael Magnusson


      reply	other threads:[~2024-06-08 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 15:17 Mikael Magnusson
2024-06-08 13:55 ` Jun. T
2024-06-08 15:49   ` Mikael Magnusson [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='CAHYJk3SUz4m=+qbrXBQ+9ps5dq1KboeA5QKU1HUfzWiD7hYZAQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --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).