branch: master
commit 32828712b4b86f869a1e6f41b0a2d6d11486d11c
Author: Justin Burkett <[email protected]>
Commit: Justin Burkett <[email protected]>

    Highlight interactive functions in counsel-describe-function
    
    counsel.el (counsel-describe-function-transformer): Add
    counsel.el (counsel-describe-function): Update docstring
---
 counsel.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 8165c75..3030a44 100644
--- a/counsel.el
+++ b/counsel.el
@@ -481,9 +481,21 @@ Variables declared using `defcustom' are highlighted 
according to
  '(("I" counsel-info-lookup-symbol "info")
    ("d" counsel--find-symbol "definition")))
 
+(defun counsel-describe-function-transformer (function-name)
+  "Propertize FUNCTION-NAME if it's an interactive function."
+  (if (commandp (intern function-name))
+      (propertize function-name 'face 'font-lock-function-name-face)
+    function-name))
+
+(ivy-set-display-transformer
+ 'counsel-describe-function 'counsel-describe-function-transformer)
+
 ;;;###autoload
 (defun counsel-describe-function ()
-  "Forward to `describe-function'."
+  "Forward to `describe-function'.
+
+Interactive functions \(i.e., commands) are highlighted according
+to `font-lock-function-name-face'."
   (interactive)
   (let ((enable-recursive-minibuffers t))
     (ivy-read "Describe function: "

Reply via email to