From: Maverick Woo <maverick.woo@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: binding "<escape> <kp-delete>"
Date: Wed, 5 Jun 2013 16:57:23 -0700 (PDT) [thread overview]
Message-ID: <f3f462a8-157e-4fb9-b04b-f48adefa1a90@googlegroups.com> (raw)
This is Emacs 24.3 on OSX GUI.
The default installation maps kp-delete to 4 (C-d) in local-function-key-map. This works as intended. But if I press "<escape> <kp-delete>", it gets translated into "C-M-d", which is down-list for me. Instead, I want it to do a forward kill word.
The problem comes when I try to bind "<escape> <kp-delete>". The farthest I got is as follows, but it has a significant drawback:
1. erase it in local-function-key-map first:
(define-key local-function-key-map (kbd "<kp-delete>") nil)
2. to get back the no-modifier behavior, this works:
(global-set-key (kbd "<kp-delete>") 'delete-char)
3. suppose delete-word is the function I want to bind to:
(global-set-key (kbd "<escape> <kp-delete>") 'delete-word)
The problem with this method is I break the "<escape> ==> meta" translation. In particular, after step 3, the other keys like "<escape> x" will not get translated into M-x any more. So I think step 3 should not be done.
Any hint on how to bind "<escape><kp-delete>" properly?
Thanks.
next reply other threads:[~2013-06-05 23:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 23:57 Maverick Woo [this message]
2013-06-06 0:46 ` binding "<escape> <kp-delete>" Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f3f462a8-157e-4fb9-b04b-f48adefa1a90@googlegroups.com \
--to=maverick.woo@gmail.com \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.