summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-20 02:48:21 +0100
committerjao <jao@gnu.org>2021-06-20 02:48:21 +0100
commit50d3eefc9a9c595dac8cb08515caf46991dc3a59 (patch)
tree2b0a5a0cf5acccf29311f98815683861beb8ddee /email.org
parent0746f709dd06e4b636e1565e83264d16fb9a2d82 (diff)
downloadelibs-50d3eefc9a9c595dac8cb08515caf46991dc3a59.tar.gz
elibs-50d3eefc9a9c595dac8cb08515caf46991dc3a59.tar.bz2
ol-notmuch
Diffstat (limited to 'email.org')
-rw-r--r--email.org73
1 files changed, 23 insertions, 50 deletions
diff --git a/email.org b/email.org
index dacbedf..9010012 100644
--- a/email.org
+++ b/email.org
@@ -329,7 +329,8 @@
(:name "S" :query "tag:new and tag:bigml and tag:support")
(:name "W" :query "tag:new and tag:bigml" :face jao-themes-dimm)
(:name "I" :query "tag:new and tag:jao and tag:inbox")
- (:name "J" :query "tag:new and tag:jao" :face jao-themes-dimm)
+ (:name "J" :query "tag:new and tag:jao and not tag:emacs"
+ :face jao-themes-dimm)
(:name "E" :query "tag:new and tag:emacs" :face jao-themes-dimm)
(:name "N" :query "tag:new and tag:gmane and not tag:emacs"
:face jao-themes-dimm)
@@ -401,6 +402,24 @@
,(jao-notmuch--q "new" nil "n" '("tag:new"))
,(jao-notmuch--q "draft" nil "d" '("tag:draft"))))
#+end_src
+*** enclosures
+ #+begin_src emacs-lisp
+ (with-eval-after-load "notmuch-show"
+ (defun jao-notmuch-open-enclosure (add)
+ (interactive "P")
+ (with-current-notmuch-show-message
+ (goto-char (point-min))
+ (if (not (search-forward "Enclosure:" nil t))
+ (user-error "No enclosure in message body")
+ (re-search-forward "https?://" nil t)
+ (if-let (url (thing-at-point-url-at-point))
+ (progn
+ (message "%s %s ..." (if add "Adding" "Playing") url)
+ (unless add (jao-mpc-clear))
+ (jao-mpc-add-url url)
+ (unless add (jao-mpc-play)))
+ (error "Found an enclosure, but not a link!"))))))
+ #+end_src
*** package
#+begin_src emacs-lisp
(if (< emacs-major-version 28)
@@ -408,7 +427,6 @@
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/"))
(use-package notmuch
- ;; :ensure t
:init
(setq notmuch-draft-folder "trove/drafts"
notmuch-draft-quoted-tags '("part")
@@ -475,21 +493,6 @@
(let ((notmuch-hello-auto-refresh nil)) (notmuch-hello)))
(jao-notmuch-hello-first))))
- (defun jao-notmuch-open-enclosure (add)
- (interactive "P")
- (with-current-notmuch-show-message
- (goto-char (point-min))
- (if (not (search-forward "Enclosure:" nil t))
- (user-error "No enclosure in message body")
- (re-search-forward "https?://" nil t)
- (if-let (url (thing-at-point-url-at-point))
- (progn
- (message "%s %s ..." (if add "Adding" "Playing") url)
- (unless add (jao-mpc-clear))
- (jao-mpc-add-url url)
- (unless add (jao-mpc-play)))
- (error "Found an enclosure, but not a link!")))))
-
:hook ((notmuch-hello-refresh . jao-notmuch-notify)
(jao-afio-switch . jao-notmuch-refresh-hello))
@@ -610,37 +613,7 @@
*** org mode integration
Stolen and adapted from [[https://gist.github.com/fedxa/fac592424473f1b70ea489cc64e08911][Fedor Bezrukov]].
#+begin_src emacs-lisp
- (with-eval-after-load "org"
- (with-eval-after-load "notmuch"
- (org-link-set-parameters "notmuch"
- :follow 'org-notmuch-open
- :store 'org-notmuch-store-link)
-
- (defun org-notmuch-open (id)
- "Visit the notmuch message or thread with id ID."
- (notmuch-show id))
-
- (defun org-notmuch-store-link ()
- "Store a link to a notmuch mail message."
- (case major-mode
- ((notmuch-show-mode notmuch-tree-mode)
- ;; Store link to the current message
- (let* ((id (notmuch-show-get-message-id))
- (link (concat "notmuch:" id))
- (description (format "Mail: %s"
- (notmuch-show-get-subject))))
- (org-store-link-props
- :type "notmuch"
- :link link
- :description description)))
- (notmuch-search-mode
- ;; Store link to the thread on the current line
- (let* ((id (notmuch-search-find-thread-id))
- (link (concat "notmuch:" id))
- (description (format "Mail: %s"
- (notmuch-search-find-subject))))
- (org-store-link-props
- :type "notmuch"
- :link link
- :description description)))))))
+ (jao-load-path "ol-notmuch")
+ (use-package ol-notmuch
+ :demand t)
#+end_src