From c7c1db477d534f46be5763f05541e00d5916bed0 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 31 Mar 2021 01:40:24 +0100 Subject: unused org-mode stuff removed --- attic/counsel.org | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'attic') diff --git a/attic/counsel.org b/attic/counsel.org index 5732fb7..6fbd591 100644 --- a/attic/counsel.org +++ b/attic/counsel.org @@ -64,13 +64,6 @@ :diminish) #+end_src * counsel add-ons -*** recoll - #+BEGIN_SRC emacs-lisp - (use-package jao-recoll) - (use-package jao-counsel-recoll - :after counsel - :bind (("C-c R" . jao-counsel-recoll))) - #+END_SRC *** notmuch #+begin_src emacs-lisp (use-package counsel-notmuch @@ -78,6 +71,37 @@ :config (with-eval-after-load "gnus-group" (define-key gnus-group-mode-map "Gg" 'counsel-notmuch))) #+end_src +*** recoll + #+begin_src emacs-lisp + (require 'jao-recoll) + (defvar jao-counsel-recoll--history nil) + (defun jao-counsel-recoll--function (str) + (let ((xs (counsel-recoll-function str))) + (cl-remove-if-not (lambda (x) (string-prefix-p "file://" x)) xs))) + + (defun jao-counsel-recoll (&optional initial-input) + (interactive) + (counsel-require-program "recoll") + (ivy-read "recoll: " 'jao-counsel-recoll--function + :initial-input initial-input + :dynamic-collection t + :history 'jao-counsel-recoll--history + :action (lambda (x) + (when (string-match "file://\\(.*\\)\\'" x) + (let ((file-name (match-string 1 x))) + (if (string-match "pdf$" x) + (jao-open-doc file-name) + (find-file file-name))))) + :unwind #'counsel-delete-process + :caller 'jao-counsel-recoll)) + + (defun jao-counsel-recoll--recoll (_s) (jao-recoll ivy-text)) + + (ivy-set-actions 'jao-counsel-recoll + '(("x" jao-counsel-recoll--recoll "List in buffer"))) + + (global-set-key (kbd "C-c R") #'jao-counsel-recoll) + #+end_src * ivy rich #+begin_src emacs-lisp (use-package ivy-rich -- cgit v1.2.3