Completion agnostic font prompt

This commit is contained in:
TEC 2022-10-18 02:42:52 +08:00
parent 49490a4a23
commit 36b7c50641
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 7 additions and 7 deletions

View File

@ -115,13 +115,13 @@ Run after hardcoded setup, but before the screenshot is captured."
'string (let ((font (face-attribute 'default :font)))
(if (eq font 'unspecified) "monospace"
(symbol-name (font-get font :family))))
(if (fboundp #'counsel-fonts)
(ivy-read "Font: " (delete-dups (font-family-list))
:preselect screenshot-font-family
:require-match t
:history 'counsel-fonts-history
:caller 'counsel-fonts)
(completing-read "Font: " (delete-dups (font-family-list)))))
(completing-read
"Font: "
(mapcar
(lambda (f) (propertize f 'face (list :family f)))
;; TODO strip non-ascii fonts
(delete-dups (font-family-list)))
nil t nil nil screenshot-font-family))
(screenshot--define-infix
"-fs" "font-size" "Font size (pt)"