From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#14176: 24.3.50; `bookmark-completing-read': prompt and return value for "" DEFAULT Date: Thu, 11 Apr 2013 14:32:36 -0700 Message-ID: References: <7707C9A29C4748B093E2167A99592511@us.oracle.com> <87txnda9qd.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1365716000 13425 80.91.229.3 (11 Apr 2013 21:33:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2013 21:33:20 +0000 (UTC) To: "'Thierry Volpiatto'" , <14176@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 11 23:33:21 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UQP7Q-0002zU-JV for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 23:33:20 +0200 Original-Received: from localhost ([::1]:60936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQP7Q-0007E9-5f for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 17:33:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQP7I-0007Dp-LF for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 17:33:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQP7H-0007CR-Fp for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 17:33:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQP7H-0007CN-DM for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 17:33:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UQPB0-0005Ic-34 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 17:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Apr 2013 21:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14176 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14176-submit@debbugs.gnu.org id=B14176.136571619820280 (code B ref 14176); Thu, 11 Apr 2013 21:37:02 +0000 Original-Received: (at 14176) by debbugs.gnu.org; 11 Apr 2013 21:36:38 +0000 Original-Received: from localhost ([127.0.0.1]:46311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQPAb-0005H2-Tp for submit@debbugs.gnu.org; Thu, 11 Apr 2013 17:36:38 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:27300) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQPAZ-0005Gf-9G for 14176@debbugs.gnu.org; Thu, 11 Apr 2013 17:36:36 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r3BLWgMb000716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Apr 2013 21:32:43 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3BLWflb011823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Apr 2013 21:32:42 GMT Original-Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3BLWfLf000653; Thu, 11 Apr 2013 21:32:41 GMT Original-Received: from dradamslap1 (/10.159.70.141) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Apr 2013 14:32:41 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87txnda9qd.fsf@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac42eeAoJ8SHGu5LSAetZ/BoQ3izSQAdVG+Q X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73349 Archived-At: > > 1. Do not insert DEFAULT, in parens, into the PROMPT if > > DEFAULT is "". > > > > 2. Doc string should mention the return value ("") for > > empty input ("") when DEFAULT is nil. > > Here a patch:... Wrt #1: No, that patch does not work: M-: (bookmark-completing-read "Bookmark" "") The prompt still shows empty parens: "Bookmark (): ". The prompt should be handled like this (or equivalent): (if (and default (not (equal "" default))) ; ^^^^^^^^^^^^^^^^^^^^^^^^ (concat prompt (format " (%s): " (if (consp default) (car default) default) default)) (concat prompt ": ")) (The handling of a cons DEFAULT is appropriate since Emacs 23. But that minor enhancement is really separate from this bug report. #1 is just about empty parens in the prompt.) Wrt #2: a. I misspoke a bit. The behavior was that nil (not "") was returned when DEFAULT is nil and the user enters empty input. IMO, the value returned should be "" (which Thierry's patch fixes, BTW). Given that correction, this (new) behavior should be pointed out in the doc string. That is #2 of the bug report. IOW, the function should always return a string, and that string should be empty ("") if DEFAULT is nil and the user input is empty. And we should point out this behavior explicitly in the doc string, for clarity.