zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: menuselect and history
Date: Mon, 19 Apr 2004 13:14:14 -0700	[thread overview]
Message-ID: <040419131414.ZM10562@candle.brasslantern.com> (raw)
In-Reply-To: <7855.1082395211@trentino.logica.co.uk>

On Apr 19,  7:20pm, Oliver Kiddle wrote:
> 
> Bart wrote:
> > emulate -L zsh
> > zmodload -i zsh/parameter || return 1
> 
> I would tend to be inclined to use _generic to avoid needing such setup
> code.

Does that succeed in forcing menu-selection to always be used?  Normal
menu completion can't work here because you're completing multiple words
simultaneously -- one word (the command) is being replaced by many (the
whole command line, possibly many lines), and that confuses the heck out
of the completion system because the semantic context isn't the same in
all the "matches."  Hence this ...
> effectively operating outside of compsys, using raw compwid.
... is, in this case, partly intentional.

> I wonder if we should make #compdef -k, make widgets go through
> _generic somehow.

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
bindkey '^X:' history-select

_history_select() {
  # ... my original function body here ...
}

_generic "$@"
--- 8< --- snip --- 8< ---

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.


  reply	other threads:[~2004-04-19 20:14 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 [this message]
2004-04-20 13:17       ` Oliver Kiddle

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=040419131414.ZM10562@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).