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: Sun, 23 Jul 2017 14:28:38 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Emanuel Berg <moasen@zoho.com> writes:
>
>> Eric Abrahamsen wrote:
>>
>>> Maybe I should be using a minor mode that
>>> turns itself off after use
>>
>> You can, I've done exactly that! Create a copy
>> of the global-map and then
>> `substitute-key-definition' for a function
>> that, as you say, turns itself off after doing
>> its special thing.
>>
>> But when I did that, I didn't know of that
>> other thing mentioned already, which is
>> probably the right way to do it - only it seems
>> a bit complicated...
>
> If I was trying to do something more complicated, it might be worth
> looking into a minor mode. As it is, the transient key map is exactly
> what I was wanting.

Actually, it wasn't! The transient map disappears the first time any key
is hit that isn't in the map itself. What I wanted was to rewire "q",
and nothing but "q", until the first time that "q" is hit. I can
probably still get what I want by fooling with the KEEP-PRED argument to
`set-transient-map', but it's not the no-brainer I thought it was.




reply via email to

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