[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb de4b0e8 145/449: Associate outgoing messages with
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb de4b0e8 145/449: Associate outgoing messages with arbitrary headings |
Date: |
Fri, 27 Nov 2020 23:15:27 -0500 (EST) |
branch: externals/gnorb
commit de4b0e8aeccba313b7068dc626723a58045c0c9a
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Associate outgoing messages with arbitrary headings
Previously, calling gnorb-gnus-outgoing-do-todo on messages under
composition would automatically either make a new TODO, or trigger state
change on an existing todo. With a prefix arg, now allow the user to
choose an arbitrary heading that this message should be associated with.
lisp/gnorb-gnus.el: (gnorb-gnus-outgoing-do-todo) prefix arg prompts for
new heading to associate message with.
---
lisp/gnorb-gnus.el | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index d70ed1d..ef911ed 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -282,6 +282,10 @@ message that isn't referenced by any TODOs, a new TODO
will be
created. If it references an existing TODO, you'll be prompted to
trigger a state-change or a note on that TODO.
+Otherwise, you can call it with a prefix arg to associate the
+sending/sent message with an existing Org subtree, and trigger an
+action on that subtree.
+
If a new todo is made, it needs a capture template: set
`gnorb-gnus-new-todo-capture-key' to the string key for the
appropriate capture template. If you're using a gnus-based
@@ -294,14 +298,27 @@ manual (org) Template expansion section). If you don't,
then the
the outgoing message will still be available -- nothing else will
work."
(interactive "P")
- (let (header-ids ref-ids rel-headings gnorb-org-window-conf
- reply-id reply-group)
+ (let ((org-refile-targets gnorb-gnus-trigger-refile-targets)
+ header-ids ref-ids rel-headings gnorb-org-window-conf
+ reply-id reply-group)
+ (when arg
+ (setq rel-headings
+ (org-refile-get-location "Trigger action on" nil t))
+ (setq rel-headings
+ (list (list (save-window-excursion
+ (find-file (nth 1 rel-headings))
+ (goto-char (nth 3 rel-headings))
+ (org-id-get-create))))))
(if (not (eq major-mode 'message-mode))
;; The message is already sent, so we're relying on whatever was
;; stored into `gnorb-gnus-sending-message-info'.
- (progn
+ (if arg
+ (progn
+ (push (caar rel-headings) gnorb-message-org-ids)
+ (gnorb-org-restore-after-send))
(setq ref-ids (plist-get gnorb-gnus-sending-message-info :refs))
- (if ref-ids ;; the message might be relevant to some TODO
+ (if ref-ids
+ ;; the message might be relevant to some TODO
;; heading(s). But if there had been org-id
;; headers, they would already have been
;; handled when the message was sent.
@@ -326,7 +343,11 @@ work."
(widen)
(message-narrow-to-headers-or-head)
(setq header-ids (mail-fetch-field gnorb-mail-header nil nil t))
- (setq ref-ids (mail-fetch-field "References" t))
+ ;; With a prefix arg we do not check references, because the
+ ;; whole point is to add new references. We still want to know
+ ;; what org id headers are present, though, so we don't add
+ ;; duplicates.
+ (setq ref-ids (unless arg (mail-fetch-field "References" t)))
(setq reply-group (car-safe (read (mail-fetch-field "X-Draft-From" t))))
;; when it's a reply, store a link to the reply just in case.
;; This is pretty embarrassing -- we follow a link just to
- [elpa] externals/gnorb 87137be 330/449: gnorb-bbdb.el: Fix matching of posting styles, (continued)
- [elpa] externals/gnorb 87137be 330/449: gnorb-bbdb.el: Fix matching of posting styles, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9c918ab 337/449: Bump version to 1.1.2, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2086922 342/449: Fixes to previous commit, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f3acab5 345/449: Handle forwarding from gnorb-mode summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f963a32 346/449: Don't ignore entries with no sender key, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 42ba9d9 347/449: Change the gnus hook to use for hinting, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e17a402 353/449: Mess with TODOs in README.org, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b53c93f 354/449: Enormous quantities of compiler-inspired fixes, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4a8fa84 369/449: Fix nnir search routine, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dfb2acd 375/449: Bug fix in mail tracking extraction, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb de4b0e8 145/449: Associate outgoing messages with arbitrary headings,
Stefan Monnier <=
- [elpa] externals/gnorb 0f18c45 311/449: Allow persistent nnir search groups, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f62ec8 374/449: Fix inevitable screwup in previous commit, bump version, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 3b81d8c 377/449: Don't mark the 'artno key as precious, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5a88948 382/449: Fix gnorb-version command, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2aab7c3 433/449: [gnorb] Use substitute-command-keys, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb afafa8a 424/449: * gnorb/gnorb-registry.el: Fix compilation warnings, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 16f1ab6 183/449: Make gnorb-registry-make-entry more careful, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e07c4cf 194/449: Refactor splitting of message reference headers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a0b039c 199/449: Probably shouldn't use assoc as a symbol, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4cfd40c 207/449: Rework gnorb-org-handle-mail to use tracking, Stefan Monnier, 2020/11/27