summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-gnus.el16
-rw-r--r--custom/jao-custom-notmuch.el13
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)