* Problem setting the key \¤
@ 2009-06-11 8:07 Nordlöw
2009-06-11 14:08 ` Xah Lee
0 siblings, 1 reply; 2+ messages in thread
From: Nordlöw @ 2009-06-11 8:07 UTC (permalink / raw)
To: help-gnu-emacs
I am trying to set the key meta-¤ (to the left of % on my swedish
keyboard) like follows:
(global-set-key [(meta \¤)] 'regexpl-search-replace-list)
but it doesn't work, nothing happens when I press the combination. Why
is that when the following works:
(global-set-key [(meta \&)] 'query-replace-regexp)
Thanks in advance,
Nordlöw
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem setting the key \¤
2009-06-11 8:07 Problem setting the key \¤ Nordlöw
@ 2009-06-11 14:08 ` Xah Lee
0 siblings, 0 replies; 2+ messages in thread
From: Xah Lee @ 2009-06-11 14:08 UTC (permalink / raw)
To: help-gnu-emacs
On Jun 11, 1:07 am, Nordlöw <per.nord...@gmail.com> wrote:
> I am trying to set the key meta-¤ (to the left of % on my swedish
> keyboard) like follows:
>
> (global-set-key [(meta \¤)] 'regexpl-search-replace-list)
>
> but it doesn't work, nothing happens when I press the combination. Why
> is that when the following works:
> (global-set-key [(meta \&)] 'query-replace-regexp)
>
> Thanks in advance,
> Nordlöw
not sure what's the problem. I've switched to kbd notation for all my
keybinding needs, because that way, you have a sure way to know what
the notation would be like, by calling the command describe-key. In
your case, perhaps try that.
I did notice some inconsistencies even with this, especially when
defining a non alphanumeric key. Here's a little write up:
-----------
Note: A keypress-combination such as “Meta+Shift+2” can also be
considered as “Meta+@”. So, in emacs, you might be thinking that both
of these code: “(kbd "M-S-2")” and “(kbd "M-@")” will work. Actually,
only the latter will work.
When writing a keybinding definition, for a key combination that
involves “Meta+Shift+‹key›”, you must use a version without the shift
key if possible. For keybinding involving “Ctrl+Shift+‹letter›”, you
must use the "-S". Examples:
GOOD BAD Keystroke
(kbd "M-A") (kbd "M-S-a") Meta+Shift+a
(kbd "M-@") (kbd "M-S-2") Meta+Shift+2
(kbd "M-:") (kbd "M-S-;") Meta+Shift+;
(kbd "C-S-a") (kbd "C-A") Ctrl+Shift+a
A easy way to find out the proper syntax, is to call “Alt+x describe-
key”, then type the keystroke.
Note also, that keys involving “Ctrl+Shift+‹key›” cannot be
distinguished from “Ctrl+‹key›” when emacs runs in a text terminal
(i.e. telnet/ssh). So, this means best to avoid any binding with both
Control and Shift.
• How to Define Keyboard Shortcuts in Emacs
http://xahlee.org/emacs/keyboard_shortcuts.html
---------------
i reported the above as a bug sometimes late last year or this year,
but i think it got dismissed.
emacs's has a keybinding notation hell. For detail, see the section
“Representation of Keystrokes” near the bottom.
• The Confusion of Emacs's Keystroke Representation
http://xahlee.org/emacs/keystroke_rep.html
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-11 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 8:07 Problem setting the key \¤ Nordlöw
2009-06-11 14:08 ` Xah Lee
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.