zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Users" <zsh-users@sunsite.dk>
Subject: Re: Problem with motion commands defined using match-word-by-style used with vi-delete
Date: Sat, 22 Apr 2006 23:09:29 -0700	[thread overview]
Message-ID: <060422230929.ZM9841@torch.brasslantern.com> (raw)
In-Reply-To: <dbfc82860604221438i51d3a8e0tc06b0b5c90d40cb6@mail.gmail.com>

On Apr 22, 11:38pm, Nikolai Weibull wrote:
}
} I'm positive that there's a way to do this, but I can't see it, so any
} help is welcome.

In the short term, I think it'd work to reset $WIDGET yourself:

    local WIDGET=$motion_command
    zle $motion_command -n $count

} I'm sure it'll break all kinds of stuff, but one solution would be to
} have getvirange() set bindk to k2 once it has been read and checked.

I don't think that's sufficient.  getvirange() would have to fiddle with
saving and restoring some other state around the call to execzlefunc().

} Also, it would be great if we had a switch for bindkey that made it
} print the widgets name, nothing else.

It' be better if we had a $bindings associative array to go with $keymaps
and $widgets, and a zle function along the lines of recursive-edit except
it reads only one binding.  For example, it's rather messy to reimplement
describe-key-briefly in the shell:

  describe-key-briefly() {
    setopt localoptions extendedglob
    local -a bound rebound
    local b f=__-get-widget-name
    bindkey -N __ $KEYMAP
    bound=( ${${(f)"$(bindkey -M __ -L)"}/(#b)([^[:space:]]#)(#e)/__-$match} )
    rebound=( ${(u)bound##* } )
    function $f {
      zle -M "${(V)KEYS} is ${WIDGET#__-}"
      zle .accept-line	# end recursive-edit
    }
    for b in $rebound
    do
      zle -N $b $f
    done
    eval "${(j:;:)bound}"
    # Cf. read-from-minibuffer if you insist on having
    # correct cursor placement during this prompt
    zle -M "Describe key briefly: "
    zle .recursive-edit -K __
  }

This may suggest another way to implement vi-delete-match, though.  Hmm.


  reply	other threads:[~2006-04-23  6:09 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 [this message]
     [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

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=060422230929.ZM9841@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).