summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-01-08 20:54:36 +0000
committerjao <jao@gnu.org>2025-01-08 20:54:36 +0000
commit2a0151646e7675f7dec203422d8eaffc21dbbc3d (patch)
tree8b3b9c2facf69f083c17a5941dbd103eacce5666
parentaf29b9cfc030d83e0eff05213b26451faf388524 (diff)
downloadelibs-2a0151646e7675f7dec203422d8eaffc21dbbc3d.tar.gz
elibs-2a0151646e7675f7dec203422d8eaffc21dbbc3d.tar.bz2
gnus: url navigation and arxiv when using rss2email
-rw-r--r--custom/jao-custom-gnus.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 70823ef..85d6d0e 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -447,8 +447,12 @@
(use-package org-capture
:config
(add-to-list 'org-capture-templates
+ '("x" "arXiv" entry (file "notes/physics/arxiv.org")
+ "* %(jao-gnus-subject)\n\n %i" :immediate-finish t)
+ t)
+ (add-to-list 'org-capture-templates
'("X" "arXiv" entry (file "notes/physics/arxiv.org")
- "* %:subject\n\n(jao-gnus-org-paragraph \"%i\")"
+ "* %(jao-gnus-subject)\n\n%(jao-gnus-org-paragraph \"%i\")"
:immediate-finish t)
t)
(org-capture-upgrade-templates org-capture-templates))
@@ -462,21 +466,28 @@
(goto-char (point-max))
(open-rectangle 0 (point))
(concat (buffer-string) "\n " (or jao-gnus-org-url ""))))
+(defvar jao-gnus-subject nil)
+(defun jao-gnus-subject () jao-gnus-subject)
(defun jao-gnus-arXiv-capture ()
(interactive)
(unless (derived-mode-p '(gnus-summary-mode)) (gnus-article-show-summary))
- (setq jao-subject (gnus-summary-article-subject))
+ (setq jao-gnus-subject (gnus-summary-article-subject))
(gnus-summary-select-article-buffer)
(gnus-article-goto-part 0)
(setq-local transient-mark-mode 'lambda)
(set-mark (point))
(forward-paragraph)
- (save-excursion
- (when (re-search-forward "^Link" nil t)
- (beginning-of-line)
- (setq jao-gnus-org-url (org-eww-url-below-point))))
- (org-capture nil "X")
+ (unless (save-excursion
+ (when (re-search-forward "^Link" nil t)
+ (beginning-of-line)
+ (setq jao-gnus-org-url (org-eww-url-below-point))
+ (org-capture nil "X")
+ t))
+ (next-line)
+ (set-mark (point))
+ (end-of-buffer)
+ (org-capture nil "x"))
(set-mark (point))
(gnus-article-show-summary))
@@ -558,7 +569,7 @@
(save-excursion
(goto-char (point-min))
(when (or (search-forward-regexp "^Via: h" nil t)
- (search-forward-regexp "^URL: h" nil t)
+ (search-forward-regexp "^URL:[\n ]h" nil t)
(and (search-forward-regexp "^Link$" nil t)
(not (beginning-of-line))))
(cond (external (jao-browse-with-external-browser))