zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete
Date: Mon, 24 Apr 2006 20:06:11 -0700	[thread overview]
Message-ID: <060424200611.ZM996@torch.brasslantern.com> (raw)
In-Reply-To: <dbfc82860604241239q34ee602an680fd20611d52018@mail.gmail.com>

On Apr 24,  9:39pm, Nikolai Weibull wrote:
} Subject: Re: Problem with motion commands defined using match-word-by-styl
}
} On 4/24/06, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
} >
} > Here's a simple internal widget that reads a key sequence and sets
} > REPLY to the command bound to it (so you can run zle on that).

[Hmm, somehow I managed to miss PWS's message.  I wonder if it was a
victim of Verizon's latest overeager spam-blocking fiasco.]

This is actually quite useful as it resets KEYS as well as sets REPLY,
so with this you can do

    describe-key-briefly() {
      zle -R "Describe key briefly: "
      zle read-command
      zle -M "${(V)KEYS} is $REPLY"
    }

That doesn't help with describe-binding, which needs to map in the
other direction, but it's a start.

Incidentally I just noticed that within a widget called by using
execute-named-command, the value of $KEYS is carriage return.  I'm not
sure what I expected it to be, but that wasn't it.

} There's still no easy way to execute the command in the right
} environment so that WIDGET is set to the read command that we want to
} execute.

It really *should* be the case that

    local -h WIDGET

creates a new parameter named WIDGET that is neither read-only nor
special, but apparently the usual parameter rules don't apply to the
ZLE specials.


      reply	other threads:[~2006-04-25  3:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 23:10 Nikolai Weibull
2006-04-22  5:00 ` Bart Schaefer
2006-04-22 11:04   ` Nikolai Weibull
2006-04-22 18:35     ` Bart Schaefer
2006-04-22 21:38       ` Nikolai Weibull
2006-04-23  6:09         ` Bart Schaefer
     [not found]           ` <dbfc82860604230157h52f91585ncfd5a984a1a08c67@mail.gmail.com>
2006-04-23 15:53             ` Bart Schaefer
2006-04-23 16:13               ` Nikolai Weibull
2006-04-23 23:08               ` Peter Stephenson
2006-04-24 19:39                 ` Nikolai Weibull
2006-04-25  3:06                   ` 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=060424200611.ZM996@torch.brasslantern.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).