Dead keys break in Emacs with locale set by gnome-language-selector/GDM

Bug #575084 reported by Øyvind Stegard on 2010-05-04
48
This bug affects 10 people
Affects Status Importance Assigned to Milestone
emacs23 (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: language-selector

Dead keys in Emacs stop working after running gnome-language-selector and logging out and back in. For instance, trying to type a tilde (~) character using a dead key will result in Emacs spitting out "<dead_tilde> is undefined". I'm using Norwegian keyboard layout and standard Norwegian UTF-8 locale.

The reason for this is expalined here:
1. Run language selector, select locale (Norwegian in my case, probably applies to many others as well)
2. Language selector writes the value 'Langauge=nb_NO.utf8' to ~/.dmrc
3. Log out
4. Log in
5. GDM reads ~/.dmrc, sets the value for locale in GDM_LANG variable, and subsequently LANG gets set to the value of GDM_LANG (/etc/gdm/Xsession) for the login session.

However, Emacs seems to have problems interpreting 'LANG=nb_NO.utf8'. When explicitly setting LANG to 'nb_NO.UTF-8' (notice the difference in specifying the encoding), then dead keys start working properly in Emacs.

This was not a problem in earlier versions of Ubuntu (<= Karmic).

I don't know if 'utf8' is a valid encoding specification for the locale variables, but it looks like 'UTF-8' works better, at least for Emacs. Also, the value specified in /etc/default/locale uses the proper "upper-case-with-dash" way of specifying UTF-8 encoding.

If 'LANG=nb_NO.utf8' is indeed a valid way of specifying locale, then the bug is in Emacs. If not, this bug applies to gnome-language-selector or GDM, which sets a bad (or perhaps just a less compatible) value for locale.

No matter where the bug is, the locale set by gnome-language-selector should at least match the format used in /etc/default/locale, for consistency.

Ubuntu 10.04 x86 installed from RC, fully up to date.
emacs 23.1+1-4ubuntu7
gnome-language-selector 0.5.7
gdm 2.30.0-0ubuntu5

Arne Goetje (arnegoetje) wrote :

If emacs cannot handle .utf8 locales, it's a bug in emacs. The new standard is to use .utf8 instead of .UTF-8. Emacs should be migrated to use the new standard. This change has occured in the langpack-locales package, which includes the locale data from upstream glibc.

affects: language-selector (Ubuntu) → emacs23 (Ubuntu)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in emacs23 (Ubuntu):
status: New → Confirmed

Interestingly I have two different installations of Ubuntu 12.04, and on one of them, I have this emacs tilde problem, while on the other one, I don't.

On the one where it fails, I previously switched from Lightdm to Gdm. On the one where it works, I never did such a switch of display manager.

Unfortunately, switching back to Lightdm does not solve the problem, as I would have expected.

Anyway, this issue is rather frustrating.

Somehow htting Ctrl-x 8 in Emacs fixes the problem for that session.

Back in 2008, a guy gave this hint:
http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/d5b1ab43f0ec5203

Damien Cassou (cassou) wrote :

I confirm emacs24 and emacs-snapshot are affected in Ubuntu 13.10.

Please add info to
https://bugs.launchpad.net/emacs-snapshot/+bug/1251176
and
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15891

Thank you for the workarounds.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers