[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
binding "<escape> <kp-delete>"
From: |
Maverick Woo |
Subject: |
binding "<escape> <kp-delete>" |
Date: |
Wed, 5 Jun 2013 16:57:23 -0700 (PDT) |
User-agent: |
G2/1.0 |
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.
- binding "<escape> <kp-delete>",
Maverick Woo <=