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

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

[elpa] externals/ivy-hydra aa47396 218/395: counsel.el (counsel-fonts):


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra aa47396 218/395: counsel.el (counsel-fonts): Preselect the current font
Date: Thu, 25 Feb 2021 08:32:06 -0500 (EST)

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

    counsel.el (counsel-fonts): Preselect the current font
---
 counsel.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index a5e9b66..cae8ff7 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5379,11 +5379,14 @@ selected color."
 
 You can insert or kill the name of the selected font."
   (interactive)
-  (ivy-read "Font: " (delete-dups (font-family-list))
-            :require-match t
-            :history 'counsel-fonts-history
-            :action #'insert
-            :caller 'counsel-fonts))
+  (let ((current-font
+         (symbol-name (font-get (face-attribute 'default :font) :family))))
+    (ivy-read "Font: " (delete-dups (font-family-list))
+              :preselect current-font
+              :require-match t
+              :history 'counsel-fonts-history
+              :action #'insert
+              :caller 'counsel-fonts)))
 
 ;;** `counsel-kmacro'
 (defvar counsel-kmacro-map



reply via email to

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