Function: emoji--compute-prefix

emoji--compute-prefix is a byte-compiled function defined in emoji.el.gz.

Signature

(emoji--compute-prefix ALIST)

Documentation

Compute characters to use for entries in ALIST.

We prefer the earliest unique letter.

Source Code

;; Defined in /usr/src/emacs/lisp/international/emoji.el.gz
(defun emoji--compute-prefix (alist)
  "Compute characters to use for entries in ALIST.
We prefer the earliest unique letter."
  (cl-loop with taken = (make-hash-table)
           for entry in alist
           for name = (car entry)
           collect (cons (cl-loop for char across (concat
                                                   (downcase name)
                                                   (upcase name))
                                  while (gethash char taken)
                                  finally (progn
                                            (setf (gethash char taken) t)
                                            (cl-return (string char))))
                         entry)))