[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb ba99110 242/449: Check for relevant headings when
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb ba99110 242/449: Check for relevant headings when handling attachments |
Date: |
Fri, 27 Nov 2020 23:15:48 -0500 (EST) |
branch: externals/gnorb
commit ba991103467b79bd50ab135c9d12b356d5506f65
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Check for relevant headings when handling attachments
* gnorb-gnus.el (gnorb-gnus-attach-part): When the user wants to attach
a mail attachment to a TODO heading, check if the message is
already associated with a heading, offer that first.
---
gnorb-gnus.el | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index e6c6a1d..ba72107 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -156,15 +156,28 @@ each message."
(defun gnorb-gnus-attach-part (handle &optional org-heading)
"Attach HANDLE to an existing org heading."
(let* ((filename (gnorb-gnus-save-part handle))
- ;; we should probably do the automatic location routine here,
- ;; as well.
(org-refile-targets gnorb-gnus-trigger-refile-targets)
- (org-heading (or org-heading
- (org-refile-get-location "Attach part to" nil t))))
+ (ref-msg-ids
+ (concat (gnus-fetch-original-field "references") " "
+ (gnus-fetch-original-field "in-reply-to")))
+ (rel-heading
+ (when gnorb-tracking-enabled
+ (car (gnorb-find-visit-candidates
+ ref-msg-ids))))
+ (org-heading
+ (if (and rel-heading
+ (y-or-n-p (message
+ "Attach part to %s"
+ (gnorb-pretty-outline rel-heading))))
+ rel-heading
+ (org-refile-get-location "Attach part to" nil t))))
(require 'org-attach)
(save-window-excursion
- (find-file (nth 1 org-heading))
- (goto-char (nth 3 org-heading))
+ (if (stringp org-heading)
+ (org-id-goto org-heading)
+ (progn
+ (find-file (nth 1 org-heading))
+ (goto-char (nth 3 org-heading))))
(org-attach-attach filename nil 'mv))))
(defun gnorb-gnus-save-part (handle)
- [elpa] externals/gnorb 0cb4d1a 201/449: Docstring for gnorb-scan-links, (continued)
- [elpa] externals/gnorb 0cb4d1a 201/449: Docstring for gnorb-scan-links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5c9ef6e 203/449: Don't create Org IDs when scanning for mails, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9ac84b7 218/449: Return links in the order which they were found, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a9535ae 223/449: Merge branch 'registry', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dd4e013 225/449: Restore action shouldn't quit summary buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 08e0742 229/449: Empty News and gnorb.texi files, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bcfd501 236/449: gitignore Elpa-generated stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 55a630d 238/449: Gnus hinting needs to check in-reply-to as well, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d2831b8 237/449: Refactor summary buffer hinting into separate function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2be4a71 240/449: Save point with marker when adding headers to replies, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ba99110 242/449: Check for relevant headings when handling attachments,
Stefan Monnier <=
- [elpa] externals/gnorb 1a0cfc7 243/449: Delete duplicates before and after finding candidates, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 35284f2 248/449: Add TODO for collecting BBDB messages by thread, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2c0f43d 249/449: Refinements to link extraction, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e1fb666 257/449: Function for deleting all assocations of an Org heading, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5688114 258/449: Bugfix: Adding mailtos to newly-setup messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 04ec3ab 264/449: Fix logic of choosing heading to trigger, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb de0dff5 274/449: Protection for message disassociation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 321b23b 276/449: Remove gnus-interactive, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8a9c167 277/449: Fix the cl-lib loading stuff, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fd91084 278/449: Remove incorrect "fix" for Gnus 5.13, Stefan Monnier, 2020/11/27