zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: menuselect and history
Date: Tue, 20 Apr 2004 15:17:59 +0200	[thread overview]
Message-ID: <9203.1082467079@trentino.logica.co.uk> (raw)
In-Reply-To: <040419131414.ZM10562@candle.brasslantern.com>

Bart wrote:

> Does that succeed in forcing menu-selection to always be used?  Normal

It depends on your menu style just like normal completion.

> menu completion can't work here because you're completing multiple words

I don't think there's a way round that. It's unfortunate for a number
of reasons that completion forces initial splitting on shell words.

> That can be solved by having the function redefine itself like so:
> 
> --- 8< --- snip --- 8< ---
> #compdef -k menu-select ^X:
> zle -C history-select menu-select _generic
> zstyle ':completion:history-select::::' completer _history_select

The trouble with this is that it is forcing a particular completer
style on you. Often it is useful to be able to add other completers
like _menu and _match to the list. Though you could contrive a more
specific context, I don't really like the idea of defining styles
behind people's back like this. The fact that they are defined when the
widget is invoked makes this even worse. It makes it very hard if you
want to override the settings, perhaps to use different key bindings
from the default.

I'd prefer to find another way to communicate the default completer to
_main_complete. We could keep them in an associative array or could
even use _${WIDGET/-/_}. The other problem is knowing when to use the
default completer list and when to use the completer style. All too
often, zstyle will return the user's default completer.

It seems that setting up sensible defaults while maintaining
configurability is going to be hard.

> Presumably `compdef' could be fixed up to do the equivalent when passed
> the correct options.  I'd recommend leaving -k as it is and adding a new
> option to automatically apply the _generic wrapper.

Yes a new option is probably necessary to maintain backward
compatibility.

Oliver


      reply	other threads:[~2004-04-20 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040419095235.GA1285@kopfermann.org>
     [not found] ` <040419092341.ZM10180@candle.brasslantern.com>
2004-04-19 17:20   ` Oliver Kiddle
2004-04-19 20:14     ` Bart Schaefer
2004-04-20 13:17       ` Oliver Kiddle [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=9203.1082467079@trentino.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /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).