From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#14176: 24.3.50; `bookmark-completing-read': prompt and return value for "" DEFAULT Date: Thu, 11 Apr 2013 07:59:22 +0200 Organization: Emacs Helm Message-ID: <87txnda9qd.fsf@gmail.com> References: <7707C9A29C4748B093E2167A99592511@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365660029 20726 80.91.229.3 (11 Apr 2013 06:00:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Apr 2013 06:00:29 +0000 (UTC) To: 14176@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 11 08:00:30 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 1UQAYf-0006KL-Lv for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 08:00:29 +0200 Original-Received: from localhost ([::1]:45618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAYf-00049i-7J for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Apr 2013 02:00:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAYZ-000460-GK for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 02:00:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQAYY-00062Z-6k for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 02:00:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAYW-000628-G4 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 02:00:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UQAcA-0000DT-Qi for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 02:04:07 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <7707C9A29C4748B093E2167A99592511@us.oracle.com> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Apr 2013 06:04:06 +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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1365660211461 (code B ref -1); Thu, 11 Apr 2013 06:04:06 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Apr 2013 06:03:31 +0000 Original-Received: from localhost ([127.0.0.1]:44630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQAbX-00006p-Td for submit@debbugs.gnu.org; Thu, 11 Apr 2013 02:03:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44780) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQAbS-00005a-Bw for submit@debbugs.gnu.org; Thu, 11 Apr 2013 02:03:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQAXl-0005gZ-KE for submit@debbugs.gnu.org; Thu, 11 Apr 2013 01:59:34 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:53827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAXl-0005gV-Hz for submit@debbugs.gnu.org; Thu, 11 Apr 2013 01:59:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAXk-0002y3-IF for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 01:59:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQAXj-0005fw-JZ for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 01:59:32 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQAXj-0005fb-D4 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 01:59:31 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQAXg-0004ri-7b for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 07:59:28 +0200 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 07:59:28 +0200 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 07:59:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 81 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:pKRf+USLiihsG7i0mYWm2cL1kug= 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-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:73327 Archived-At: Hi Drew, "Drew Adams" writes: > 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. Isn't there a bad usage of `completing-read' here, IMO the DEFAULT arg of `completing-read' should be used instead of: ,---- | (if (string-equal "" str) default str) `---- Also why is 'default' let-bounded ? Here a patch: diff --git a/lisp/bookmark.el b/lisp/bookmark.el index c1d8a4a..8698821 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -437,22 +437,21 @@ the empty string." 'string-lessp) (bookmark-all-names))) (let* ((completion-ignore-case bookmark-completion-ignore-case) - (default default) (prompt (concat prompt (if default (format " (%s): " default) - ": "))) - (str - (completing-read prompt - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (category . bookmark)) - (complete-with-action - action bookmark-alist string pred))) - nil - 0 - nil - 'bookmark-history))) - (if (string-equal "" str) default str)))) + ": ")))) + (completing-read prompt + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (category . bookmark)) + (complete-with-action + action bookmark-alist string pred))) + nil + 0 + nil + 'bookmark-history + default)))) + (defmacro bookmark-maybe-historicize-string (string) > In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600) > of 2013-04-02 on ODIEONE > Bzr revision: 112212 cyd@gnu.org-20130402033331-sqegwhqh7u1o0ars > Windowing system distributor `Microsoft Corp.', version 5.1.2600 > Configured using: > `configure --with-gcc (4.7) --no-opt --enable-checking --cflags > -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib' > > > > > > -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997