[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding meta and arrow

From: Eli Zaretskii
Subject: Re: Binding meta and arrow
Date: Sat, 14 May 2005 10:13:43 +0300

> From: "Ian Crowther" <address@hidden>
> Bcc: 
> Date: Sat, 14 May 2005 00:27:27 +0100
> I can evaluate "(global-set-key [left] "left was pressed")" and get "left 
> was pressed" inserted into the buffer when I press left. All I now need to 
> do is try to figure out how to use the alt key on my keyboard.
> I've tried the following:
>       (global-set-key [M-left] "M-left was pressed")
>       (global-set-key [A-left] "A-left was pressed")
>       (global-set-key [alt left] "alt left was pressed")
>       (global-set-key [meta left] "meta left was pressed")
> And because I don't know what they do, I tried the following combinations 
> also:
>       (global-set-key [H-left] "H-left was pressed")
>       (global-set-key [s-left] "s-left was pressed")
> None of them work. I know emacs can tell I've pressed M-left though. I'd be 
> grateful if somebody could tell me how I'm going wrong trying to bind it.

Just use a name of a function instead of the string.  For example:

     (global-set-key [M-left] 'beginning-of-line)

(The way you used global-set-key is meant for macros: the thing inside
quotes should be a sequence of one or more keys, it cannot be an
arbitrary string, and it certainly isn't displayed in the echo area,
it's fed back to the Emacs keyboard input.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]