branch: externals/org
commit f2be2fd07338dddfd7bc2c2d6e3755c135083434
Merge: 3e4588c732 2347eac669
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
Merge branch 'bugfix'
---
lisp/org.el | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/lisp/org.el b/lisp/org.el
index 8ef7c45e7f..3e11d76ecc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20874,11 +20874,25 @@ When nil, use `org-attach-method'."
(defvar org-attach-method)
(defun org--dnd-rmc (prompt choices)
+ "Display a menu or dialog and select with PROMPT among CHOICES.
+PROMPT is the prompt string. CHOICES is a list of choices. Each
+choice is a list of (key description value). VALUE from the selected
+choice is returned."
(if (null (and
;; Emacs <=28 does not have `use-dialog-box-p'.
(fboundp 'use-dialog-box-p)
(use-dialog-box-p)))
- (caddr (read-multiple-choice prompt choices))
+ (progn
+ (setq choices
+ (mapcar
+ (pcase-lambda (`(,key ,message ,val))
+ ;; `read-multiple-choice' expects VAL to be a long
+ ;; description of the choice - string or nil. Move VAL
+ ;; further, so that it is not seen by the extended
+ ;; help in `read-multiple-choice'.
+ (list key message nil val))
+ choices))
+ (nth 3 (read-multiple-choice prompt choices)))
(setq choices
(mapcar
(pcase-lambda (`(_key ,message ,val))