summaryrefslogtreecommitdiffhomepage
path: root/custom/jao-custom-completion.el
diff options
context:
space:
mode:
Diffstat (limited to 'custom/jao-custom-completion.el')
-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)