Function: emoji--layout

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

Signature

(emoji--layout COMMAND TITLE SPEC DONE-DERIVED)

Source Code

;; Defined in /usr/src/emacs/lisp/international/emoji.el.gz
(defun emoji--layout (command title spec done-derived)
  (let ((has-subs (consp (cadr spec))))
    (emoji--columnize
     (if has-subs
         (cl-loop for (key desc . glyphs) in (emoji--compute-prefix spec)
                  collect
                  (list key
                        (emoji--compute-name (cons desc glyphs))
                        command
                        :class 'emoji--narrow
                        :title (concat title " > " desc)
                        :done-derived (or (string-suffix-p "Recent" desc)
                                          done-derived)
                        :children glyphs))
       (cl-loop for glyph in spec
                for char in (emoji--char-sequence)
                for key = (string char)
                for derived = (and (not (or (eq done-derived t)
                                            (member glyph done-derived)))
                                   (gethash glyph emoji--derived))
                collect
                (if derived
                    (list key
                          (emoji--fontify-glyph glyph done-derived)
                          command
                          :class 'emoji--narrow
                          :title (concat title " " glyph)
                          :done-derived (or (eq done-derived t)
                                            (cons glyph done-derived))
                          :children (cons glyph derived))
                  (list key
                        (emoji--fontify-glyph glyph done-derived)
                        'emoji-insert-glyph))))
     (if has-subs 2 8))))