emacs/var/elfeed/db/data/a6/a64fab3f156a3170d308256232d4ee27b7e04f04
2022-01-03 12:49:32 -06:00

4 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>Mickey Petersen has another great post up at <a href="https://www.masteringemacs.org/">Mastering Emacs</a>. In the post, Mickey notes that Emacs 29 is going to have first class support for emoji. I dont use emoji much so I dont care but Mickeys post was still very interesting to me because he shows how to implement essentially the same functionality <a href="https://www.masteringemacs.org/article/inserting-emoji-input-methods">using an input method</a>.</p>
<p>Input methods are a way of temporarily switching to a specialized keyboard so that you can enter special symbols or diacritical marks. I use the TeX input method all the time when Im writing blog posts and find it an easy and convenient way of dealing with LaTeX symbols in a non-TeX buffer. Until I read Mickeys post, I didnt know much about input methods other than that the TeX method allowed me to enter LaTeX commands.</p>
<p>It turns out that its easy to implement an input method as Mickey shows by using it to make a simple emoji mode. He implements only four emoji but its easy to add as many as you like. The TL;DR is that you use <code>quail-define-package</code> to define the mode and <code>quail-define-rules</code> to establish the mappings between the key sequences and the symbols you want to insert.</p>
<p>The method is more powerful than Ive described as you can see by reading the documentation but its simple in the simple case and worth knowing about in case you have need of such a facility.</p>