all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* One character key bindings in editing buffers
@ 2018-07-30 15:28 JJ
  2018-07-30 17:49 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: JJ @ 2018-07-30 15:28 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/html, Size: 4294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: One character key bindings in editing buffers
@ 2018-07-30 19:30 J J
  2018-07-30 22:14 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: J J @ 2018-07-30 19:30 UTC (permalink / raw)
  To: emacs-devel


> 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.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-30 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-30 15:28 One character key bindings in editing buffers JJ
2018-07-30 17:49 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2018-07-30 19:30 J J
2018-07-30 22:14 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.