summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-04 18:16:10 +0100
committerjao <jao@gnu.org>2022-08-04 18:16:10 +0100
commit68280cc53bcef81ea684ee01276b091b93eb8a71 (patch)
tree072ce854a0e6e7d50c8667bdfd6a663052029f8f
parentf7446555b2410a03b35c1c343574c411676bb785 (diff)
downloadelibs-68280cc53bcef81ea684ee01276b091b93eb8a71.tar.gz
elibs-68280cc53bcef81ea684ee01276b091b93eb8a71.tar.bz2
better consult-recoll open functions
-rw-r--r--custom/jao-custom-gnus.el2
-rw-r--r--init.el16
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)
diff --git a/init.el b/init.el
index b1771a4..604ef71 100644
--- a/init.el
+++ b/init.el
@@ -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