From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: repeatable vs. non-repeatable commands
Date: Sun, 25 Jun 2017 06:56:45 +0200 [thread overview]
Message-ID: <87mv8wk6lu.fsf@drachen> (raw)
In-Reply-To: <86podtya9v.fsf@zoho.com> (Emanuel Berg's message of "Sat, 24 Jun 2017 12:01:32 +0200")
Emanuel Berg <moasen@zoho.com> writes:
> (define-prefix-command 'C-o-prefix)
> (global-set-key "\C-o" 'C-o-prefix)
>
> (global-set-key "\C-od" (lambda () (interactive) (message "d")))
> (global-set-key "\C-oD" (lambda () (interactive) (message "D")))
>
> ... no?
That only solves the easy part (defining a prefix key), but not the
hard. The heard part is:
(global-set-key "\C-od" #'the-function)
should make C-o d d message "d" two times. But with the same named
command, binding
(global-set-key "\C-D" #'the-function)
(that is, control-shift-d) should not make typing C-D d message "d" two
times. Instead, only C-D should call the command, and the following d
is not special (i.e. calls self-insert-command). That means, I need to
decide whether I have to establish a transient map in the body of
`the-function' base on the keys hit, and how I can do that correctly is
my question.
Thanks,
Michael.
next prev parent reply other threads:[~2017-06-25 4:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-24 6:17 repeatable vs. non-repeatable commands Michael Heerdegen
2017-06-24 10:01 ` Emanuel Berg
2017-06-25 4:56 ` Michael Heerdegen [this message]
2017-06-25 15:53 ` Emanuel Berg
2017-06-26 13:49 ` Michael Heerdegen
2017-06-24 10:22 ` Emanuel Berg
2017-06-25 4:59 ` Michael Heerdegen
2017-06-25 16:22 ` Emanuel Berg
2017-06-24 13:23 ` Stefan Monnier
2017-06-26 15:31 ` Michael Heerdegen
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=87mv8wk6lu.fsf@drachen \
--to=michael_heerdegen@web.de \
--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).