[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Save Gnus attachments to Org using org-attach and helm-org-ql
From: |
Juan Manuel Macías |
Subject: |
Save Gnus attachments to Org using org-attach and helm-org-ql |
Date: |
Sun, 10 Apr 2022 08:49:46 +0000 |
Hi all,
I thought it wouldn't be a bad idea to be able to save attachments from
GNUS (current article) to any Org node, via org-attach. Since I use
helm-org-ql to quickly access the headlines of my org documents, it
occurred to me to write this action for helm-org-ql. I share it here in
case someone finds it useful.
Best regards,
Juan Manuel
#+begin_src emacs-lisp
(defun my-helm-org-ql/gnus-save-parts-to-org-attach (marker)
(interactive)
(switch-to-buffer (marker-buffer marker))
(goto-char marker)
(org-show-entry)
(when (not (member "ATTACH" (org-element-property :tags
(org-element-at-point))))
(org-toggle-tag "ATTACH"))
;; create attach dir if not exits
(let ((atch-dir (org-attach-dir t))
(art gnus-article-current))
(gnus-summary-save-parts "." atch-dir art)))
(with-eval-after-load 'helm-org-ql
(add-to-list 'helm-org-ql-actions
'("Save attachments" .
my-helm-org-ql/gnus-save-parts-to-org-attach) t))
#+end_src
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Save Gnus attachments to Org using org-attach and helm-org-ql,
Juan Manuel Macías <=