CLOSED: [2020-02-12 Wed 18:28] SCHEDULED: <2020-02-12 Wed> :PROPERTIES: :CREATED: [2020-02-12 Wed 14:54] :ID: 2020-02-12-my-insert-character :END: :LOGBOOK: - State "DONE" from "DONE" [2020-02-13 Thu 09:06] - State "DONE" from "NEXT" [2020-02-12 Wed 18:28] :END: Update 2020-02-13: trying to move from =insert-char= to =counsel-unicode-char= after this [[https://www.reddit.com/r/emacs/comments/f2ut1v/searching_and_typing_unicode_characters_like/fhgtobs/][reddit comment]] [[id:2017-11-26-Mastodon][Mastodon-user]] [[https://mastodon.social/@jeeger][@jeeger]] tooted about a nice way to search for [[https://en.wikipedia.org/wiki/Unicode][Unicode]] characters such as Emojis: #+CAPTION: Screenshot jeeger from mastodon.social with function definition of emacs-ime(). #+ATTR_HTML: :alt Use #emacs to enter UTF-8 characters... #+ATTR_HTML: :align center :width 572 [[tsfile:2020-02-12T10.07 mastodon.social - jeeger - Use #emacs to enter UTF-8 characters emacs-ime -- screenshots publicvoit.png][https://mastodon.social/@jeeger/103645084161888349]] #+CAPTION: Screenshot jeeger from mastodon.social with an animated GIF. #+ATTR_HTML: :alt And here we are, a X11-wide #emacs-based method to enter unicode symbols with completion. + animated GIF #+ATTR_HTML: :align center :width 573 [[tsfile:2020-02-12T11.18 mastodon.social - jeeger - And here we are, a X11-wide emacs-based method to enter unicode symbols with completion -- screenshots publicvoit.png][https://mastodon.social/@jeeger/103645362515054820]] Unlike somebody would think that this is only relevant within Emacs, this method is using the really nice built-in Emacs character search for entering special characters in any application: 1. Define =my-insert-char()= in your Emacs configuration (see below). 2. Manually test in the command line using the following line: : emacsclient -c -e '(my-insert-char)' 3. Map to a system-wise keyboard shortcut and use it to put arbitrary Unicode characters in the system clipboard. #+BEGIN_SRC emacs-lisp (defun my-insert-char () (interactive) (with-temp-buffer (call-interactively 'insert-char) ;; classic method ;; (call-interactively 'counsel-unicode-char) ;; improved usability but inserts characters differently (kill-ring-save (point-min) (point-max)))) #+END_SRC I mapped this command to =Fn-Search= which is a special key that is available on some keyboards. This way, I can search for something like "arrow" and using =TAB= completion to get something like this: ⤴ For emojis, I might search for "happy" to get "happy person raising one hand": 🙋 This is going to be an additional input method to me besides [[https://blog.tommoor.com/emojione-picker/][emojione-picker]].