zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: contect sensitive remapping <enter>
Date: Sat, 5 Jun 2004 12:10:48 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0406051136500.18277-100000@toltec.zanshin.com> (raw)
In-Reply-To: <20040525090231.GA5701@fruitcom.com>

[I'm just back from 3 weeks in Japan, and catching up on mail sort of in
reverse order.]

On Tue, 25 May 2004, Eric Smith wrote:

> I would like to do a context sensitive remapping of <enter>.

Unfortunately there's no such thing as context-sensitive key rebinding.
There are certain "contexts" that change to new keymaps, but those are
effectively recursive invocations of the editor, not contexts in the sense
used by the completion system.

So the best you can do is to redefine the accept-line widget to always
test for this situation, invoke completion if need be, and then fall
through to "zle .accept-line".

> I guess this would be along the lines of a completion function

You'd need an ordinary widget for the accept-line replacement, plus a
completion widget to handle the context testing and possible completion.
Call the completion widget from the accept-line replacement with the
"zle" command.

I'd start by getting ordinary completion to work as you want for the
commands in question before attempting anything with accept-line.


      reply	other threads:[~2004-06-05 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-25  9:02 Eric Smith
2004-06-05 19:10 ` Bart Schaefer [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=Pine.LNX.4.44.0406051136500.18277-100000@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).