Bug 139424 - meta key in emacs broken
meta key in emacs broken
Status: CLOSED DUPLICATE of bug 137868
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2004-11-15 17:09 EST by Alex Viskovatoff
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 14:07:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alex Viskovatoff 2004-11-15 17:09:19 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20041020 Galeon/1.3.17

Description of problem:
Emacs has two main modifier keys for generating keyboard shortcuts:
control and meta. On a PC, the most convenient way to use emacs is to
make the "logo" keys (the "Windows" key and possibly the "menu" key)
be meta; the alt key is then available for other purposes, such as
generating accented characters. (Alternatively, alt can be used as
meta. But this is broken as well, and is reported as bug #135505.)

x11's xkb facility provides a mechanism by determining how modifier
keys are mapped. Previously, one could supply the altwin:meta_win
option to xkb, and that would make Emacs recognize the Windows key as
meta. But this no longer works.

So, as the Emacs and xorg-x11 that come with Fedora Core 3 interact,
it is not possible to get any key to work as meta under emacs. One is
forced to use the escape key for that purpose, which is very inconvenient.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Issue the command `setxkbmap -option "altwin:meta_win"'
2. Type the 'f' key while holding down the Windows key in Emacs under x11

Actual Results:  No effect

Expected Results:  Cursor should have gone forward one word in the
current window.

Additional info:

Using the "describe key" command (C-h k) command in Emacs yields the
following result for this key combination: "H-M-s-f is undefined".
What Emacs should have received is "M-f" (which is bound to the
forward-word command). Thus, because x11 sets the "hyper" and "super"
flags, and not just the "meta" flag as is expected, Emacs doesn't
recognize the key combination in the desired way.

This bug has been reported on the emacs development list:


Posts on this thread give reasons why the behavior of x11 was changed
so that this problem is produced; it has something to do with
facilitating the simultaneous use of two keyboard layouts. One post
also mentions that Debian has been struggling with this for some time.

In Fedora Core 2, I was able to get around this problem by modifying
the /usr/X11R6/lib/X11/xkb/symbols/altwin by commenting out the line

  modifier_map Mod4	{ <META>, Meta_L, Meta_R };

in the definition of meta_win. Apparently, what this did is made Emacs
receive "Alt-f" when one pressed 'f' while holding down the Windows
key, and Emacs interpreted the "Alt" as meta. This is consistent with
what is reported in bug #135505.

Thus, it may be that the change from Fedora Core 2 to Core 3 here is
not in xorg-x11 but in Emacs. It appears that the immediate problem is
that a patch to Emacs to treat Alt as meta was removed. But this patch
itself was apparently a workaround to a bug in xorg-x11.

A similar problem is discussed under the heading "After upgrading to a
newer version of Emacs, the Meta key stops working" in
/usr/share/emacs/21.3/etc/PROBLEMS. Unfortunately, the suggestions
given there are not helpful in the present case.
Comment 1 Alex Viskovatoff 2004-11-15 17:58:09 EST
My speculation in the next-to-the last paragraph above did not pan
out. I reinstalled emacs-21.3-12, the version that is part of Fedora
Core 2, and it behaved in exactly the same way.
Comment 2 Alex Viskovatoff 2004-11-16 02:11:55 EST
My previous comment is on the wrong track. To restore normal behavior
of Emacs, I had to BOTH go back to emacs-21.3-12 AND xorg-x11-6.7.0-2.
(xorg-x11-6.7.0-9 is also broken in this respect.) Just either going
back to either the earlier version of Emacs or the earlier version of
x11 doesn't work: one has to restore both.

Another course of action would be to see if the patch given in the
post to the Emacs development list I linked to in my bug report above
works. I didn't want to take that route, since clearly, it is xorg-x11
and not Emacs that needs to be fixed: bash command-line editing is
meant to allow keyboard shortcuts on the Emacs model (e.g., M-f for
move one word forward), but that doesn't work with the new xorg-x11
Comment 3 Alex Viskovatoff 2005-01-30 21:00:09 EST
A post on the Fedora list
gave a solution to the problem. With the current CVS snapshot of
Emacs, the meta key works fine, under the newest Fedora Core 3 release
of xorg-
X11 (xorg-x11-6.8.1-12.FC3.21).
Comment 4 Jens Petersen 2005-02-14 00:19:51 EST
This should already be fixed in update 21.3-21.FC3 released recently.

*** This bug has been marked as a duplicate of 137868 ***
Comment 5 Jens Petersen 2005-02-14 01:13:48 EST
Could you please confirm the above package fixes the problem for
you and, if not then please re-open this report.  Thanks.
Comment 6 Red Hat Bugzilla 2006-02-21 14:07:02 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.