[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 742119a 181/395: counsel.el (counsel-tracker)
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 742119a 181/395: counsel.el (counsel-tracker): New command |
Date: |
Thu, 25 Feb 2021 08:31:58 -0500 (EST) |
branch: externals/ivy-hydra
commit 742119ad6fb7ba26e18df2c40a723f36b71287e8
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel.el (counsel-tracker): New command
Fixes #2484
---
counsel.el | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/counsel.el b/counsel.el
index fc7290c..19926a2 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2617,6 +2617,34 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
:unwind-fn #'counsel-delete-process
:exit-codes '(1 "Nothing found"))
+;;** `counsel-tracker'
+(defun counsel-tracker-function (input)
+ "Call the \"tracker\" shell command with INPUT."
+ (or
+ (ivy-more-chars)
+ (progn
+ (counsel--async-command
+ (format
+ "tracker sparql -q \"SELECT ?url WHERE { ?s a nfo:FileDataObject ;
nie:url ?url . FILTER (STRSTARTS (?url, 'file://$HOME/')) . FILTER regex(?url,
'%s') }\" | tail -n +2 | head -n -1"
+ (counsel--elisp-to-pcre (funcall ivy--regex-function input))))
+ '("" "working..."))))
+
+(defun counsel-tracker-transformer (str)
+ (if (string-match "file:///" str)
+ (decode-coding-string (url-unhex-string (substring str 9)) 'utf-8)
+ str))
+
+;;;###autoload
+(defun counsel-tracker ()
+ (interactive)
+ (ivy-read "Tracker: " 'counsel-tracker-function
+ :dynamic-collection t
+ :action (lambda (s) (find-file (counsel-tracker-transformer s)))
+ :caller 'counsel-tracker))
+
+(ivy-configure 'counsel-tracker
+ :display-transformer-fn #'counsel-tracker-transformer)
+
;;** `counsel-fzf'
(defvar counsel-fzf-cmd "fzf -f \"%s\""
"Command for `counsel-fzf'.")
- [elpa] externals/ivy-hydra aefd669 114/395: swiper.el (swiper-query-replace): Fix for ivy--regex-ignore-order, (continued)
- [elpa] externals/ivy-hydra aefd669 114/395: swiper.el (swiper-query-replace): Fix for ivy--regex-ignore-order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9fd766d 122/395: counsel.el (counsel-evil-register-face): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 47bd7b1 119/395: Handle case correctly in `counsel-grep-like-occur', Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e860b11 116/395: ivy.el (ivy--resize-minibuffer-to-fit): Fix "M-o" not showing the list of actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 068ed9c 131/395: counsel-kmacro: Clarify Emacs's behavior regarding counter initial values., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 56807a1 134/395: counsel.el (counsel-recentf): Add "d" action, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7084d60 154/395: counsel.el (counsel-cd): Default to the directory of the current buffer, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fcf5dcf 159/395: ivy.el (ivy--compute-extra-actions): Use the provided doc for "o", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e7cc776 174/395: swiper.el (swiper-verbose): New defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2894f11 177/395: ivy.el (magic-slash): comment out windows behaviour, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 742119a 181/395: counsel.el (counsel-tracker): New command,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 9ccd93b 191/395: ivy-hydra.el (ivy-hydra-read-action): Work for "C-M-o", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra bba92e0 188/395: counsel.el (counsel-file-name-filter-alist): Modify perl entry, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 64f05f4 189/395: swiper.el (swiper-font-lock-exclude): Add sieve-mode, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6f04865 185/395: ivy.el (ivy-init-fns-alist): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1b426e1 202/395: Fix byte-compilation warning in Emacs 28, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f9fa30d 211/395: More compatibility fixes, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 48e56da 305/395: Extend :type of counsel-async-command-delay, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0eebf24 318/395: ivy.el (ivy--partial-cd-for-single-directory): Fix for ignore-order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra edefba7 304/395: ivy-test.el (ivy-read-alist-multi-cands): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra aa47396 218/395: counsel.el (counsel-fonts): Preselect the current font, Basil L. Contovounesios, 2021/02/25