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

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

[elpa] master df9ad89 220/348: counsel.el (counsel-rpm): New command


From: Oleh Krehel
Subject: [elpa] master df9ad89 220/348: counsel.el (counsel-rpm): New command
Date: Sat, 8 Apr 2017 11:04:00 -0400 (EDT)

branch: master
commit df9ad89bec43777513b3f0efe031cd81dcf47820
Author: Omair Majid <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-rpm): New command
    
    Fixes #695
---
 counsel.el | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/counsel.el b/counsel.el
index cb1da76..e4ade60 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1537,6 +1537,26 @@ INITIAL-INPUT can be given as the initial minibuffer 
input."
                         (message (cdr x)))
               :caller 'counsel-dpkg)))
 
+;;** `counsel-rpm'
+;;;###autoload
+(defun counsel-rpm ()
+  "Call the \"rpm\" shell command."
+  (interactive)
+  (let ((cands (mapcar
+                (lambda (x)
+                  (let ((y (split-string x "|")))
+                    (cons (format "%-40s   %s"
+                                  (ivy--truncate-string
+                                   (nth 0 y) 40)
+                                  (nth 1 y))
+                          (mapconcat #'identity y " "))))
+                (split-string
+                 (shell-command-to-string "rpm -qa --qf 
\"%{NAME}|%{SUMMARY}\\n\"") "\n" t))))
+    (ivy-read "rpm: " cands
+              :action (lambda (x)
+                        (message (cdr x)))
+              :caller 'counsel-rpm)))
+
 ;;** File Jump and Dired Jump
 
 ;;;###autoload



reply via email to

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