Writing Alternating Between English And Spanish In Emacs
Overview
If you write in Spanish and English then you will have to choose between using a keyboard with Spanish or English layout. No matter which one you select, when you write in the other language you will have to choose a strategy to handle the letters that are present in one language that are not in the other one.
This is a quick overview to handle this situation with an English
keyboard layout (i.e.: not having 帽
, and tildes 贸
, 谩
, etc)
Changing the keyboard layout
In Emacs you can quickly change the layout with set-input-method
,
which will change the keyboard layout for the current buffer.
set-input-method:Select and activate input method INPUT-METHOD for the current buffer. This also sets the default input method to the one you specify.
There are three alternatives for Spanish:
- spanish-keyboard
- spanish-postfix
- spanish-prefix
Check layouts
What layout each keyboard uses? Let’s find out with quail-show-keyboard-layout, in each input method it prints the recognized layout:
- spanish-keyboard
Keyboard layout (keyboard type: standard)
+----------------------------------------------------------------+
| 1 ! | 2 " | 3 路 | 4 $ | 5 % | 6 & | 7 / | 8 ( | 9 ) | 0 = | ' ? | 隆 驴 | 铆 脥 |
+----------------------------------------------------------------+
| q Q | w W | e E | r R | t T | y Y | u U | i I | o O | p P | 茅 脡 | 贸 脫 |
+------------------------------------------------------------+
| a A | s S | d D | f F | g G | h H | j J | k K | l L | 帽 脩 | 谩 脕 | 煤 脷 |
+-----------------------------------------------------------+
| z Z | x X | c C | v V | b B | n N | m M | , ; | . : | - _ |
+-------------------------------------------------+
+-----------------------------+
| space bar |
+-----------------------------+
- spanish-postfix
Keyboard layout (keyboard type: standard)
+----------------------------------------------------------------+
| 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | ` ~ |
+----------------------------------------------------------------+
| q Q | w W | e E | r R | t T | y Y | u U | i I | o O | p P | [ { | ] } |
+------------------------------------------------------------+
| a A | s S | d D | f F | g G | h H | j J | k K | l L | ; : | ' " | \ | |
+-----------------------------------------------------------+
| z Z | x X | c C | v V | b B | n N | m M | , < | . > | / ? |
+-------------------------------------------------+
+-----------------------------+
| space bar |
+-----------------------------+
- spanish-prefix
Keyboard layout (keyboard type: standard)
+----------------------------------------------------------------+
| 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | ` ~ |
+----------------------------------------------------------------+
| q Q | w W | e E | r R | t T | y Y | u U | i I | o O | p P | [ { | ] } |
+------------------------------------------------------------+
| a A | s S | d D | f F | g G | h H | j J | k K | l L | ; : | ' " | \ | |
+-----------------------------------------------------------+
| z Z | x X | c C | v V | b B | n N | m M | , < | . > | / ? |
+-------------------------------------------------+
+-----------------------------+
| space bar |
+-----------------------------+
Choosing the layout
spanish-keyboard: while having all the typical Spanish letters their own key, I don’t find it pretty close to any other keyboard I have ever tried.
spanish-postfix: expects to press tildes after the desired letter, for example
o+tilde=贸
which I find a bit unnatural.spanish-prefix: The one that resembles more the classical Spanish keyboard behaviour is the spanish-prefix one. In this one you will write tildes before the letter, e.g.:
- to write 贸: press the tilde key and then the o.
- to write 帽: press the ~ symbol and then o
Conclusion
After executing set-input-method and selecting spanish-prefix, writing in each language is as easy as switching them with C-\ (toggle-input-method) and have a pretty close experience as using a Spanish keyboard in an English keyboard layout.
toggle-input-method:Enable or disable multilingual text input method for the current buffer. Only one input method can be enabled at any time in a given buffer.
- Using Emacs As A Python Ide with basic Emacs featuresJuly 10, 2017
- Jump To Function Definitions In EmacsJune 23, 2017
- Writing Alternating Between English And Spanish In Emacs
- Writing In Emacs Checking Spelling Style And GrammarJune 10, 2017
- Adding Custom Snippets To YasnippetNovember 1, 2016
Articles
Except as otherwise noted, the content of this page is licensed under CC BY-NC-ND 4.0 . Terms and Policy.
Powered by SimpleIT Hugo Theme
·