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

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

[elpa] externals/ivy-hydra 22422dd 219/395: counsel.el (counsel-fonts):


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 22422dd 219/395: counsel.el (counsel-fonts): Add a custom transformer with font sample
Date: Thu, 25 Feb 2021 08:32:06 -0500 (EST)

branch: externals/ivy-hydra
commit 22422dde13ffd77ac1fd0d442e92a4e893e57770
Author: Nathan Moreau <nathan.moreau@m4x.org>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel-fonts): Add a custom transformer with font sample
    
    Fixes #2508
---
 counsel.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/counsel.el b/counsel.el
index cae8ff7..3386a5d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5388,6 +5388,15 @@ You can insert or kill the name of the selected font."
               :action #'insert
               :caller 'counsel-fonts)))
 
+(ivy-configure 'counsel-fonts
+  :display-transformer-fn #'counsel--font-with-sample)
+
+(defun counsel--font-with-sample (font-name)
+  "Format function for `counsel-fonts'."
+  (format "%-75s%s" font-name
+          (propertize "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                      'face (list :family font-name))))
+
 ;;** `counsel-kmacro'
 (defvar counsel-kmacro-map
   (let ((map (make-sparse-keymap)))



reply via email to

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