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

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

[elpa] externals/gnorb f0ba4d7 250/449: Improvements to message disassoc


From: Stefan Monnier
Subject: [elpa] externals/gnorb f0ba4d7 250/449: Improvements to message disassociation
Date: Fri, 27 Nov 2020 23:15:49 -0500 (EST)

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

    Improvements to message disassociation
    
    * nngnorb.el (gnorb-summary-disassociate-message): Let us know if the
      message is already disassociated. Also, fix bug that totally prevented
      this from working, ahem.
---
 nngnorb.el | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/nngnorb.el b/nngnorb.el
index bdaf569..adc16f9 100644
--- a/nngnorb.el
+++ b/nngnorb.el
@@ -305,24 +305,26 @@ the message being included in this search."
   (let* ((msg-id (gnus-fetch-original-field "message-id"))
         (org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
         chosen)
-    (when org-ids
-      (if (= (length org-ids) 1)
-         ;; Only one associated Org TODO.
-         (progn (gnus-registry-set-id-key msg-id 'gnorb-ids)
-                (setq chosen (car org-ids)))
-       ;; Multiple associated TODOs, prompt to choose one.
-       (setq chosen
-             (cdr
-              (org-completing-read
-               "Choose a TODO to disassociate from: "
-               (mapcar
-                (lambda (h)
-                  (cons (gnorb-pretty-outline h) h))
-                org-ids))))
-       (gnus-registry-set-id-key msg-id 'gnorb-ids
-                                 (remove chosen org-ids)))
-      (message "Message disassociated from %s"
-              (gnorb-pretty-outline chosen)))))
+    (if org-ids
+       (progn
+         (if (= (length org-ids) 1)
+             ;; Only one associated Org TODO.
+             (progn (gnus-registry-set-id-key msg-id 'gnorb-ids nil)
+                    (setq chosen (car org-ids)))
+           ;; Multiple associated TODOs, prompt to choose one.
+           (setq chosen
+                 (cdr
+                  (org-completing-read
+                   "Choose a TODO to disassociate from: "
+                   (mapcar
+                    (lambda (h)
+                      (cons (gnorb-pretty-outline h) h))
+                    org-ids))))
+           (gnus-registry-set-id-key msg-id 'gnorb-ids
+                                     (remove chosen org-ids)))
+         (message "Message disassociated from %s"
+                  (gnorb-pretty-outline chosen)))
+      (message "Message already disassociated"))))
 
 (defvar nngnorb-status-string "")
 



reply via email to

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