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

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

[elpa] master c9f2318 203/399: counsel.el (counsel-compile): Add helper


From: Oleh Krehel
Subject: [elpa] master c9f2318 203/399: counsel.el (counsel-compile): Add helper for formatting text
Date: Sat, 20 Jul 2019 14:57:23 -0400 (EDT)

branch: master
commit c9f23189468e0466f543504807d777fedcea0c3a
Author: Alex Bennée <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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

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