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

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

[elpa] externals/gnorb a4089f8 297/449: Fix completing-read in message d


From: Stefan Monnier
Subject: [elpa] externals/gnorb a4089f8 297/449: Fix completing-read in message disassociation
Date: Fri, 27 Nov 2020 23:15:59 -0500 (EST)

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

    Fix completing-read in message disassociation
    
    * nngnorb.el (gnorb-summary-disassociate-message): That's just not how
      it works.
---
 nngnorb.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/nngnorb.el b/nngnorb.el
index 47ab4ea..320d390 100644
--- a/nngnorb.el
+++ b/nngnorb.el
@@ -309,7 +309,7 @@ the message being included in this search."
      (gnus-summary-article-number)))
   (let* ((msg-id (gnus-fetch-original-field "message-id"))
         (org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
-        chosen)
+        chosen multiple-alist)
     (if org-ids
        (progn
          (if (= (length org-ids) 1)
@@ -317,14 +317,18 @@ the message being included in this search."
              (progn (gnus-registry-set-id-key msg-id 'gnorb-ids nil)
                     (setq chosen (car org-ids)))
            ;; Multiple associated TODOs, prompt to choose one.
+           (setq multiple-alist
+                 (mapcar
+                  (lambda (h)
+                    (cons (gnorb-pretty-outline h) h))
+                  org-ids))
            (setq chosen
                  (cdr
-                  (org-completing-read
-                   "Choose a TODO to disassociate from: "
-                   (mapcar
-                    (lambda (h)
-                      (cons (gnorb-pretty-outline h) h))
-                    org-ids))))
+                  (assoc
+                   (org-completing-read
+                    "Choose a TODO to disassociate from: "
+                    multiple-alist)
+                   multiple-alist)))
            (gnus-registry-set-id-key msg-id 'gnorb-ids
                                      (remove chosen org-ids)))
          (message "Message disassociated from %s"



reply via email to

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