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

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

Re: Single-use keybindings?


From: Eric Abrahamsen
Subject: Re: Single-use keybindings?
Date: Sat, 22 Jul 2017 18:04:51 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> 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...
>
> See `set-transient-map'.  From (elisp) `Controlling Active Maps':

I suspected someone else would have wanted to do this, but I had no idea
it was that built-in! Thank you very much for the pointer.

E




reply via email to

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