* Looking for a sneaky key binding
@ 2007-03-05 1:09 Dan Bensen
2007-03-05 2:02 ` weber
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Dan Bensen @ 2007-03-05 1:09 UTC (permalink / raw)
To: help-gnu-emacs
After making a new command, I wanted to bind it to M-C-|.
This form didn't work:
(global-set-key <name> 'my-command)
where <name> was equal to
"\M-\C-|"
"\M-\C-\|"
"|\M-\C-\||"
on separate attempts. The error message was always
"Invalid modifier in string".
So is there another trick somewhere that does this,
or is it not supported?
--
Dan
www.prairienet.org/~dsb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Looking for a sneaky key binding
2007-03-05 1:09 Looking for a sneaky key binding Dan Bensen
@ 2007-03-05 2:02 ` weber
2007-03-05 2:37 ` David Hansen
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: weber @ 2007-03-05 2:02 UTC (permalink / raw)
To: help-gnu-emacs
On 4 mar, 22:09, Dan Bensen <randomg...@cyberspace.net> wrote:
> After making a new command, I wanted to bind it to M-C-|.
> This form didn't work:
> (global-set-key <name> 'my-command)
>
> where <name> was equal to
> "\M-\C-|"
> "\M-\C-\|"
> "|\M-\C-\||"
>
> on separate attempts. The error message was always
> "Invalid modifier in string".
>
> So is there another trick somewhere that does this,
> or is it not supported?
>
> --
> Danwww.prairienet.org/~dsb
Yes, i had some problems too.. But with this syntax worked:
(global-set-key (kbd "M-C-\|") '(lambda() (interactive) (message
"Teste")))
It's hard combo to type though: you have to hold Ctrl, Alt and
Shift! :)
Cheers,
weber
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Looking for a sneaky key binding
2007-03-05 1:09 Looking for a sneaky key binding Dan Bensen
2007-03-05 2:02 ` weber
@ 2007-03-05 2:37 ` David Hansen
[not found] ` <mailman.438.1173062316.7795.help-gnu-emacs@gnu.org>
2007-03-06 4:44 ` Kevin Rodgers
3 siblings, 0 replies; 7+ messages in thread
From: David Hansen @ 2007-03-05 2:37 UTC (permalink / raw)
To: help-gnu-emacs
On Sun, 04 Mar 2007 19:09:47 -0600 Dan Bensen wrote:
> After making a new command, I wanted to bind it to M-C-|.
Hit C-h k C-M-| and emacs will show you the key how it understands
it:
C-M-| is undefined
then just use (kbd "C-M-|").
Wow, a keystroke that involves Meta Control and Shift, one key is
missing :)
David
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <mailman.438.1173062316.7795.help-gnu-emacs@gnu.org>]
* Re: Looking for a sneaky key binding
2007-03-05 1:09 Looking for a sneaky key binding Dan Bensen
` (2 preceding siblings ...)
[not found] ` <mailman.438.1173062316.7795.help-gnu-emacs@gnu.org>
@ 2007-03-06 4:44 ` Kevin Rodgers
3 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2007-03-06 4:44 UTC (permalink / raw)
To: help-gnu-emacs
Dan Bensen wrote:
> After making a new command, I wanted to bind it to M-C-|.
> This form didn't work:
> (global-set-key <name> 'my-command)
>
> where <name> was equal to
> "\M-\C-|"
> "\M-\C-\|"
> "|\M-\C-\||"
>
> on separate attempts. The error message was always
> "Invalid modifier in string".
See these sections of the Emacs Lisp manual:
Nonprinting Characters in Strings
Non-ASCII Characters in Strings
Changing Key Bindings
> So is there another trick somewhere that does this,
> or is it not supported?
Use the vector notation (Emacs manual: Rebinding Keys in Your Init File):
[?\M-\C-|]
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-03-06 13:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 1:09 Looking for a sneaky key binding Dan Bensen
2007-03-05 2:02 ` weber
2007-03-05 2:37 ` David Hansen
[not found] ` <mailman.438.1173062316.7795.help-gnu-emacs@gnu.org>
2007-03-05 3:23 ` Dan Bensen
2007-03-05 3:49 ` Dan Bensen
2007-03-06 13:07 ` Johan Bockgård
2007-03-06 4:44 ` Kevin Rodgers
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).