[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 11:04:06 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
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.
> If you succeed with a small snippet, feel free
> to post it here!
My previous message had it -- in fact, the revised version of the
function didn't look a whole lot different from my original version! But
it feels less fragile, and I'm more confident I'm DTRT.
Eric
Re: Single-use keybindings?, Michael Heerdegen, 2017/07/23