From: Mikael Magnusson <mikachu@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: How can I debug lost keyboard input?
Date: Thu, 20 Sep 2018 12:10:56 +0200 [thread overview]
Message-ID: <CAHYJk3Q1SEcjsqkU3idwDjFMX=fv+xJ=cZjbNGtAX_PwHeukSQ@mail.gmail.com> (raw)
In-Reply-To: <20180919182732.6h4ytozjg4vt2bud@spiegl.de>
On Wed, Sep 19, 2018 at 8:27 PM, Andy Spiegl <zsh.Andy@spiegl.de> wrote:
>> Any ideas how I can debug this?
> Unfortunately I still don't know a good way to debug problems like that.
> This time, I found the solution by reading zsh man pages over and over. :-)
>
>> BTW if I bind the functions to a different key the same thing happens.
>> Uhm, as if the function would have to be loaded/initialized on the first try?
>
> Turned out to be exactly that. On the first call the function file is
> loaded and the function initialized but NOT executed. So, I added the line
> "zle finer-forward-word" at the end of the function file - after the
> function definition. And now it works as expected again. zsh's default
> behavior of this must have changed recently, right?
>
> --------
> finer-forward-word() {
> local WORDCHARS=$WORDCHARS_FINER
> zle forward-word
> }
> zle finer-forward-word
> --------
>
> But is that the "correct" way to do it or just a dumb workaround?
Your mails are somewhat unclear, but if you have these functions
defined in autoloadable files then they should look as following
% cat finer-forward-word
local WORDCHARS=$WORDCHARS_FINER
zle forward-word
Ie, do not include the "finer-forward-word() {" and "}" lines in the
file. Your original versions probably work if you use autoload -k, but
you don't show your autoload lines at all in the example.
--
Mikael Magnusson
next prev parent reply other threads:[~2018-09-20 10:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 18:42 Andy Spiegl
2018-09-19 18:27 ` Andy Spiegl
2018-09-19 19:42 ` Jérémie Roquet
2018-09-20 9:47 ` Andy Spiegl
2018-09-20 10:10 ` Mikael Magnusson [this message]
2018-09-20 10:19 ` Andy Spiegl
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='CAHYJk3Q1SEcjsqkU3idwDjFMX=fv+xJ=cZjbNGtAX_PwHeukSQ@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=zsh-users@zsh.org \
/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).