Re: Emojis with quail - but only some

Michael Heerdegen via Users list for the GNU Emacs text editor <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Michael Heerdegen <[email protected]> writes:

> my goal: I want that hitting : starts the input of an emoji, so that
> :+1: would insert 👍.  Without the need to hit one additional key.

For reference, here is what I played with:

#+begin_src emacs-lisp
(defun my-:-start-emojy-maybe ()
  (interactive)
  (unless (eq current-input-method 'emoji)
    (run-with-idle-timer
     0 nil
     (lambda ()
       (push ?: unread-command-events))))
  (let ((default-input-method           'emoji)
        (default-transient-input-method 'emoji))
    (activate-transient-input-method))
  (set-transient-map ; ugh...
   (let ((map (make-sparse-keymap)))
     (define-key map [(control ??)] #'emoji-search)
     ;; keep the map activated after : had been processed
     (define-key map [?:]           #'my-:-start-emojy-maybe)
     map)))

(local-set-key [?:] #'my-:-start-emojy-maybe)
#+end_src


Michael.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.