chpill · 2022-07-29 16:08
I'm trying to write some exotic characters, like ĵ, ĉ or ŭ. I am using a qwerty US keyboard layout on a GNU linux machine, and I set up my compose key with `setxkbmap -layout us -option compose:ralt`. This works flawlessly almost everywhere, including when using Emacs from a terminal with `emacs -q -nw`. I can write words like "ĵaŭdo" ("thursday" in Esperanto), no problem at all.
But when I try to input the compose sequence corresponding to one of those characters using Emacs in GUI mode with `emacs -q`, nothing happens. Clearly, Emacs GUI understands my compose key, as I can use it to write french characters like "déjà". Furthermore, it does not seem to be a character set issue: If I write "ĵaŭdo" in a text file, and open this file from Emacs GUI, it renders those characters just fine. Does anybody know what is going here? (`emacs --version` GNU Emacs 28.1`)
xtifr · 2022-07-29 20:43
It works flawlessly here, and I'm also using v28.1. Are you using the gtk version or the lucid version? (I wouldn't expect that to make a difference, but I've only tested the gtk version.)
How do you have your locale set up, and what is it set to? (I have "LANG=en\_US.UTF-8" and no other locale settings.)
What happens if you press `C-h k` and then enter, say, `compose ^ j`? (I get a window telling me that ĵ runs the command `self-insert-command`.)
chpill · 2022-07-29 22:35
Thank you for your response!
About the precise version, Emacs tells me: `This is GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0)`
When I input `C-h k`, I see the prompt in the minibuffer after `Describe the following key, mouse click, or menu item:`. When I input `compose ^ j`, absolutely nothing happens, the prompts remains waiting. It's like I had input nothing. If I input `compose ^ e`, then the minibuffer immediately shows me `ê is undefined`, so not the same feedback you had? But at least it actually does something.
I'll try to dig around my system configuration to see what settings I have for the locale, where did you set it up?
cradlemann · 2022-07-30 14:35
I use PrintScr as compose key, works fine. Maybe Emacs expect right alt to behave as Mod key
chpill · 2022-07-30 20:50
It seems that Emacs GUI does understands my compose key. I can type `compose ^ e` and I get `ê` as expected. But when I type `compose ^ j`, nothing happens. It is very weird.
chpill · 2022-07-31 10:41
It really looks like the OS is not forwarding a subset of the input from the compose key to Emacs. I'm using Debian, I'm trying to dig up all I can on keyboard and locale configuration but it is quite a rabbit hole.
@xtifr how do you set up your compose key on your system?
xtifr · 2022-08-11 04:07
As an experiment, I tried unsetting my locale, and Emacs behaved pretty much the way you describe. So, I think the fix here *is* to make sure your locale is set properly before starting Emacs. The easiest way is to add `LANG=en_US.UTF-8; export LANG` to your .profile file. (If your default language is something other than English, or your regional version of English is not US, then you'll need to find the appropriate value, but the ".UTF-8" part is important for any language or variant.)