help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Single-use keybindings?


From: Michael Heerdegen
Subject: Re: Single-use keybindings?
Date: Mon, 24 Jul 2017 00:04:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> A few times I've found myself wanting the ability to set a single-use
> keybinding: the next time the user hits "q" (or what have you), run this
> command, then reset "q" to whatever it was before.
>
> This feels hacky, obviously, but more importantly it feels like I'm
> not using the right tools, or misusing what I've got. Has anyone else
> wanted to do this? Any better solutions? Maybe I should be using a minor
> mode that turns itself off after use, or...

After thinking about it: I implemented something like this myself.
Because resetting is tricky - and sometimes even something that you
don't want! - I just use a key binding that was unbound before.  So I
simply don't use any kind of resetting.  Hitting the key (again) when it
makes no sense may result in an error.  That's the case for other keys,
too, so...


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]