summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-06-28 03:27:52 +0100
committerjao <jao@gnu.org>2022-06-28 03:27:52 +0100
commit1834b5c5c0b0040377328a9f01e25bf87a0d6b8b (patch)
tree87da8f1b45bbe310ceacae6364668e2200fe8402 /custom
parent9823e901c3d903e8ffe0a24ce692ad6192186643 (diff)
downloadelibs-1834b5c5c0b0040377328a9f01e25bf87a0d6b8b.tar.gz
elibs-1834b5c5c0b0040377328a9f01e25bf87a0d6b8b.tar.bz2
recoll code shuffling
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-completion.el75
1 files changed, 0 insertions, 75 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el
index 8afd4ae..47ada77 100644
--- a/custom/jao-custom-completion.el
+++ b/custom/jao-custom-completion.el
@@ -440,80 +440,5 @@
("C-S-l" . jao-link-hint-open-link-ext)
("C-x C-l" . recenter-top-bottom)))
-;;; recoll
-(jao-load-path "consult-recoll")
-
-(defun jao-recoll-format (title url mtype)
- (let* ((u (replace-regexp-in-string "/home/jao/" "" url))
- (u (replace-regexp-in-string
- "\\(doc\\|org/doc\\|.emacs.d/gnus/Mail\\|var/mail\\)/" "" u)))
- (format "%s (%s, %s)"
- title
- (propertize u 'face 'jao-themes-f00)
- (propertize mtype 'face 'jao-themes-f01))))
-
-(defun jao-recoll-open-html (file)
- (jao-afio--goto-www)
- (eww-open-file file))
-
-(defun jao-recoll-consult-messages ()
- (interactive)
- (consult-recoll "mime:message "))
-
-(defun jao-recoll-consult-docs ()
- (interactive)
- (consult-recoll (format "dir:%s/doc " jao-org-dir)))
-
-(defun jao-recoll-messages ()
- (interactive)
- (jao-recoll "mime:message "))
-
-(defun jao-recoll-docs ()
- (interactive)
- (jao-recoll (format "dir:%s/doc " jao-org-dir)))
-
-(defun jao-recoll-notes ()
- (interactive)
- (jao-recoll (format "dir:%s " jao-org-notes-dir)))
-
-(defun jao-recoll-consult-notes ()
- "Use consult-recoll to search notes."
- (interactive)
- (consult-recoll (format "dir:%s " jao-org-notes-dir)))
-
-(defun jao-recoll-open-with-notmuch (fname)
- (let ((id (with-temp-buffer
- (insert-file fname)
- (goto-char (point-min))
- (when (re-search-forward "[Mm]essage-[Ii][Dd]: <?\\([^><]+\\)>?"
- nil t)
- (match-string 1)))))
- (when id (notmuch-show (concat "id:" id)))))
-
-(with-eval-after-load "org"
- (org-link-set-parameters "message" :follow #'jao-recoll-open-with-notmuch))
-
-(use-package consult-recoll
- :init (setq consult-recoll-open-fns
- '(("application/pdf" . jao-open-doc)
- ("message/rfc822" . jao-recoll-open-with-notmuch)
- ("text/html" . jao-recoll-open-html))
- consult-recoll-search-flags nil
- consult-recoll-format-candidate #'jao-recoll-format)
- :config
- (transient-define-prefix jao-recoll-transient ()
- [["Consult recoll queries"
- ("r" "consult recoll query" consult-recoll)
- ("n" "consult recoll on notes" jao-recoll-consult-notes)
- ("d" "consult recoll on docs" jao-recoll-consult-docs)
- ("m" "consult recoll on messages" jao-recoll-consult-messages)]
- ["Recoll queries"
- ("R" "recoll query" jao-recoll)
- ("N" "recoll on notes" jao-recoll-notes)
- ("D" "consult recoll on docs" jao-recoll-docs)
- ("M" "consult recoll on messages" jao-recoll-messages)]])
-
- :bind (("s-r" . #'jao-recoll-transient)))
-
;;; .
(provide 'jao-custom-completion)