diff options
-rw-r--r-- | custom/jao-custom-gnus.el | 2 | ||||
-rw-r--r-- | init.el | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index ddc2606..cf50ed3 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -421,7 +421,7 @@ (with-temp-buffer (insert-file filename) (goto-char (point-min)) - (when (re-search-forward "[Mm]essage-[Ii][Dd]: <?\\([^><]+\\)>?" nil t) + (when (re-search-forward "^[Mm]essage-[Ii][Dd]: <?\\([^><]+\\)>?" nil t) (match-string 1)))) (defun jao-gnus-goto-file (filename &optional _page) @@ -961,8 +961,18 @@ (propertize mtype 'face 'jao-themes-f01)))) (defun jao-recoll-open-html (file &optional page) - (jao-afio--goto-www) - (eww-open-file file)) + (if (string-match-p "\.epub\\'" file) + (find-file file) + (jao-afio--goto-www) + (eww-open-file file))) + +(defun jao-recoll-open-pdf (file &optional page) + (if (string-match-p "/gnus/Mail/" file) + (funcall (or (cdr (assoc-string "message/rfc822" consult-recoll-open-fns)) + 'find-file) + file + page) + (jao-open-doc file page))) (defun jao-recoll-consult-messages () (interactive) @@ -979,7 +989,7 @@ (use-package consult-recoll :init (setq consult-recoll-open-fns - '(("application/pdf" . jao-open-doc) + '(("application/pdf" . jao-recoll-open-pdf) ("text/html" . jao-recoll-open-html)) consult-recoll-search-flags nil consult-recoll-inline-snippets t |