diff options
Diffstat (limited to 'completion.org')
-rw-r--r-- | completion.org | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/completion.org b/completion.org index 49c718a..2d2ea91 100644 --- a/completion.org +++ b/completion.org @@ -268,19 +268,42 @@ (defun jao-recoll-format (title url mtype) (let* ((u (replace-regexp-in-string "/home/jao/" "" url)) - (u (replace-regexp-in-string "\\(doc\\|org/doc\\|var/mail\\)/" "" u))) + (u (replace-regexp-in-string + "\\(doc\\|org/doc\\|.emacs.d/gnus/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:messages ")) + + (defun jao-recoll-consult-docs () + (interactive) + (consult-recoll (format "dir:%s/doc " jao-org-dir))) + (use-package consult-recoll :init (setq consult-recoll-open-fns '(("application/pdf" . jao-open-doc) - ("message/rfc822" . jao-org-links-open-mail)) + ("message/rfc822" . jao-org-links-open-mail) + ("text/html" . jao-recoll-open-html)) consult-recoll-search-flags nil consult-recoll-format-candidate #'jao-recoll-format) - :bind (("C-c R" . #'consult-recoll))) + :config + (transient-define-prefix jao-recoll-transient () + ["Recoll queries" + ("o" "recoll query" jao-recoll) + ("r" "consult recoll query" consult-recoll) + ("n" "consult recoll on notes" jao-org-notes-recoll) + ("d" "consult recoll on docs" jao-recoll-consult-docs) + ("m" "consult recoll on messages" jao-recoll-consult-messages)]) + + :bind (("s-r" . #'jao-recoll-transient))) #+end_src *** dh-diff hunks |