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

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

[elpa] externals/show-font bd9b392cf8 10/54: Simplify show-font--get-att


From: ELPA Syncer
Subject: [elpa] externals/show-font bd9b392cf8 10/54: Simplify show-font--get-attribute
Date: Tue, 10 Sep 2024 03:58:56 -0400 (EDT)

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

    Simplify show-font--get-attribute
---
 show-font.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/show-font.el b/show-font.el
index dfa4d35c9d..2a9969a245 100644
--- a/show-font.el
+++ b/show-font.el
@@ -157,12 +157,8 @@ matched against the output of the `fc-scan' executable."
     (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))
-             (output (shell-command-to-string (format "fc-scan %s" f)))
-             (match (string-match (format "%s: \"\\(.*\\)\"" attribute) 
output))
-             (found (match-string 1 output)))
-    (if (string-match-p "\"(s)" found)
-        (car (split-string found "\"(s)" :omit-nulls))
-      found)))
+             (output (shell-command-to-string (format "fc-scan -f \"%%{%s}\" 
%s" attribute f))))
+    output))
 
 (defun show-font--get-pangram ()
   "Return `show-font-pangram' or fallback string."



reply via email to

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