From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: larsi@gnus.org, 52605@debbugs.gnu.org
Subject: bug#52605: [PATCH] Add isearch-emoji-by-name
Date: Mon, 10 Jan 2022 23:44:46 +0100 [thread overview]
Message-ID: <m1h7ab2otd.fsf@yahoo.es> (raw)
In-Reply-To: <86pmp0qbf5.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 10 Jan 2022 10:07:58 +0200")
Juri Linkov <juri@linkov.net> writes:
>
> 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
Thanks for the patch, I'm not super familiar with input methods, but it
seems to work well. I wish a refined/polished version of this code +
documentation could be part of the main Emacs distribution. It fits
well in the overall design of Emacs.
next prev parent reply other threads:[~2022-01-10 22:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m135mpyc8p.fsf.ref@yahoo.es>
2021-12-18 18:55 ` bug#52605: [PATCH] Add isearch-emoji-by-name Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-18 19:07 ` Eli Zaretskii
2021-12-19 0:48 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-19 6:53 ` Eli Zaretskii
2021-12-19 11:47 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-19 11:10 ` Lars Ingebrigtsen
2022-01-09 21:56 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-10 8:07 ` Juri Linkov
2022-01-10 22:44 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-01-12 6:02 ` Lars Ingebrigtsen
2022-01-12 17:50 ` Juri Linkov
2022-01-13 6:05 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1h7ab2otd.fsf@yahoo.es \
--to=bug-gnu-emacs@gnu.org \
--cc=52605@debbugs.gnu.org \
--cc=juri@linkov.net \
--cc=larsi@gnus.org \
--cc=mardani29@yahoo.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).