emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnorb b596ee7 157/449: Check for success when following


From: Stefan Monnier
Subject: [elpa] externals/gnorb b596ee7 157/449: Check for success when following gnus links
Date: Fri, 27 Nov 2020 23:15:29 -0500 (EST)

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

    Check for success when following gnus links
    
    * lisp/gnorb-org.el (gnorb-org-setup-message): Previously,
      `gnorb-org-handle-mail' would try to follow a link, but regardless of
      whether the message was found or not, it would start a reply. That's
      pretty much never correct, so check for that and bail if the link is
      stale.
---
 lisp/gnorb-org.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index 8ca0c71..585140a 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -405,15 +405,18 @@ Org heading ids, associating the outgoing message with 
those
 headings."
   (require 'gnorb-gnus)
   (if (not messages)
-      ;; either compose new message...
+      ;; Either compose new message...
       (compose-mail (mapconcat 'identity mails ", "))
-    ;; ...or follow link and start reply
+    ;; ...or follow link and start reply.
     (condition-case err
-       (progn
-         (org-gnus-open (org-link-unescape (car messages)))
+       (let ((ret-val (org-gnus-open (org-link-unescape (car messages)))))
+         ;; We failed to open the link (probably), ret-val would be
+         ;; t otherwise
+         (when (stringp ret-val)
+           (error ret-val))
          (call-interactively
           'gnus-summary-wide-reply-with-original)
-         ;; add MAILS to message To header
+         ;; Add MAILS to message To header.
          (when mails
            (message-goto-to)
            (insert ", ")
@@ -421,10 +424,10 @@ headings."
       (error (when (window-configuration-p gnorb-org-window-conf)
               (set-window-configuration gnorb-org-window-conf))
             (signal (car err) (cdr err)))))
-  ;; return us after message is sent
+  ;; Return us after message is sent.
   (add-to-list 'message-exit-actions
               'gnorb-org-restore-after-send t)
-  ;; set headers from MAIL_* properties (from, cc, and bcc)
+  ;; Set headers from MAIL_* properties (from, cc, and bcc).
   (cl-flet ((sh (h)
                (when (cdr h)
                  (funcall (intern (format "message-goto-%s" (car h))))



reply via email to

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