From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner Newsgroups: gmane.emacs.devel Subject: Re: Unexpected behavior of format-number with format-prompt Date: Sat, 09 Nov 2024 19:55:31 -0800 Message-ID: References: <875xp0b00l.fsf@breatheoutbreathe.in> <86h68jqyut.fsf@gnu.org> <87jzdfp2zg.fsf@gmx.net> <86ses3p0c3.fsf@gnu.org> <87fro3ox37.fsf@gmx.net> <87v7ww6xi5.fsf@breatheoutbreathe.in> <87fro0t6sj.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 10 06:30:00 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tA0WL-0003h6-BQ for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Nov 2024 06:29:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA0VP-0003AN-1v; Sun, 10 Nov 2024 00:28:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9z3F-000216-BM for emacs-devel@gnu.org; Sat, 09 Nov 2024 22:55:49 -0500 Original-Received: from out-179.mta1.migadu.com ([2001:41d0:203:375::b3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9z3D-0001SD-96 for emacs-devel@gnu.org; Sat, 09 Nov 2024 22:55:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1731210943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pe8uNO14RnhYC+O4FKuCGpEu5zwszMLXO2R75wNQWZE=; b=ecvWN+QGKf2B2gk9Ixfx+12btRcI6skVmHbrzf7r5sy8xJpLLUBfXeNqEMJWhFWTU9n+4P Sf/q5/EgUHjZnO6SAwcW4UuD7hxHuQL9KeDSALH0dqYBRFNx8dBguk2FRW8n/WlBiAldOz FPoWNRNZY6VS0lriMrAtUYdEZxSU/ps= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <87fro0t6sj.fsf@gmx.net> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::b3; envelope-from=joseph@breatheoutbreathe.in; helo=out-179.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 10 Nov 2024 00:28:56 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325361 Archived-At: On November 9, 2024 1:51:24 PM PST, Stephen Berman wrote: >In all uses of format-prompt I checked in the Emacs sources, the same >value is passed to the DEFAULT argument of both format-prompt and its >caller (e=2Eg=2E read-string)=2E Do you have a realistic use case >(i=2Ee=2E discounting willfully misleading or mischievous programming) in >mind where this is not so? I couldn't find or come up with one, but >maybe I missed it or didn't think hard enough=2E > >> [ Also /s/string-match/string-match-p ] > >I just followed the current code in `read-number', which already uses >`string-match'=2E Perhaps that should be changed regardless of my patch? I think so=2E >> I think we're better off documenting the idiosyncrasy in the >> `read-number' docstring as Eli suggested=2E > >That's certainly the path of least risk, though I can't think of a >plausible use where my patch would result in duplication in the prompt >string=2E The patch works if you specify the prompt with format-prompt, but if you t= ry to roll your own prompt like (read-number (format "Type number (DEFAULT = %s): " default) default) then confusingly there's duplication=2E Maybe you want to display the default number in a different base in the pr= ompt=2E Maybe you want the prompt to be user-defined=2E My desire is for simplicity=2E However if the maintainers approve it, I'm happy to see it included and do= cumented=2E In any case, I appreciate your thinking :) Cheers, Joseph