[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb 856da2b 077/449: Improve `gnorb-gnus-outgoing-mak

From: Stefan Monnier
Subject: [elpa] externals/gnorb 856da2b 077/449: Improve `gnorb-gnus-outgoing-make-todo'
Date: Fri, 27 Nov 2020 23:15:12 -0500 (EST)

branch: externals/gnorb
commit 856da2bc869f5c0e17018fa88d44d2a8a8c49b48
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Improve `gnorb-gnus-outgoing-make-todo'
    lisp/gnorb-gnus.el: Now it does something intelligent when used on a
                    message that already belongs to a TODO email
                    conversation, as a reply.
 lisp/gnorb-gnus.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index ae5b574..30aa6f6 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -264,8 +264,8 @@ information about the outgoing message into
            (require 'gnorb-org)
            (setq gnorb-message-org-ids org-ids)
            ;; `gnorb-org-setup-message' may have put this here, but
-           ;; if we're working from a draft or whatever, it might not
-           ;; be there yet
+           ;; if we're working from a draft, or triggering this from
+           ;; a reply, it might not be there yet
            (add-to-list 'message-exit-actions
        (setq gnorb-message-org-ids nil)))))
@@ -299,18 +299,17 @@ work."
   (interactive "P")
   (if (not (eq major-mode 'message-mode))
-    (when (mail-fetch-field gnorb-mail-header)
-      ;; If we're already composing a response to a message that is
-      ;; "trackable" (ie, the In-Reply-To or References headers point
-      ;; to message-ids that are attached to active TODOs), sending
-      ;; the message should run `gnorb-gnus-message-trigger-todo'.
-      ;; also, people should be able to add extra TODO ids to the
-      ;; headers, to trigger multiple TODOs, if they're really nuts.
-      (user-error "This message is already being composed in response to a 
-    (add-to-list 'message-exit-actions
-                'gnorb-gnus-outgoing-make-todo-1 t)
-    (message "A TODO will be made from this message after it's sent")))
+    (let ((ids (mail-fetch-field gnorb-mail-header nil nil t)))
+      (add-to-list
+       'message-exit-actions
+       (if ids
+          'gnorb-org-restore-after-send
+        'gnorb-gnus-outgoing-make-todo-1)
+       t)
+      (message
+       (if ids
+          "Message will trigger TODO state-changes after sending"
+        "A TODO will be made from this message after it's sent")))))
 (defun gnorb-gnus-outgoing-make-todo-1 ()
   (unless gnorb-gnus-new-todo-capture-key

reply via email to

[Prev in Thread] Current Thread [Next in Thread]