Ubuntu: Dead keys in emacs with ibus



Question:

I've just upgraded to 13.10 and noticed that dead keys are not working anymore in emacs (a keystroke to ' leads emacs to display <dead-acute> is undefined instead of waiting to the next key. In addition, use of the compose key leads to <Multi_key> is undefined and it is impossible to use keybindings such as <M-^>. Other applications work fine as far as I can tell.

A brief search on the internet suggested to (require 'iso-transl) to .emacs. This solves the first issue, but not the other ones.

Another possible workaround seen on the web is to launch emacs with an empty XMODIFIERS variable, as XMODIFIERS='' emacs, instead of XMODIFIERS= @im=ibus which seems to be the default in 13.10. Then everything works fine, but it looks like a kludge. Is there a way to make emacs work with ibus on this subject?

Update: I observe the same behavior in 14.04.

Update: content of .dmrc as asked for in comments:

[Desktop]  Session=xubuntu  Language=fr_FR  Layout=us       intl  Langlist=fr_FR:en  LCMess=fr_FR.UTF-8  


Solution:1

Here are the things you can try.

Edit the file ~/.dmrc and make sure to set these lines on it:

Language=en_US.utf8  Langlist=en_US:en  LCMess=en_US.UTF-8  

Edit the file ~/.emacs and add these lines to it instead of (require 'iso-transl):

(prefer-coding-system 'utf-8)  (set-default-coding-systems 'utf-8)  (set-terminal-coding-system 'utf-8)  (set-keyboard-coding-system 'utf-8)  (setq default-input-method "latin-1-prefix")  (defun my-set-default-input-method ()    (set-input-method 'latin-1-prefix))  (add-hook 'text-mode-hook 'my-set-default-input-method)  

You will have to add similar lines to the last one if you use dead keys with other modes in emacs (for instance, latex-mode, tex-mode, html-mode...).

Log out and then log in again.

Even so, if it ever happens to you that dead keys don't work within emacs, try to type C-\ and see if they work.

Update:

If that doesn't work, the only thing that comes to my mind, is that you define two keyboard layouts in your system settings

  • English US international dead keys (the one that you have)
  • English US

and add a keyboard layout selector in the way explained here:

How to switch language keyboard combination?

When you work with emacs, choose the "English US" layout. If you have added to your .emacs file the lines that I mentioned above, this will force your keyboard to behave as a "dead keys keyboard" within emacs. I know this can be annoying, but it's the only solution to your problem that comes to my mind.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »