No video

Emacs: multilingual editing (Greek, French, Chinese, etc.)

  Рет қаралды 2,644

Protesilaos Stavrou

Protesilaos Stavrou

Күн бұрын

In this ~10 minute video I show how to use Emacs to edit text in multiple languages. This is better than using the system-level keyboard layout configuration because you retain all the functionality of Emacs for key bindings (e.g. 'C-n', 'C-p', 'M-x'). In the video I demonstrate the various input methods, with prefix or postfix notation, and character composition.
* * *
Find all my publications on my website (Emacs, philosophy, Linux, etc.): protesilaos.com

Пікірлер: 30
@kozas0
@kozas0 7 ай бұрын
This is very interesting cause so far I was using the reverse-im-input-methods package which does a reverse mapping of the keymaps in order to make keybinds work (with system level language switching), but not everything would work that way, for example in Greek we have the "q" key producing the ";" character, so any combination with q, like C-q, wouldn't work. I just checked this native Emacs method and it works much better. Many thanks Protesilaos. Ευχαριστούμε.
@protesilaos
@protesilaos 7 ай бұрын
Παρακαλώ! Να'σαι καλά!
@GF-cv2qz
@GF-cv2qz 8 ай бұрын
Συγχαρητήρια για τα εξαιρετικά video πάνω στο emacs και όχι μόνο. Θα ήταν πολύ χρήσιμο και ένα video πάνω στον ορθογραφικό έλεγχο, και πως αυτός μπορεί να γίνεται ταυτόχρονα σε ένα αρχείο κειμένου που περιέχει και αγγλικές και ελληνικές λέξεις.
@protesilaos
@protesilaos 8 ай бұрын
Σ'ευχαριστώ! Για ορθογραφικό έλεγχο δες το jinx από τον Daniel Mendler: github.com/minad/jinx Μπορείς να το χρησιμοποιήσεις με πολλές γλώσσες ταυτόχρονα. Απλά πρέπει να έχεις τα σχετικά λεξικά εγκατεστημένα.
@awllower2
@awllower2 8 ай бұрын
​@@protesilaos Thanks for the information about jinx! I found that Emacs supports 'enchant' as a spell-checker out of the box, which is the engine jinx uses. It seems to be worth a try. :)
@protesilaos
@protesilaos 8 ай бұрын
@awllower2 You are welcome! Yes, jinx is worth trying.
@kozas0
@kozas0 7 ай бұрын
Don't forget to run M-x describe-input-method to see the details of each input method like how you accent characters and what are the combinations.
@protesilaos
@protesilaos 7 ай бұрын
Good point!
@vangelisevangelou
@vangelisevangelou 8 ай бұрын
Very helpful, thanks.
@protesilaos
@protesilaos 8 ай бұрын
You are welcome!
@roostertechchan
@roostertechchan 7 ай бұрын
Very useful information, thank you! However something needs to be mentioned. This language input method is separate from the OS one. For example when I change keyboard layout on OS level, this doesn't affect the input method in Emacs. I guess I have to bind the same key in emacs to make layout change universal across Emacs and OS.
@roostertechchan
@roostertechchan 7 ай бұрын
It turns out I can't. OS overrides Emacs key binding if I use the same keys both for OS and Emacs.
@goofansu
@goofansu 8 ай бұрын
Thank you, just know transient input method, I can input Greek characters like "α β δ" in math formulas.
@protesilaos
@protesilaos 8 ай бұрын
You are welcome!
@awllower2
@awllower2 8 ай бұрын
9:20 I checked the ChangeLog, and it turned out that "activate-transient-input-method" was renamed from "transient-input-method", which was first mentioned as a new command (by ChangeLog's) at 2020-11-1, at Emacs version 27.1. :)
@goofansu
@goofansu 8 ай бұрын
I'm using 29.1, the function is still activate-transient-input-method.
@awllower2
@awllower2 8 ай бұрын
@@goofansu I think you mis-understood my comment. I meant the function was called "transient-input-method" and is now called "activate-transient-input-method".
@goofansu
@goofansu 8 ай бұрын
@@awllower2 Ah, sorry, thank you for the knowledge!
@awllower2
@awllower2 8 ай бұрын
No problem. :)
@protesilaos
@protesilaos 8 ай бұрын
Thank you for checking this!
@user-of3zn9ik5m
@user-of3zn9ik5m 8 ай бұрын
Good to know that! Btw, CJK(at least Chinese and Japanese afaik) is somehow… tricky. For Chinese I usually input a bunch of pinyin for the whole sentence, then pick the correct kanji for them. There are also good emacs packages like emacs-rime or emacs-mozc, and system-layer input method fcitx. All of these are usable, but the experience is not appreciable. I do not like the idea of windows or Mac, but have to admit that the input method for these systems are better designed.
@protesilaos
@protesilaos 8 ай бұрын
Good to know! I wonder what the main constraint is. For example, emacs-rime has a demo in their README which looks similar to what Emacs offers out-of-the-box. I do not know any CJK to try it out, but I can imagine how a predictive typing model would help in this scenario as I would not want to type a long document while having to select a number each time.
@tommyphillips1030
@tommyphillips1030 8 ай бұрын
@@protesilaos Being able to type the pinyin of several consecutive characters in a sentence, and then selecting a completion, gives the completion framework more context to suggest appropriate completions
@tommyphillips1030
@tommyphillips1030 8 ай бұрын
There's also a package called pyim, which is pretty easy to setup. Does anyone know the pros and cons of pyim vs emacs-rime
@haiteng61
@haiteng61 7 ай бұрын
@@protesilaos I am a emacs-rime user, it is wonderful and better than the vanilla emacs input. Something easily appreciable is that rime puts the candidates in a posframe that's closer to your cursor, that's less eye travel between your input and the candidates. Under the hood, yes the predicative model is important, and it should learn from the language pattern of the user to predict better what's coming. E.g. if I type 道 often enough, then next time when I type `d`, I should see 道 immediately without having to type the full `dao`. When it comes to character combinations, for an English analogy, if you type `hello world` often enough, rime knows to offer the completion of it when you only type `hl`. But the above are quite standard for any pinyin input, the vanilla emacs should have it too. An extra features of rime is that it allows the seamless insertion of occasional western words into the Chinese typing flow without the hiccups of having to toggle input method. This is an amazing experience if you use western words a lot in your Chinese. Rime also allows to narrow down the candidates by intonation, very useful. And rime is highly customizable (by a yaml file, not the emacs .el file). For example, if I use right arrow → often enough, I can customize rime so that when I type `ra`, I get the unicode symbol → as my candidate, among other standard Chinese character candidates. I am just scratching the surface of rime here, the power users of rime can really boost their efficiency and precisely specify their peculiarities (such as their dialects). One last thing, emacs-rime is *not* rime, it is just an emacs front-end of the rime input engine, which is cross-platform and OS-independent. I can use other rime front-ends to type Chinese in emacs, without emacs-rime. The best thing about emacs-rime is that it knows when I type M-x, I won't input Chinese!
Emacs: the new Denote sort mechanism (Dired, Org dynamic blocks)
13:09
Protesilaos Stavrou
Рет қаралды 2,4 М.
Emacs: advanced Org literate configuration
24:57
Protesilaos Stavrou
Рет қаралды 8 М.
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 26 МЛН
Вы чего бл….🤣🤣🙏🏽🙏🏽🙏🏽
00:18
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 73 МЛН
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
超凡蜘蛛
Рет қаралды 13 МЛН
Emacs: use-package essentials
35:45
Protesilaos Stavrou
Рет қаралды 4,4 М.
Emacs: introduction to GNUS
19:54
Protesilaos Stavrou
Рет қаралды 12 М.
Emacs. But why?
51:20
(Bit-Mage)
Рет қаралды 1,2 М.
Emacs: Denote links to Org headings
20:17
Protesilaos Stavrou
Рет қаралды 2,5 М.
EmacsConf 2023: Improving compiler diagnostics with overlays - Jeff Trull
20:58
EmacsConf and Emacs hangouts
Рет қаралды 287
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 58 М.
Emacs: file and Dired basics
1:02:38
Protesilaos Stavrou
Рет қаралды 13 М.
tree-sitter explained
15:00
TJ DeVries
Рет қаралды 82 М.
Vim Motions Guide (FASTER TEXT EDITING)
15:44
NycRat
Рет қаралды 31 М.
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 26 МЛН