From unknown Sun Jun 22 07:52:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30072: 27.0.50; completing-read-multiple chokes on list of default values Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2018 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 30072@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151562029612842 (code B ref -1); Wed, 10 Jan 2018 21:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jan 2018 21:38:16 +0000 Received: from localhost ([127.0.0.1]:51419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZO4d-0003L4-Og for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZO4c-0003Ks-Uo for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZO4W-0002Yx-HZ for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZO4W-0002Yk-DH for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZO4V-0000T9-5a for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZO4T-0002XL-OP for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:07 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:42634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZO4T-0002WN-7U for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:05 -0500 Received: by mail-wm0-x235.google.com with SMTP id b141so1659296wme.1 for ; Wed, 10 Jan 2018 13:38:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=uSUud8Rjb/GOSHRlvf9IKyj5OJIO13+u+HKy6FzZlRs=; b=iI6ejHjPv66Rz0owS/7+6JUenjZg+3tgHZhRsDVuwP6nOpSjJ8n4s5gVSL+XD3ynjt QUsr0M9JH6rOaaD2OyFMtTJZj53maxvBQEQwBF7dp098BAaltEWwJMOqUaVUY5/8rE+X gyOtXL0hT8H2kKoQrQGyxFLoHrJ76JniPv694iRztynz8GmxdtU0u260/YvdEITmYqnK b2nCt47j1Efi0I3K3Gxtr+Od7YOCfMNm8eEqcXtEzBkgaplKSenhFiPtm6RBF1tjD/VE F7BWzJc52f5Oh6vmQDcEe1ZQIMc7hDBJEd1LtosyC/YAGmKz3Aq0v5Fs0+L8aIfxzcr9 69Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=uSUud8Rjb/GOSHRlvf9IKyj5OJIO13+u+HKy6FzZlRs=; b=PsVcOS6v2M3xpqdWLicyK/nCxinXCaUnRLzJXW4D7FnwPxG0lRniH1Py3WVb+RlRdc I8aL5HfWV85VuUAkHKGrKIcyuMyXq7pbqtp9p4XUqPU0jQlksJnmE0w27sLtPD3PKvCX ifC0wCRSK8VFisVWDfP2ea+rkv2AwA+Z8YJQP8AeSFQytbgQB2ZYu1RukbLzBml2In9f Qm2rQlfrB0YiqgF0BYZ3lsw9/3ymTzNnIQe2D4dmmYAU3HFrJMipo9IJDs8XyStgLnoa kh8p1Q7Z+BUIpK1seICmVlO2l3Nq014B7yLJmK3jCtpe1dJVBq9UyUuNy7mxZzna/PXq 9F8A== X-Gm-Message-State: AKGB3mLcGth536L6TLwY/H3wBLxkMLNDUT/or7NAFAs+0PIRgzEnT0NN WLizTw/fq8lQUFS79+vaBkjlQevK X-Google-Smtp-Source: ACJfBovGTJmbXqzbpqDlP9VM3xpYdnIUVJ81rH31G6HGSt6GGnBCl6+IJMmBk74fjvO+EhrvAiA8wg== X-Received: by 10.80.134.232 with SMTP id 37mr27544495edu.135.1515620282797; Wed, 10 Jan 2018 13:38:02 -0800 (PST) Received: from localhost ([2a02:8084:4f41:8c80:9929:5bdb:4629:fab8]) by smtp.gmail.com with ESMTPSA id l20sm10581626edc.73.2018.01.10.13.38.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2018 13:38:01 -0800 (PST) From: "Basil L. Contovounesios" Date: Wed, 10 Jan 2018 21:37:51 +0000 Message-ID: <878td5pf80.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Support-list-of-default-values-in-completing-read-mu.patch >From dac3aeb9a53efa53851b588d599f990cba592e49 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" 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. --- 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.15.1 --=-=-= Content-Type: text/plain Steps to reproduce: 1) emacs -Q 2) Evaluate the following form: (let ((l '("a" "b"))) (completing-read-multiple "" l nil nil nil nil l)) 3) C-m I expect this to result in the string "a", as is the case when completing-read-multiple is replaced with completing-read in step 2, given the following excerpt from the docstring of c-r-m: The arguments are the same as those of `completing-read'. Instead, the following error is signalled: Debugger entered--Lisp error: (wrong-type-argument stringp ("a" "b")) string-match("[ \011]*,[ \011]*" ("a" "b") 0) split-string(("a" "b") "[ \011]*,[ \011]*" t) completing-read-multiple("" ("a" "b") nil nil nil nil ("a" "b")) I attach a fix which follows the implementation of completing-read-default. Thanks, -- Basil In GNU Emacs 27.0.50 (build 14, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-01-10 built on thunk Repository revision: b877e9aa0225ad186b544f127702e16c61b08444 Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 System Description: Debian GNU/Linux testing (buster) --=-=-=-- From unknown Sun Jun 22 07:52:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30072: 27.0.50; completing-read-multiple chokes on list of default values Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Apr 2018 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 30072@debbugs.gnu.org Received: via spool by 30072-submit@debbugs.gnu.org id=B30072.152344657831782 (code B ref 30072); Wed, 11 Apr 2018 11:37:02 +0000 Received: (at 30072) by debbugs.gnu.org; 11 Apr 2018 11:36:18 +0000 Received: from localhost ([127.0.0.1]:45760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6E30-0008GY-GB for submit@debbugs.gnu.org; Wed, 11 Apr 2018 07:36:18 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:54654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6E2z-0008GM-GV for 30072@debbugs.gnu.org; Wed, 11 Apr 2018 07:36:17 -0400 Received: by mail-wm0-f44.google.com with SMTP id r191so3443680wmg.4 for <30072@debbugs.gnu.org>; Wed, 11 Apr 2018 04:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=WreY+oLVbLQdOBvt1Vhe0UMTBDN+/2VZQ5roER6957o=; b=CbQyzPjpmnTT3tdcfdLCjluDZDTKrflVruqjf+lebRf5fEFvM/6zH2o2qEASblckD8 w4bGlI9vOFgzxQkipHyIgyWa4BDeIOVzmImIg8OoY99ORaarcqtWWEBSGvA6caE7otLT 3+Yj92I+203SwPSsFBrCfrFymk21SKNOxuP/roIJQjGf7Riq4kAE8u3adh69lSHWNjEE nyl/zUCPLHjLxXt5rYzNQAi7Y40mFn7K00EBZH4uaIyQWkCzsvz9fza0UqiQKUeLNL9X bCfUDovcunC9jAdhj8QL1ffg4r/8Z8Kp5Gv7rWYwdmH5u4vYg8TG4WraVu4p81hrhepf 1jkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WreY+oLVbLQdOBvt1Vhe0UMTBDN+/2VZQ5roER6957o=; b=DrhhBBUHud5pni3zEZxl/SYyiymZAVoSPi8KNAF8ZHFTWvaviXJCQmz8Ul0Y+JRIac MNeQeH8fvaiZGTngZoLqmWo/aaxPsR7rBp7fnOh7xAUc3XdxHlV8PkeX1LfJ4RMX4uNQ pWH++6+k9exVssf4Oej4ir2PWVpe/H4mRL+Z6b9fVeHljLKn6Eo0CZXdRtkqgTTxEHDB xSWUgKQ5SaodXXjV+GaOORG9AgKhrq8ML9iBSCj6Wr7neFwXzvKANCn8AKuwzCPqpmgM tKIxkc/mxvQ2cqyJAdWfYjOTEL8nNpSF7oP6yxySqzosWskBnB441wBELFBR0/qzqhVC U3aQ== X-Gm-Message-State: ALQs6tAgw2dGQ+9UnboBZ8Bp9xck2Sa+FiO2+yLTlILn8CEidrpZUChC sT17cZwDBw9zZIh7Pqd5gbEL+Gsoz8Y= X-Google-Smtp-Source: AIpwx49VrgBG3y1uOfwHl/eRpPnpCqtgj+YJHjNodlvfVac9FagkEEzVaJJ+fVGNa3gTuHd3xU5+JA== X-Received: by 10.28.128.145 with SMTP id b139mr2194688wmd.62.1523446571652; Wed, 11 Apr 2018 04:36:11 -0700 (PDT) Received: from localhost ([178.62.40.52]) by smtp.gmail.com with ESMTPSA id k14sm1371234wrc.62.2018.04.11.04.36.09 for <30072@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 04:36:10 -0700 (PDT) From: "Basil L. Contovounesios" References: <878td5pf80.fsf@gmail.com> Date: Wed, 11 Apr 2018 12:36:07 +0100 In-Reply-To: <878td5pf80.fsf@gmail.com> (Basil L. Contovounesios's message of "Wed, 10 Jan 2018 21:37:51 +0000") Message-ID: <878t9uf00o.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Support-list-of-default-values-in-completing-read-mu.patch >From 7a33c02e2815e0a9625ffc48f3850894522169b6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" 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 --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > I attach a fix which follows the implementation of > completing-read-default. Updated to include bug ticket number. Thanks, -- Basil --=-=-=-- From unknown Sun Jun 22 07:52:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Basil L. Contovounesios" Subject: bug#30072: closed (Re: bug#30072: 27.0.50; completing-read-multiple chokes on list of default values) Message-ID: References: <87fu40noua.fsf@mail.linkov.net> <878td5pf80.fsf@gmail.com> X-Gnu-PR-Message: they-closed 30072 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 30072@debbugs.gnu.org Date: Thu, 12 Apr 2018 20:39:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1523565542-4223-1" This is a multi-part message in MIME format... ------------=_1523565542-4223-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30072: 27.0.50; completing-read-multiple chokes on list of default values which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30072@debbugs.gnu.org. --=20 30072: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30072 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1523565542-4223-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30072-done) by debbugs.gnu.org; 12 Apr 2018 20:38:34 +0000 Received: from localhost ([127.0.0.1]:48616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6izK-00015U-Dq for submit@debbugs.gnu.org; Thu, 12 Apr 2018 16:38:34 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:40454 helo=homiemail-a75.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6izI-00015M-GL for 30072-done@debbugs.gnu.org; Thu, 12 Apr 2018 16:38:32 -0400 Received: from homiemail-a75.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTP id 83C905EC081; Thu, 12 Apr 2018 13:38:31 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTPSA id A56405EC07C; Thu, 12 Apr 2018 13:38:30 -0700 (PDT) From: Juri Linkov To: "Basil L. Contovounesios" Subject: Re: bug#30072: 27.0.50; completing-read-multiple chokes on list of default values Organization: LINKOV.NET References: <878td5pf80.fsf@gmail.com> <878t9uf00o.fsf@tcd.ie> Date: Thu, 12 Apr 2018 23:37:17 +0300 In-Reply-To: <878t9uf00o.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 11 Apr 2018 12:36:07 +0100") Message-ID: <87fu40noua.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30072-done Cc: 30072-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I attach a fix which follows the implementation of >> completing-read-default. > > Updated to include bug ticket number. Thanks, pushed to master as 3d6fa0b. ------------=_1523565542-4223-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Jan 2018 21:38:16 +0000 Received: from localhost ([127.0.0.1]:51419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZO4d-0003L4-Og for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZO4c-0003Ks-Uo for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZO4W-0002Yx-HZ for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZO4W-0002Yk-DH for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:38:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZO4V-0000T9-5a for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZO4T-0002XL-OP for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:07 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:42634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZO4T-0002WN-7U for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:38:05 -0500 Received: by mail-wm0-x235.google.com with SMTP id b141so1659296wme.1 for ; Wed, 10 Jan 2018 13:38:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=uSUud8Rjb/GOSHRlvf9IKyj5OJIO13+u+HKy6FzZlRs=; b=iI6ejHjPv66Rz0owS/7+6JUenjZg+3tgHZhRsDVuwP6nOpSjJ8n4s5gVSL+XD3ynjt QUsr0M9JH6rOaaD2OyFMtTJZj53maxvBQEQwBF7dp098BAaltEWwJMOqUaVUY5/8rE+X gyOtXL0hT8H2kKoQrQGyxFLoHrJ76JniPv694iRztynz8GmxdtU0u260/YvdEITmYqnK b2nCt47j1Efi0I3K3Gxtr+Od7YOCfMNm8eEqcXtEzBkgaplKSenhFiPtm6RBF1tjD/VE F7BWzJc52f5Oh6vmQDcEe1ZQIMc7hDBJEd1LtosyC/YAGmKz3Aq0v5Fs0+L8aIfxzcr9 69Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=uSUud8Rjb/GOSHRlvf9IKyj5OJIO13+u+HKy6FzZlRs=; b=PsVcOS6v2M3xpqdWLicyK/nCxinXCaUnRLzJXW4D7FnwPxG0lRniH1Py3WVb+RlRdc I8aL5HfWV85VuUAkHKGrKIcyuMyXq7pbqtp9p4XUqPU0jQlksJnmE0w27sLtPD3PKvCX ifC0wCRSK8VFisVWDfP2ea+rkv2AwA+Z8YJQP8AeSFQytbgQB2ZYu1RukbLzBml2In9f Qm2rQlfrB0YiqgF0BYZ3lsw9/3ymTzNnIQe2D4dmmYAU3HFrJMipo9IJDs8XyStgLnoa kh8p1Q7Z+BUIpK1seICmVlO2l3Nq014B7yLJmK3jCtpe1dJVBq9UyUuNy7mxZzna/PXq 9F8A== X-Gm-Message-State: AKGB3mLcGth536L6TLwY/H3wBLxkMLNDUT/or7NAFAs+0PIRgzEnT0NN WLizTw/fq8lQUFS79+vaBkjlQevK X-Google-Smtp-Source: ACJfBovGTJmbXqzbpqDlP9VM3xpYdnIUVJ81rH31G6HGSt6GGnBCl6+IJMmBk74fjvO+EhrvAiA8wg== X-Received: by 10.80.134.232 with SMTP id 37mr27544495edu.135.1515620282797; Wed, 10 Jan 2018 13:38:02 -0800 (PST) Received: from localhost ([2a02:8084:4f41:8c80:9929:5bdb:4629:fab8]) by smtp.gmail.com with ESMTPSA id l20sm10581626edc.73.2018.01.10.13.38.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2018 13:38:01 -0800 (PST) From: "Basil L. Contovounesios" To: bug-gnu-emacs@gnu.org Subject: 27.0.50; completing-read-multiple chokes on list of default values Date: Wed, 10 Jan 2018 21:37:51 +0000 Message-ID: <878td5pf80.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Support-list-of-default-values-in-completing-read-mu.patch >From dac3aeb9a53efa53851b588d599f990cba592e49 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" 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. --- 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.15.1 --=-=-= Content-Type: text/plain Steps to reproduce: 1) emacs -Q 2) Evaluate the following form: (let ((l '("a" "b"))) (completing-read-multiple "" l nil nil nil nil l)) 3) C-m I expect this to result in the string "a", as is the case when completing-read-multiple is replaced with completing-read in step 2, given the following excerpt from the docstring of c-r-m: The arguments are the same as those of `completing-read'. Instead, the following error is signalled: Debugger entered--Lisp error: (wrong-type-argument stringp ("a" "b")) string-match("[ \011]*,[ \011]*" ("a" "b") 0) split-string(("a" "b") "[ \011]*,[ \011]*" t) completing-read-multiple("" ("a" "b") nil nil nil nil ("a" "b")) I attach a fix which follows the implementation of completing-read-default. Thanks, -- Basil In GNU Emacs 27.0.50 (build 14, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-01-10 built on thunk Repository revision: b877e9aa0225ad186b544f127702e16c61b08444 Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 System Description: Debian GNU/Linux testing (buster) --=-=-=-- ------------=_1523565542-4223-1--