emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/show-font 3be8056ae5 24/54: Stop using show-font-extens


From: ELPA Syncer
Subject: [elpa] externals/show-font 3be8056ae5 24/54: Stop using show-font-extensions-regexp; define regexp directly
Date: Tue, 10 Sep 2024 03:58:58 -0400 (EDT)

branch: externals/show-font
commit 3be8056ae52079a278f2aa3b95f267e69dab0af7
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Stop using show-font-extensions-regexp; define regexp directly
    
    We do not need to have an autoloaded symbol for these cases.
---
 show-font.el | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/show-font.el b/show-font.el
index 65466403f7..5b660bdb4d 100644
--- a/show-font.el
+++ b/show-font.el
@@ -122,9 +122,6 @@ x×X .,·°;:¡!¿?`'‘’   ÄAÃÀ TODO
   "Face for smaller font preview title."
   :group 'show-font-faces)
 
-;;;###autoload
-(defconst show-font-extensions-regexp "\\.\\(ttf\\|otf\\)\\'"
-  "Regular expression to match font file extensions.")
 ;;;; Helper functions
 
 (defconst show-font-latin-alphabet
@@ -173,7 +170,7 @@ matched against the output of the `fc-scan' executable."
   (unless (executable-find "fc-scan")
     (error "Cannot find `fc-scan' executable; will not render font"))
   (when-let ((f (or file buffer-file-name))
-             (_ (string-match-p show-font-extensions-regexp f))
+             (_ (string-match-p "\\.\\(ttf\\|otf\\)\\'" f))
              (output (shell-command-to-string (format "fc-scan -f \"%%{%s}\" 
%s"
                                                       (shell-quote-argument 
attribute)
                                                       (shell-quote-argument 
f)))))
@@ -288,10 +285,10 @@ buffer."
 ;; somewhere else?  It seems wrong like this.
 
 ;;;###autoload
-(add-to-list 'file-name-handler-alist (cons show-font-extensions-regexp 
#'show-font-handler))
+(add-to-list 'file-name-handler-alist (cons "\\.\\(ttf\\|otf\\)\\'" 
#'show-font-handler))
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist (cons show-font-extensions-regexp 
'show-font-mode))
+(add-to-list 'auto-mode-alist (cons "\\.\\(ttf\\|otf\\)\\'" 'show-font-mode))
 
 (provide 'show-font)
 ;;; show-font.el ends here



reply via email to

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