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

emacs confused about alt and meta



emacs seems to want to interpret ALT as META and ignore META altogether.

I found no mention of this in the emacs docs.  I'm pretty convinced that
it's an emacs issue:  I've used xev to confirm that it's getting the
appropriate keysyms, so when I say it interprets ALT as META, what I
mean is:  It gets the ALT keysym, but behaves as if I pushed META. 

Summary:

Keysyms                        	emacs behavior
ALT-x				M-x
META-x				x

I've used xmodmap to change the keysyms that are sent, but that doesn't
change the way emacs interprets them.  (Does emacs truly look at keysyms
or does it use keycodes?)

I've also followed the advice from a thread (included below) that
heppened a while back, to no avail.

suggestions are welcome :)

					-Michael

REPOSTED FROM PREVIOUS THREAD
=========================================================================
                          Re: Emacs and the ALT key.
     _________________________________________________________________
   
     * To: Havoc Pennington <[7]rhp@zirx.pair.com>
     * Subject: Re: Emacs and the ALT key.
     * From: "Jens B. Jorgensen" <[8]jjorgens@bdsinc.com>
     * Date: Thu, 13 May 1999 10:04:27 -0500
     * CC: "Allen B. Riddell" <[9]ariddell@concentric.net>,
       [10]debian-user@lists.debian.org
     * Organization: Business Data Services, Inc.
     * References:
       <[11]Pine.BSF.4.02A.9905122331001.7358-100000@zirx.pair.com>
     _________________________________________________________________
   
I posted a lengthy description of how to deal with this back in August
(the problem was introduced with hamm). I'll repost the content here:

This problem has come up so many times since hamm started getting used
that it almost merits its own HOWTO. What's happened is that you've
upgraded X and now you are using the XKEYBOARD extension. As you've
noticed, the ALT key now does ALT and the "windows" key is now the
META key. I've argued several times that this is a bug since it
changes behavior. Alas no one listens to this raving madman. Where's
whatcha do (as root):

sed -e 's/Alt_L/Foo_L/' -e 's/Alt_R/Foo_R/' <\
/usr/lib/X11/xkb/symbols/us |\
sed -e 's/Meta_L/Alt_L/' -e 's/Meta_R/Alt_R/' |\
sed -e 's/Foo_L/Meta_L/' -e 's/Foo_R/Meta_R/' >\
/usr/lib/X11/xkb/symbols/us.new

mv /usr/lib/X11/xkb/symbols/us /usr/lib/X11/xkb/symbols/us.old
mv /usr/lib/X11/xkb/symbols/us.new /usr/lib/X11/xkb/symbols/us

(Now restart X and Things should work normally.

Michael Symalla wrote:

> Dear Debian users,
>
> can anyone help me to let my Alt-key be the metakey in emacs? Now I am
> using the ESC key, which works fine but is not as comfortable as the
> ALT
> key.
>
> Thanks a lot.
> --
> Bye
>      Mitch

Havoc Pennington wrote:

> On Wed, 12 May 1999, Allen B. Riddell wrote:
> >
> > the ALT key (on my PC keyboard) doesn't seem to work in emacs.. It
> > works in
> > netscape -- and aside from that, I have absolutely no problems at
> > all with
> > anything...
> >
>
> Probably the "Windows" key (if you have one) is bound to the Meta
> keysym,
> which is what Emacs is looking for; I don't think Emacs uses the Alt
> keysym at all by default. If you don't have a Windows key, you need to
> move Meta to some other key of your choice. (Many people have the
> physical
> Alt key send both Alt and Meta keysyms, which is technically wrong but
> works nice in practice, since few apps use both keysyms. However,
> XEmacs
> insists on complaining about it every time you start up.)
>
> That said, I'm not sure how to do this without Xmodmap. Perhaps it
> will
> help to know what you're trying to achieve though. :-)
>
> Havoc



Reply to: