feat(misc): add helper command to display list of available fonts

This commit is contained in:
2023-11-20 19:40:54 +00:00
parent e74a3bd3ad
commit c6d5682037
2 changed files with 23 additions and 0 deletions

View File

@@ -72,6 +72,7 @@
;; Misc.
(require 'siren-explain-pause)
(require 'siren-list-available-fonts)
(require 'siren-lorem-ipsum)
(require 'siren-rand)
(require 'siren-refine)

View File

@@ -0,0 +1,22 @@
;;; siren-list-available-fonts.el --- jimeh's Emacs Siren: list-available-fonts helper.
;;; Commentary:
;; Helper function to list available fonts in a temporary buffer.
;;; Code:
(defun list-available-fonts ()
"Display a list of available fonts in a new buffer."
(interactive)
(let ((font-list (sort (font-family-list) 'string<))
(buffer-name "*Available Fonts*"))
(with-output-to-temp-buffer buffer-name
(with-current-buffer buffer-name
(dolist (font font-list)
(insert font "\n"))
(special-mode)))
(pop-to-buffer buffer-name)))
(provide 'siren-list-available-fonts)
;;; siren-list-available-fonts.el ends here