[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52605: [PATCH] Add isearch-emoji-by-name
From: |
Juri Linkov |
Subject: |
bug#52605: [PATCH] Add isearch-emoji-by-name |
Date: |
Mon, 10 Jan 2022 10:07:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> Also, I forgot to ask in my original message: Is there a plan to add an
> Emoji input method to Emacs? If so, the input method could be used
> during an isearch and this patch won't be necessary, right? Another
> benefit of the input method is that it will work in other situations as
> well, like in a query-replace.
I agree the input method is more general solution than a new isearch command.
#+begin_src emacs-lisp
;;; emoji.el --- Quail package for emoji character composition -*-
lexical-binding: t -*-
;; Quail package `emoji' is based on emoji.el package.
;; This input method supports the same key sequences as the names
;; defined by the `C-x 8 e s' completions in emoji.el.
(quail-define-package
"emoji" "UTF-8" "😀" t
"Use the same key sequences as in `C-x 8 e s' completions defined in emoji.el."
'(("\t" . quail-completion))
t nil nil nil nil nil nil nil nil t)
(eval-when-compile
(require 'emoji)
(emoji--init)
(defmacro emoji--define-rules ()
`(quail-define-rules
,@(let ((rules nil))
(maphash (lambda (from to)
(push (list from (if (stringp to)
(vector to)
to))
rules))
emoji--all-bases)
rules))))
(emoji--define-rules)
(provide 'emoji)
;;; emoji.el ends here
#+end_src