diff options
author | jao <jao@gnu.org> | 2021-03-31 01:40:24 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-03-31 01:40:24 +0100 |
commit | c7c1db477d534f46be5763f05541e00d5916bed0 (patch) | |
tree | 5a8b6bd051305e3598512798a20f2894da187cc4 /attic | |
parent | fa6d281597f94cda2824d8fdeb063ddd9007c0bb (diff) | |
download | elibs-c7c1db477d534f46be5763f05541e00d5916bed0.tar.gz elibs-c7c1db477d534f46be5763f05541e00d5916bed0.tar.bz2 |
unused org-mode stuff removed
Diffstat (limited to 'attic')
-rw-r--r-- | attic/counsel.org | 38 |
1 files changed, 31 insertions, 7 deletions
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 |