diff options
author | jao <jao@gnu.org> | 2024-10-05 16:18:14 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2024-10-05 16:19:31 +0100 |
commit | 36893a1e2b3156338485668f90d5a6ff645d1ea4 (patch) | |
tree | 0c7bf8b855ec292ffa9e3726cccf095e109812ed /custom | |
parent | ca9a96b54f06e44f082b7c01f3493154a20a802a (diff) | |
download | elibs-36893a1e2b3156338485668f90d5a6ff645d1ea4.tar.gz elibs-36893a1e2b3156338485668f90d5a6ff645d1ea4.tar.bz2 |
gnus: fix for arxiv capture
Diffstat (limited to 'custom')
-rw-r--r-- | custom/jao-custom-gnus.el | 16 | ||||
-rw-r--r-- | custom/jao-custom-notmuch.el | 13 |
2 files changed, 20 insertions, 9 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 603fe89..6eb7952 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -448,18 +448,28 @@ :config (add-to-list 'org-capture-templates '("X" "arXiv" entry (file "notes/physics/arxiv.org") - "* %:subject\n %i" :immediate-finish t) + "* %:subject\n\n %i \n %(jao-gnus-org-url)" + :immediate-finish t) t) (org-capture-upgrade-templates org-capture-templates)) +(defvar jao-gnus-org-url nil) +(defun jao-gnus-org-url () (or jao-gnus-org-url "")) + (defun jao-gnus-arXiv-capture () (interactive) + (unless (derived-mode-p '(gnus-summary-mode)) (gnus-article-show-summary)) + (setq jao-subject (gnus-summary-article-subject)) (gnus-summary-select-article-buffer) (gnus-article-goto-part 0) - (forward-paragraph) (setq-local transient-mark-mode 'lambda) (set-mark (point)) - (goto-char (point-max)) + (forward-paragraph) + (save-excursion + (when (re-search-forward "^Link" nil t) + (beginning-of-line) + (setq jao-gnus-org-url (org-eww-url-below-point)))) + ;; (goto-char (point-max)) (org-capture nil "X")) ;;; article diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 3919897..42d9e12 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -588,12 +588,13 @@ ;;; arXiv (use-package org-capture :config - (add-to-list 'org-capture-templates - '("X" "arXiv" entry (file "notes/physics/arxiv.org") - "* %(jao-org-notmuch-last-subject)\n %i" - :immediate-finish t) - t) - (org-capture-upgrade-templates org-capture-templates)) + (when jao-notmuch-enabled + (add-to-list 'org-capture-templates + '("X" "arXiv" entry (file "notes/physics/arxiv.org") + "* %(jao-org-notmuch-last-subject)\n %i" + :immediate-finish t) + t) + (org-capture-upgrade-templates org-capture-templates))) (defun jao-notmuch-arXiv-capture () (interactive) |