branch: externals/gnorb
commit a4089f81e8e67946c501e4f87ab8e2afb66c55eb
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
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"