help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accented letters ( typing in )


From: Bob Proulx
Subject: Re: accented letters ( typing in )
Date: Fri, 17 Jan 2014 16:07:36 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Michel Chassey wrote:
> Emacs displays all accented letters flawlessly from my files but I cannot
> type in these accented letters. 
> é can by typed in but none the others like è ê à â . I can type these
> letters anywhere ( as you can see ) but not in emacs.
> My OS is Ubuntu 13.10 ( just upgraded )

Are you running Emacs in X11 or from a terminal?  If you can type in
those characters anywhere then it should work within emacs too.  It
makes no sense to me.  Therefore I am going to ignore that and simply
give generic keyboard configuration advice as if I had not read it.
Perhaps some of it might even be useful.

You can use C-x 8 in Emacs as the compose key for most common
sequences.  For example C-x 8 ` e for è and so forth.  See the emacs
"22.18 Unibyte Editing Mode" section of the manual.  That can be used
even on keyboards that are not configured for the compose key.  (Such
as if logged in remotely from a foreign keyboard.)  However not all
compose key sequences are available within emacs.  Only the compose
key sequences for the latin1 character set.  Use C-x 8 C-h to list out
a full list of C-x 8 translations available.

But that only works within emacs.  Therefore I think you will be
better off if you configure your system to input those characters at
the system level.  Then it will work correctly everywhere.  So instead
of learning an emacs specific way I would set up a global system way.

On Debian (and I assume on Ubuntu which is a fork) you can configure
your keyboard to create a compose key.

  sudo dpkg-reconfigure keyboard-configuration

That asks what to set up for AltGr and Compose.  I select Right Alt
for AltGR and Menu for Compose.  (I also select the X terminate key of
control-alt-backspace.)  That resulted in this configuration in the
/etc/default/keyboard file.

  XKBOPTIONS="lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp"

That will take effect the next time X is started.  But you can
dynamically change the running session by calling the setxkbmap
command to set it for the running session.

  setxkbmap -model pc104 -layout us -option compose:menu -option 
terminate:ctrl_alt_bksp

Select the layout appropriate to your system.  The above is for my US
keyboard.  That sets up the Compose key.  (As well as the X terminate
key.  You might not want that.  The key sequence kills the current X
session and logs you out immediately.)  At that point you should be
able to use the right menu key as the compose key.

The choice of Right Alt or Right Control might be most general as all
PC keyboards have those keys.  My laptop does not have a right logo
key.  It does have a menu key.  Other keyboards have a Right Logo key.
People must simply pick one of the several possibilities and there is
no single right answer.  Here are some possible selections that you
might select one of them and try.

  setxkbmap -model pc104 -layout us -option compose:rctrl
  setxkbmap -model pc104 -layout us -option compose:menu
  setxkbmap -model pc104 -layout us -option compose:rwin

To activate an AltGr key (another way to create special characters)
use the -variant altgr-intl option.  Here is another example.

  setxkbmap -model pc104 -layout us -variant altgr-intl -option compose:rctrl 
-option terminate:ctrl_alt_bksp

With that you get both the Compose key and the AltGr key.  Both work.
You can either build the characters with Compose ' e for é or can use
the AltGr e for é.  Personally I prefer the compose key method over
the AltGr method.  It works better with my brain.  Select the one you
prefer.

This following file documents the compose key sequences.  Browse that
file to determine what sequence you need for the characters you will
be typing in.

  /usr/share/X11/locale/en_US.UTF-8/Compose

That lists many useful combinations.  Searching for a desired
character cut and pasted into search yields the input keys needed to
produce it.  Very useful.

Here are some common compose key sequences.  Type the keys one after
the other.  Tap, tap, tap.  Do not hold down the compose key as it is
not a shift key and not a control key.  Here are just a few of the
possibilities.

  â = Compose ^ a
  Å = Compose o A
  è = Compose ` e
  ü = Compose " u

Since you are using Ubuntu and the system input method is system
specific you might want to ask this question on the ubuntu-user
mailing list.  Or if you decide something is a bug you might want to
submit a bug into the Ubuntu bug tracker.  Because other system will
configure this in their own unique ways.

Hope that helps,
Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]