branch: externals/show-font
commit bd9b392cf8b74c3d101e83809c6e588be041989c
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
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."