emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/emoji 9324139: Revert "Introduce a new variable inhibit-loading-


From: Lars Ingebrigtsen
Subject: scratch/emoji 9324139: Revert "Introduce a new variable inhibit-loading-fonts"
Date: Fri, 29 Oct 2021 10:50:15 -0400 (EDT)

branch: scratch/emoji
commit 932413913a4fc8489ce90a1ebf2ef2adbfa57f86
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Revert "Introduce a new variable inhibit-loading-fonts"
    
    This reverts commit 95254d0103548304b6e9fd0e6dce03d9ca866cbd.
    
    This didn't work very well in practice.
---
 lisp/play/emoji.el | 70 ++++++++++--------------------------------------------
 src/fontset.c      | 15 ++----------
 2 files changed, 15 insertions(+), 70 deletions(-)

diff --git a/lisp/play/emoji.el b/lisp/play/emoji.el
index 91ff9c1..c0c3dcc 100644
--- a/lisp/play/emoji.el
+++ b/lisp/play/emoji.el
@@ -167,35 +167,6 @@ character) under point is."
                  'help-echo (emoji--name glyph))))
       (insert "\n\n"))))
 
-(defun emoji--pick-read-affixation (names)
-  (mapcar
-   (lambda (name)
-     (list name (char-to-string
-                 (char-from-name
-                  (concat "EMOJI MODIFIER FITZPATRICK TYPE-" name)))))
-   names))
-
-(defun emoji--pick-read-tone (prompt initial-input history)
-  (let* ((names '("1-2" "3" "4" "5" "6"))
-         (str (completing-read
-               prompt
-               (lambda (string pred action)
-                 (if (eq action 'metadata)
-                     `(metadata
-                      (affixation-function . ,'emoji--pick-read-affixation))
-                   (complete-with-action action names string pred)))
-               nil t initial-input history)))
-    (char-to-string
-     (char-from-name (concat "EMOJI MODIFIER FITZPATRICK TYPE-" str)))))
-
-(transient-define-infix emoji-pick:--skin-tone ()
-  :description "Skin tone"
-  :class 'transient-option
-  :shortarg "-s"
-  :argument ""
-  :prompt "Skin tone: "
-  :reader #'emoji--pick-read-tone)
-
 (defun emoji--fontify-glyph (glyph &optional inhibit-derived)
   (propertize glyph 'face
               (if (and (not inhibit-derived)
@@ -283,21 +254,15 @@ character) under point is."
   (if (consp (caddr alist))
       (dolist (child (cdr alist))
         (emoji--adjust-displayable child))
-    (let ((inhibit-loading-fonts nil))
-      (setcdr
-       alist
-       (seq-filter
-        (lambda (glyph)
-          ;; Store all the emojis for later retrieval by
-          ;; the search feature.
-          (when-let ((name (emoji--name glyph)))
-            (setf (gethash (downcase name) emoji--all-bases) glyph))
-          ;; Say whether we should include in graphical displays.
-          (let ((symp (symbolp (char-displayable-p (elt glyph 0)))))
-            (unless symp
-              (setq inhibit-loading-fonts t))
-            (not symp)))
-        (cdr alist))))))
+    (setcdr alist (seq-filter
+                   (lambda (glyph)
+                     ;; Store all the emojis for later retrieval by
+                     ;; the search feature.
+                     (when-let ((name (emoji--name glyph)))
+                       (setf (gethash (downcase name) emoji--all-bases) glyph))
+                     ;; Say whether we should include in graphical displays.
+                     (not (symbolp (char-displayable-p (elt glyph 0)))))
+                   (cdr alist)))))
 
 (defun emoji--parse-emoji-test ()
   (setq emoji--labels nil)
@@ -468,25 +433,16 @@ character) under point is."
               (cl-loop for entry in
                        (emoji--compute-prefix
                         (if (equal mname "Emoji")
-                            (nconc
-                             (list (list "Recent")
-                                   ;;(list "Variations")
-                                   )
-                             alist)
+                            (cons (list "Recent") alist)
                           alist))
                        collect (list
                                 (car entry)
                                 (emoji--compute-name (cdr entry))
-                                (cond
-                                 ((equal (cadr entry) "Recent")
-                                  (emoji--recent-transient end-function))
-                                 ((equal (cadr entry) "Variations")
-                                  ;;(emoji-pick:--skin-tone)
-                                  )
-                                 (t
+                                (if (equal (cadr entry) "Recent")
+                                    (emoji--recent-transient end-function)
                                   (emoji--define-transient
                                    (cons (concat mname " > " (cadr entry))
-                                         (cddr entry)))))))
+                                         (cddr entry))))))
             ;; Insert an emoji.
             (cl-loop for glyph in alist
                      for i in (append (number-sequence ?a ?z)
diff --git a/src/fontset.c b/src/fontset.c
index 0c6100c..7d4bd65 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -657,11 +657,8 @@ fontset_find_font (Lisp_Object fontset, int c, struct face 
*face,
             the support of the character C.  That checking is costly,
             and even without the checking, the found font supports C
             in high possibility.  */
-         if (! inhibit_loading_fonts)
-           font_entity = font_find_for_lface (f, face->lface,
-                                              FONT_DEF_SPEC (font_def), -1);
-         else
-           font_entity = Qnil;
+         font_entity = font_find_for_lface (f, face->lface,
+                                            FONT_DEF_SPEC (font_def), -1);
          if (NILP (font_entity))
            {
              /* Record that no font matches the spec.  */
@@ -2175,14 +2172,6 @@ fontsets, if the default font can display the character.
 Set this to nil to make Emacs honor the fontsets instead.  */);
   use_default_font_for_symbols = 1;
 
-  DEFVAR_BOOL ("inhibit-loading-fonts", inhibit_loading_fonts,
-              doc: /*
-If non-nil, inhibit loading fonts.
-This is not meant to be used generally, but only in specific
-circumstances for certain characters where attempting to load fonts is
-known to be inefficient and futile.  */);
-  inhibit_loading_fonts = 0;
-
   DEFVAR_LISP ("ignore-relative-composition", Vignore_relative_composition,
               doc: /*
 Char table of characters which are not composed relatively.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]