Skip to main content

Emacsclient Does Not Recognise Compose Key Sequences

Originally published 2021/10/27. Updated to include the .xssessionsrc point

I run pretty often into this issue, so this is a checklist for me.
Issue being, that I cannot use Compose key sequences to type out the characters I need.

Case in point being, the apostrophe and the quote marks “” , ‘’ that I use, all the live long day.

  1. Make sure that emacs is running as a service. It runs in your user, so check status with systemctl --user status emacs.service
    • Do the normal computer user thing. Restart the service.systemctl --user restart emacs.service.1
  2. Make sure the system is UTF-8 everywhere. (en_IN.UTF-8 does not work for me. Make sure it’s en_US.UTF-8)
    • One place that Emacs looks is the .xsessionrc file in the home folder.
      • These are the contents of mine. My Emacs refuses to let the compose key sequences work, unless it’s present
        LC_NUMERIC=en_US.UTF-8
        LC_MONETARY=en_US.UTF-8
        LC_PAPER=en_US.UTF-8
        LC_NAME=en_US.UTF-8
        LC_ADDRESS=en_US.UTF-8
        LC_TELEPHONE=en_US.UTF-8
        LC_MEASUREMENT=en_US.UTF-8
        LC_IDENTIFICATION=en_US.UTF-8
        LC_TIME=en_US.UTF-8
        PAPERSIZE=a4
        LANGUAGE=en_US
        LANG=en_US.UTF-8
        
        if [ $DISPLAY != ":0" ]
        then
        	export XAUTHORITY=${HOME}/.Xauthority
        fi

This should do the trick 99% of the time.


  1. Have done it close to 4–5 times now. It works! ↩︎