branch: externals/show-font
commit 0f46562e42a4cc7f2546392360debed724be87e0
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make sure to delete duplicates and sort fonts
---
 show-font.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/show-font.el b/show-font.el
index 401fc9a5df..9c8b799b9b 100644
--- a/show-font.el
+++ b/show-font.el
@@ -5,7 +5,7 @@
 ;; Author: Protesilaos Stavrou <i...@protesilaos.com>
 ;; Maintainer: Protesilaos Stavrou <i...@protesilaos.com>
 ;; URL: https://github.com/protesilaos/show-font
-;; Version: 0.1.0
+;; Version: 0.1.1
 ;; Package-Requires: ((emacs "28.1"))
 ;; Keywords: convenience, writing, font
 
@@ -196,12 +196,15 @@ matched against the output of the `fc-scan' executable."
 (defun show-font--get-installed-font-families (&optional full)
   "Return list of installed font families names.
 With optional FULL, return the full XLFD representation instead."
-  (mapcar
-   (lambda (font)
-     (if full
-         (aref font 6)
-       (format "%s" (aref font 0))))
-   (x-family-fonts)))
+  (sort
+   (delete-dups
+    (mapcar
+     (lambda (font)
+       (if full
+           (aref font 6)
+         (format "%s" (aref font 0))))
+     (x-family-fonts)))
+   #'string-lessp))
 
 (defun show-font-installed-p (family)
   "Return non-nil if font family FAMILY is installed on the system.

Reply via email to