reddit / emacs

Entering specialized UTF symbols as an expert

gavenkoa · 2022-11-27 16:19
I want to type UTF 8 chars like arrows, emoji etc and want the input method to be "professional". I use regular `C-x 8` prefix, like `C-x 8 o` for Celsius sign or `C-x 8 <` for double quotation mark `«`: quite easy to memorize. Sometimes I fallback to `C-x 8 RET`. I use `ipa-x-sampa` for IPA and seems it is a /wˈaɪdspɹəd stˈændɚd/... For arrows I attempted to use `TeX` input method but I'm not a Latex guy, too lengthy to remember & type. I wander if `rfc1345` is popular, arrows are simple: `&->` or `&<=`. or other math stuff: `&(C` ⊂, `&(I` 〖, `&(U` ∩, `&(_` ⊆, `&+-` ±, `&!=` ≠, `&14` ¼, `&FA` ∀, `&TE` ∃. **UPDATE** My input toggler is: (defun my-toggle-input-method (&optional arg) (interactive "P") (if (numberp arg) (cond ((eq arg 1) (activate-input-method nil)) ((eq arg 2) (activate-input-method 'russian-computer)) ((eq arg 3) (activate-input-method 'ukrainian-computer)) ((eq arg 4) (activate-input-method 'greek)) ((eq arg 5) (activate-input-method 'ipa-x-sampa)) ((eq arg 6) (activate-input-method 'TeX)) ((eq arg 7) (activate-input-method 'rfc1345)) ) (toggle-input-method arg)) ) (global-set-key (kbd "C-\\") 'my-toggle-input-method)
agrostis · 2022-11-27 17:03
Frankly speaking, I prefer doing it with the compose key at X11 level (and WinCompose on Windows when I'm at my office PC). This allows me to use the same input mechanics not just in Emacs but in any application.
mickeyp · 2022-11-27 19:52
You could always make your own input method: https://www.masteringemacs.org/article/inserting-emoji-input-methods
xtifr · 2022-11-27 20:27
Seconding this. The compose key is both easy to use (often, downright intuitive), and extremely flexible. For arrows, for example, it's `Compose <-`, `Compose ->`, `Compose ^|`, and `Compose |v` to get ←, →, ↑, and ↓. And, of course, it works in my browser just as well as in Emacs, as this post demonstrates! ☺ The compose key's support for emoji *is* more limited, but I've added a handful of generally useful ones to my personal `~/.XCompose` file. If you rely heavily on access to a lot of emoji, you might want to explore other options, but I find it adequate to my simple requirements.
link0ff · 2022-11-28 12:14
After `C-x \ compose`, it's easy to use these keys without activating the input method with just e.g. `C-x \ - >` inserting `→`, etc.
odeuteronomy · 2022-11-29 01:17
In regard to entering special Unicode characters I’d recommend to use the built-in ‘abbrev’ package - https://olddeuteronomy.github.io/post/use-abbrev-to-enter-special-characters/
gavenkoa · 2022-11-29 17:37
I'm afraid of defining own shortcuts. Mentioned in the article reminds TeX input method. Seems the suggestion of using composing keyboard manager is valid: this way my experience transfer to different apps / OSes...
gavenkoa · 2022-11-29 17:43
Wow! `(describe-input-method 'compose)` I tried to search for math "for all" ∀ and "there exists" ∃, they are missing in `compose`... They are in `rfc1345` method...