unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Single-use keybindings?
Date: Sun, 23 Jul 2017 14:28:38 -0700	[thread overview]
Message-ID: <87shhmq1vd.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87tw23m3mx.fsf@ericabrahamsen.net

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	other threads:[~2017-07-23 21:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-23  0:52 Single-use keybindings? Eric Abrahamsen
2017-07-23  1:00 ` Drew Adams
2017-07-23  1:04   ` Eric Abrahamsen
2017-07-23  1:22   ` Eric Abrahamsen
2017-07-23  5:51 ` Emanuel Berg
2017-07-23 18:04   ` Eric Abrahamsen
2017-07-23 21:28     ` Eric Abrahamsen [this message]
2017-07-23 21:45       ` Emanuel Berg
2017-07-23 22:09         ` Eric Abrahamsen
2017-07-23 22:04 ` Michael Heerdegen
2017-07-23 22:11   ` Emanuel Berg
2017-07-23 22:18   ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shhmq1vd.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).