[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: One character key bindings in editing buffers
From: |
J J |
Subject: |
Re: One character key bindings in editing buffers |
Date: |
Mon, 30 Jul 2018 22:30:38 +0300 |
> 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.