From: J J <yandmailj@yandex.com>
To: emacs-devel@gnu.org
Subject: Re: One character key bindings in editing buffers
Date: Mon, 30 Jul 2018 22:30:38 +0300 [thread overview]
Message-ID: <22430631532979038@myt4-74a8acfc13eb.qloud-c.yandex.net> (raw)
> Sounds like a good idea for a package, indeed (no way this can make it
> to a default behavior, OTOH).
Naturally, it should not be default behavior. It's an advanced
feature, so people should turn it on explicitly, so they know
what's going on.
>
> I recommend you try and avoid sit-for as much as possible (e.g. because
> it delays running other post-command-hooks).
> E.g. in char-hotkey-wait-for-end, better just set some global var to the
> current time, and then in char-hotkey compare that to the current time
> to see if 0.5s have elapsed.
Thanks, I didn't know that. For some reason I thought sit-for is
implemented with a callback or something behind the scenes, so
while it waits for input or elapsing time other code can keep on
running during that.
> Also, I'd recommend you use command remapping here:
Yes, that is one of the points which a proper package should
handle. In theory it's also possible that if you use some
punctuation mark for hotkey then it also already has an electric
or similar binding, not self-insert-command, though it's not
likely with letter hotkeys.
> Also, you can use the minor-mode map feature, so the key-bindings are
> automatically (de)activated:
>
Nifty. Makes things simpler.
next reply other threads:[~2018-07-30 19:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 19:30 J J [this message]
2018-07-30 22:14 ` One character key bindings in editing buffers Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2018-07-30 15:28 JJ
2018-07-30 17:49 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22430631532979038@myt4-74a8acfc13eb.qloud-c.yandex.net \
--to=yandmailj@yandex.com \
--cc=emacs-devel@gnu.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.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).