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

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

[elpa] externals/ivy-hydra 066ed7b 362/395: Added pretty counsel-linux-a


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 066ed7b 362/395: Added pretty counsel-linux-app-format-function
Date: Thu, 25 Feb 2021 08:32:39 -0500 (EST)

branch: externals/ivy-hydra
commit 066ed7bd1f6d6070258e1b1d703350bc23286057
Author: Valentin Herrmann <herr.valentin.mann@gmail.com>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Added pretty counsel-linux-app-format-function
    
    * counsel.el (counsel-linux-app-format-function-name-pretty): New
    function.
    (counsel-linux-app-format-function): Offer it as a choice.
    
    Copyright-paperwork-exempt: yes
    
    Closes #2741.
---
 counsel.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/counsel.el b/counsel.el
index f690cc6..8a5df31 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5904,6 +5904,7 @@ as arguments."
           (const :tag "Command : Name - Comment" 
counsel-linux-app-format-function-default)
           (const :tag "Name - Comment (Command)" 
counsel-linux-app-format-function-name-first)
           (const :tag "Name - Comment" 
counsel-linux-app-format-function-name-only)
+          (const :tag "Name - Comment (Pretty)" 
counsel-linux-app-format-function-name-pretty)
           (const :tag "Command" counsel-linux-app-format-function-command-only)
           (function :tag "Custom")))
 
@@ -6007,6 +6008,16 @@ EXEC is the command to launch the application."
   "Display only the command EXEC when formatting Linux application names."
   exec)
 
+(defun counsel-linux-app-format-function-name-pretty (name comment _exec)
+  "Format Linux application names with the NAME (and COMMENT) only, but 
pretty."
+  (format "% -45s%s"
+          (propertize
+           (ivy--truncate-string name 45)
+           'face 'counsel-application-name)
+          (if comment
+              (concat ": " comment)
+            "")))
+
 (defun counsel-linux-apps-list-desktop-files ()
   "Return an alist of all Linux applications.
 Each list entry is a pair of (desktop-name . desktop-file).



reply via email to

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