From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Problem setting the key \¤
Date: Thu, 11 Jun 2009 07:08:54 -0700 (PDT) [thread overview]
Message-ID: <6808e50a-1f78-412c-a843-d09a35d10a75@b7g2000pre.googlegroups.com> (raw)
In-Reply-To: 87bae5a6-c7ce-47b9-86ee-d8e15644854b@t21g2000yqi.googlegroups.com
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/
☄
prev parent reply other threads:[~2009-06-11 14:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 8:07 Problem setting the key \¤ Nordlöw
2009-06-11 14:08 ` Xah Lee [this message]
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=6808e50a-1f78-412c-a843-d09a35d10a75@b7g2000pre.googlegroups.com \
--to=xahlee@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.