help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Trouble binding Alt *by itself* to the execute-extended-command...(A


From: Pascal J. Bourguignon
Subject: Re: Trouble binding Alt *by itself* to the execute-extended-command...(Alt-x and ESC-x work fine.)
Date: Sun, 07 Jul 2013 00:16:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Chris Seberino <cseberino@gmail.com> writes:

> Alt-x invokes the execute-extended-command just fine.

Did you do something special?  Because in my emacs, A-x doesn't invoke
execut-extended-command.  I have to type M-x to get that.


> I'd like the Alt key *by itself* to this command.
>
> I'm on Ubuntu 12.04.  I've read a few docs on X Windows, xmodmap, xev,
> Ubuntu Unity 3D but *still* can't seem to make this work.

You can find interesting keysyms in /usr/include/X11/keysymdef.h
You can use xmodmap to bind keycodes to the keysyms you want.
And you can use global-set-key to bind keysyms to the functions you want.

To replace the keysym Alt_L and Alt_R by Execute you can evaluate:

(shell-command "for code in $(xmodmap -pke|awk '/= Alt/{print $2}') ; do
xmodmap -e 'keycode 133 = Execute' ; done")

There is already a binding from the Execute keysym to
execute-extended-command in emacs-version "24.2.1"
If not, you can bind it with:

(global-set-key (kbd "<Execute>") 'execute-extended-command)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.  
You know you've been lisping too long when you see a recent picture of George 
Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin




reply via email to

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