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: Sat, 13 Apr 2013 10:16:01 +0200 Organization: Emacs Helm Message-ID: <87zjx2n8vy.fsf@gmail.com> References: <7707C9A29C4748B093E2167A99592511@us.oracle.com> <87txnda9qd.fsf@gmail.com> <87ehegjokl.fsf@gmail.com> <0C53172999584A498FB4190ADC8990CB@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365841029 19478 80.91.229.3 (13 Apr 2013 08:17:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Apr 2013 08:17:09 +0000 (UTC) Cc: 14176@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 13 10:17:12 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 1UQve3-0001zd-P3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2013 10:17:11 +0200 Original-Received: from localhost ([::1]:43453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQve3-0000LL-AG for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2013 04:17:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQvdy-0000Ha-QB for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2013 04:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQvdv-00039E-SG for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2013 04:17:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQvdv-000398-PI for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2013 04:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UQvhm-0006rv-6f for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2013 04:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2013 08:21: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.136584121426194 (code B ref 14176); Sat, 13 Apr 2013 08:21:02 +0000 Original-Received: (at 14176) by debbugs.gnu.org; 13 Apr 2013 08:20:14 +0000 Original-Received: from localhost ([127.0.0.1]:48338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQvgz-0006oN-IG for submit@debbugs.gnu.org; Sat, 13 Apr 2013 04:20:13 -0400 Original-Received: from mail-wg0-f44.google.com ([74.125.82.44]:41226) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQvgx-0006o9-1Z for 14176@debbugs.gnu.org; Sat, 13 Apr 2013 04:20:12 -0400 Original-Received: by mail-wg0-f44.google.com with SMTP id z11so3234813wgg.11 for <14176@debbugs.gnu.org>; Sat, 13 Apr 2013 01:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=Af0LtQBum68dv6uKXTWa/BV+6n6eIFlRT5sC0+6LhMs=; b=HzQSFlnFyQsMYQ6IkpSv3O43z+eR9geGm4+VvjfhbuR0P9ZQw3B07ddiMNZooXu4fO jhuSci3AB8xVc8CJNUy4tuaDv2srfsdizHQ7PY+lATHLz4k8BK5at/maNEhT6FTNNeg/ J/XJ92pyIJ3o72bIH/TWQuyu6UGqthOqLotSLGHpLxksAubcm1jp0ApMtcEQvsBGu7gX uPlxs7R28wv8VPkm0/MnmV60kybph7UUw0w62Tk+30yac6fPrhT7ExvrZlb1ZIuQI5Z6 SSa/xTEmneqdgdCci2bkViyFmEPWR6oq/hlaTGitF+r2B95EPVHq+GW3Bsm6njhUAHgn 3ebw== X-Received: by 10.180.74.67 with SMTP id r3mr2160308wiv.14.1365840971159; Sat, 13 Apr 2013 01:16:11 -0700 (PDT) Original-Received: from dell-14z (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPS id ek4sm1807958wib.11.2013.04.13.01.16.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Apr 2013 01:16:09 -0700 (PDT) In-Reply-To: <0C53172999584A498FB4190ADC8990CB@us.oracle.com> (Drew Adams's message of "Fri, 12 Apr 2013 07:14:09 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:73373 Archived-At: "Drew Adams" writes: > For the doc string: > > DEFAULT is a string to return if the user input is empty. > If DEFAULT is nil (absent) then return "" for empty input. Here with the docstring modified, if you want to modify the docstring (or something else), provide a patch to allow Stefan to apply the changes. Thanks. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index c1d8a4a..c98ad0c 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -427,8 +427,8 @@ just return it." "Prompting with PROMPT, read a bookmark name in completion. PROMPT will get a \": \" stuck on the end no matter what, so you probably don't want to include one yourself. -Optional second arg DEFAULT is a string to return if the user enters -the empty string." +Optional arg DEFAULT is a string to return if the user input is empty. +If DEFAULT is nil then return empty string for empty input." (bookmark-maybe-load-default-file) ; paranoia (if (listp last-nonmenu-event) (bookmark-menu-popup-paned-menu t prompt @@ -437,22 +437,17 @@ the empty string." 'string-lessp) (bookmark-all-names))) (let* ((completion-ignore-case bookmark-completion-ignore-case) - (default default) + (default (unless (string= "" 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) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997