branch: master
commit c9f23189468e0466f543504807d777fedcea0c3a
Author: Alex Bennée <alex.ben...@linaro.org>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    counsel.el (counsel-compile): Add helper for formatting text
    
    This aims to reduce the boilerplate with propertizing sections of the
    compile text to which we are about to add more.
---
 counsel.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/counsel.el b/counsel.el
index 2269c21..967b030 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5281,6 +5281,15 @@ trees."
                                 (match-string-no-properties 1)))))))
     (sort targets #'string-lessp)))
 
+(defun counsel-compile--pretty-propertize (leader text face)
+  "Return a pretty string of the form \" LEADER TEXT\".
+LEADER is propertized with a warning face and the remaining
+text with FACE."
+  (concat (propertize (concat " " leader " ")
+                      'face
+                      'font-lock-warning-face)
+          (propertize text 'face face)))
+
 (defun counsel--compile-get-make-targets (srcdir &optional blddir)
   "Return a list of Make targets for a given SRCDIR/BLDDIR combination.
 

Reply via email to