17

I set the Alt Gr key on my keyboard as compose key in my system (Ubuntu 14.04) in order to type letters like éóèàùçü and so on. But when I am on Emacs and try to press the Alt Gr key, I have a message saying that:

<Multi_key> is undefines

Ho can I make it work? Thanks.

P.S. as I don't have enough reputation, I couldn't tag this post with more meaningful tags. So, please, if you want to suggest tags, you are welcome.

Squidly
  • 1,499
  • 14
  • 17
petrux
  • 665
  • 1
  • 5
  • 18
  • I'm having the same issue with `Capslock` set to be my compose key. – Squidly Nov 17 '14 at 13:44
  • 2
    Sounds like a bug, so a minimum would be to provide the version of Emacs you're using. It sounds like http://debbugs.gnu.org/14044 . – Stefan Nov 17 '14 at 14:10
  • 1
    Does it really show “ is undefines” and not “ is undefined”? Always copy-paste error messages. Are you using the Emacs binary that comes with the system? Are you using the default GUI environment, if not which one? How exactly did you configure the keyboard (which layout, which options)? – Gilles 'SO- stop being evil' Nov 18 '14 at 07:21
  • I also have this problem since I updated to Ubuntu 14.04. Reviewed debbug mentioned above and found no help: /usr/share/X11/locale/en_US.UTF-8/XI18N_OBJS already contains _XimRegisterIMINstantiateCallback, requireing iso-transl does not help, killing ibus-daemon neither. Every app I use properly handles compose character (for example firefox: →), only emacs does not. I happily used composing for years... – Mekk Nov 18 '14 at 08:06
  • Are you using emacs in console mode (in a terminal) or in a graphical window? – T. Verron Nov 18 '14 at 08:08
  • In my case problem is in graphical window, emacs in terminal sees composed characters properly. And my emacs is 24.3.1 – Mekk Nov 18 '14 at 08:11
  • @T.Verron graphical window. – petrux Nov 18 '14 at 16:14
  • Do you want emacs to ignore that key? – PuercoPop Nov 19 '14 at 12:15

2 Answers2

16

Run emacs with XMODIFIERS set to @im=none:

XMODIFIERS=@im=none emacs

I'm surprised this still happens; I found this workaround some time ago, and forgot about it. I would have assumed it would get fixed by now.

There are some bug reports around for this; I can't find the (Debian) one that I originally read to get this workaround, but one relevant to Ubuntu is https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/493766. There's also a discussion on the emacs-devel mailing list here: http://thread.gmane.org/gmane.emacs.devel/170835.

Julian Squires
  • 276
  • 2
  • 6
1

This is a bug. It's fixed in Emacs 24.4.

You can update by building it from source; it's pretty straightforward:
http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.gz

Clément
  • 3,924
  • 1
  • 22
  • 37
  • 1
    Have you checked this on a vanilla 24.4 build? It doesn't work for me on a machine with ibus, which is the usual cause of the problem in the first place. There do seem to be fixes in the git repo, so there are patched versions being distributed by e.g. Ubuntu that have backported the fix to 24.4. But I don't think that any of the tarballs you get from gnu.org will work. – Sean Patrick Santos Apr 09 '15 at 04:05
  • Works for me on a vanilla build from gnu.org, actually – Clément Apr 09 '15 at 04:48
  • Hmm, so just to confirm, this is working for you, with a vanilla Emacs 24.4 build, and in a desktop environment using ibus, and with `XMODIFIERS="@im=ibus"`? Yet it doesn't for me. I wonder what the difference is. I did use "--with-x-toolkit=gtk3", but I don't think it matters. ibus is version 1.5.5, gtk is 3.14.9. – Sean Patrick Santos Apr 13 '15 at 04:40
  • @SeanPatrickSantos: Yes. Try (getenv "XMODIFIERS") from emacs to see if it's properly exported? – Clément Apr 13 '15 at 17:18
  • Yep, `@im=ibus`, as expected. – Sean Patrick Santos Apr 14 '15 at 18:39
  • Using emacs-24.4 on Gentoo with `XMODIFIERS=@im=fcitx` has this bug. I should try upgrading to 24.5… – binki Aug 03 '16 at 02:02
  • 5
    It's not fixed. Using emacs-25.1.50 with `XMODIFIERS=@im=fcitx`, the problem is present. – Hi-Angel Oct 23 '16 at 03:44
  • 1
    I also have this problem on ubuntu with emacs 25.1.2 – Jonas Dahlbæk Jun 14 '17 at 14:26
  • 1
    having this problem with `GNU Emacs 25.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.19) of 2017-09-15` – rahmu Feb 13 '18 at 12:13
  • FTR: this should currently be fixed, but may start occurring again if you log into Gnome Wayland session, then into an X11 one. In this case inside X11 session Emacs gonna have this problem. I don't know why is that ATM, nor any fix besides rebooting the system. – Hi-Angel Jul 14 '21 at 13:52