summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-10-19 19:41:30 +0100
committerjao <jao@gnu.org>2024-10-19 19:41:30 +0100
commita06173474b0baadcb47bb8570764a572e9e0ebd0 (patch)
treefb082be626d882fa4ffc15d73897f1c3f4219755
parent6203f490e8747977c0dfdb797cd46327fe7c63dd (diff)
downloadelibs-a06173474b0baadcb47bb8570764a572e9e0ebd0.tar.gz
elibs-a06173474b0baadcb47bb8570764a572e9e0ebd0.tar.bz2
gnus: better arXiv capture
-rw-r--r--custom/jao-custom-gnus.el26
1 files changed, 21 insertions, 5 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index ece5167..440a44f 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -448,13 +448,20 @@
:config
(add-to-list 'org-capture-templates
'("X" "arXiv" entry (file "notes/physics/arxiv.org")
- "* %:subject\n\n %i \n %(jao-gnus-org-url)"
+ "* %:subject\n\n(jao-gnus-org-paragraph \"%i\")"
: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-org-paragraph (x)
+ (with-temp-buffer
+ (insert " " (string-trim (or x "")) "\n ")
+ (goto-char 0)
+ (fill-paragraph)
+ (goto-char (point-max))
+ (open-rectangle 0 (point))
+ (concat (buffer-string) "\n " (or jao-gnus-org-url ""))))
(defun jao-gnus-arXiv-capture ()
(interactive)
@@ -469,8 +476,9 @@
(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"))
+ (org-capture nil "X")
+ (set-mark (point))
+ (gnus-article-show-summary))
;;; article
;;;; config, headers
@@ -605,7 +613,15 @@
(gnus-demon-scan-news)
(jao-gnus--notify)))
-(gnus-demon-add-handler 'jao-gnus--scan 5 1)
+(defun jao-gnus-add-demon ()
+ (gnus-demon-add-handler 'jao-gnus--scan 5 1))
+
+(jao-gnus-add-demon)
+(gnus-demon-init)
+
+;; this is, in theory, not needed; but at some point in the way to emacs
+;; version 31 this idle timers have ceased to work after a sleep/awake cycle
+(add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon)
;;; add-ons
;;;; notifications