Subject: bug#30072: 27.0.50; completing-read-multiple chokes on list of default values

From: "Basil L. Contovounesios" <[email-masked]>
Date: Wed, 11 Apr 2018 12:36:07 +0100

>From 7a33c02e2815e0a9625ffc48f3850894522169b6 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Wed, 10 Jan 2018 20:21:25 +0000
Subject: [PATCH] Support list of default values in completing-read-multiple

* lisp/emacs-lisp/crm.el (completing-read-multiple):
Consider head of DEF argument when specified as a list,
as per completing-read-default. (bug#30072)
---
 lisp/emacs-lisp/crm.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 5aa856f467..1a67494d3c 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -263,7 +263,8 @@ completing-read-multiple
 	       (input (read-from-minibuffer
 		       prompt initial-input map
 		       nil hist def inherit-input-method)))
-	  (and def (string-equal input "") (setq input def))
+          (when (and def (string-equal input ""))
+            (setq input (if (consp def) (car def) def)))
           ;; Remove empty strings in the list of read strings.
 	  (split-string input crm-separator t)))
     (remove-hook 'choose-completion-string-functions
-- 
2.16.3

"Basil L. Contovounesios" <[email-masked]> writes:

> I attach a fix which follows the implementation of
> completing-read-default.

Updated to include bug ticket number.

Thanks,

-- 
Basil