zsh-workers
 help / color / mirror / code / Atom feed
From: lilydjwg <lilydjwg@gmail.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Bart Schaefer <schaefer@brasslantern.com>,
	Mikael Magnusson <mikachu@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: bad math expression error inside _pick_variant when running insert-all-matches for ls
Date: Tue, 29 Sep 2020 22:59:58 +0800	[thread overview]
Message-ID: <20200929145958.GA2519178@lilyforest.localdomain> (raw)
In-Reply-To: <43007-1601359815.927012@l4Ug.3FSk.dcnq>

On Tue, Sep 29, 2020 at 08:10:15AM +0200, Oliver Kiddle wrote:
> Bart Schaefer wrote:
> > I think the issue is that _insert_all_matches is expecting to be
> > called as a completer from inside _main_complete, not as a standalone
> > widget.
> 
> Yes, I think you're right.
> 
> > If we want _pick_variant to work in this context, we need PWS's patch,
> > but there may be other oddities as well.  Perhaps 20 years ago it was
> > OK to call _complete directly like that, but it's not OK any longer.
> 
> To create custom completion widgets that make use of the existing
> compsys system, bind to _generic and set the completer style.
> 
>   zstyle ':completion:all-matches::::' completer _all_matches _complete
>   zstyle ':completion:all-matches:*' old-matches true
>   zstyle ':completion:all-matches:*' insert true
>   zstyle ':completion:all-matches:*' file-patterns \
>       '%p:globbed-files' '*(-/):directories' '*:all-files'
>   zle -C all-matches complete-word _generic
>   bindkey '^Xx' all-matches
> 
> _generic dates to June 2000, _all_matches October of that year and my
> use of it, more-or-less like this, is the following year. I had zle -C
> directly binding _history before that but, as indicated in a comment, it
> was specifically designed to work either way. At some point I switched
> to using it via _generic too and that's what I'd recommend now.

Thanks! This code works without issues. But could zsh include such
a functionality itself, so that users need only to bind a key when they
want? This functionality helps me a lot, e.g. when removing system
packages sharing the same prefix.

BTW the mailing list archive seems not receiving any message after
Aug 2. (I was trying to keep a reference to your message.)

-- 
Best regards,
lilydjwg


  reply	other threads:[~2020-09-29 15:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 15:39 lilydjwg
2020-09-28 16:30 ` Mikael Magnusson
2020-09-28 16:47   ` Peter Stephenson
2020-09-28 16:51     ` Peter Stephenson
2020-09-28 17:02       ` Roman Perepelitsa
2020-09-28 17:06         ` Peter Stephenson
2020-09-28 17:51   ` lilydjwg
2020-09-28 20:42     ` Bart Schaefer
2020-09-29  6:10       ` Oliver Kiddle
2020-09-29 14:59         ` lilydjwg [this message]
2020-10-04 17:11           ` Daniel Shahaf

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=20200929145958.GA2519178@lilyforest.localdomain \
    --to=lilydjwg@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=opk@zsh.org \
    --cc=schaefer@brasslantern.com \
    --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).