From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Unexpected behavior of format-number with format-prompt Date: Sun, 10 Nov 2024 11:37:30 +0100 Message-ID: <87bjynv0gl.fsf@gmx.net> 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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6983"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Joseph Turner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 10 11:38:27 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 1tA5Kt-0001gF-Ai for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Nov 2024 11:38:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA5K7-0007wT-Gd; Sun, 10 Nov 2024 05:37:40 -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 1tA5K6-0007wJ-7N for emacs-devel@gnu.org; Sun, 10 Nov 2024 05:37:38 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tA5K4-0007ep-Ez; Sun, 10 Nov 2024 05:37:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1731235051; x=1731839851; i=stephen.berman@gmx.net; bh=xLDMaTe4oRMt0cELGJ1cK7SVbAz3mNsM4H6megPxKEk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=jIaLttN/m6lTLilUr+yRgr8tgLy88PHEqTCuGcXQJeWKOYYzUQb8a6o9SazePyNc S0Lical3sN1x3nctwIcBQ65GtTrEZvLl8+xmDFDRtpBqrpoH3BWpwTy7X2wneqa1u qw9tA4RLucQS0KXYfJuZh/NoaJTtJ5HiB506XuqYRVJ+lNLg81CyvK9Oo8GMVXNTZ Pu3wEjsysc4oFObqI2wBuMo9MfoI6fcpxb+jhsKf2klGdIYJbmbHD5hhy2bB3pMtp jNLBcocjakAbMuQ3mT+eGO7rRQjYSYZ9uPC9Zt5NokTj4RLnFATeu42jBwGqOJTc6 jrKiDmTtUb5VzlMkzw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.94.242]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N7iCW-1toDTV1psQ-013SqQ; Sun, 10 Nov 2024 11:37:31 +0100 In-Reply-To: (Joseph Turner's message of "Sat, 09 Nov 2024 19:55:31 -0800") X-Provags-ID: V03:K1:W7QaOpUxCZZXylqPs7Tnp+xWVlCI1o8ERX7scIm5gp6+KDSr9Go NpQaJAXYeUwuH3rDSq7u1OqwDsW6Iqtlc70K8wlkeBEsklm0I1mScjbZIQeefgpNqrnB2qU yZ/QsuWe9I6rwL2Gus7gOt3lpEHbwmb+y4If3CQ3WS0DSd4IWgjZNVTabWWf2Cbs6M9L8gQ cLtdszaqViBzCM46A7LxA== UI-OutboundReport: notjunk:1;M01:P0:fDEMWyiEsqo=;ZVRro/tdRMgHI7JvOwUO+6FMP/K QPeXB58Ba8gOvm/viLt0SR/eXIijD+8Wy2/vTxfSinhQoYpSqI0wyv4GJ21+4ONxGl4322wY/ SUy0M1b/s+f/cPmY0iAqcpi9LZlPgqAx+/pzqh8iiJw6AOCm4+/tyg6ys+5t1HPKVh5l/nZru A8XrS7tnuT5994KQQrMqa0HxkOe0+fRMXhO/qax6qmy+2bQDkGb3/zJ2uKXbvnhokpfQB0uzp 6YeMXI7JTdww4O2og9OoXcdo04XnEExWkFhQgumKu6ewPsg65ezyPWThmNYGob3rZpoGw+A8M CHOQfaltQsoV4U/ZMiksmGB5m4hVBjub+b3KnoVa3IOIdfAn/LU6jtZGH/dla6Lg7oufiPePi PX6am9lgxptLQVr6shAnmEIHyVFPfsaTZfFyF+1uvMijXmPUkpQQpk+1j3Q3YXuEdsnbxxba9 JWd7F4wwsEHK0+zW8qbOI5hzlDLOQ87vTOFycv9Z7Ox5VVeyFeL0Fbu4YrqJufrn9nbUlRU4D EJBH31V2vk2d3GdQUCsXuzOrntUKarOn8gJLIbEkbAyxZ0rjpcjaHEuh5PcRDOObK5f4Bjzn3 lCkZcbeaMO4AzSf/8SoviRPsQhJxXK6nlQRI0UWJmrt/7KZtjPwwsYNOvRUTXRtYapzTZpkiO kMYs2qf4CZGWaDmhzBOLx1rpImy28XL0c6+gwZNl9Po+QoWnPW5G9m/4a8T3HltaOW31zuilm zIrrKttDd4+Y2PoXr4saK8hlQDS14wx69Cn7jelfgil+RDQN+DERUIkF8E1u8lqMQEzhGOyq Received-SPF: pass client-ip=212.227.15.15; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:325369 Archived-At: On Sat, 09 Nov 2024 19:55:31 -0800 Joseph Turner wrote: > 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.g. read-string). Do you have a realistic use case >>(i.e. 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. >> >>> [ Also /s/string-match/string-match-p ] >> >>I just followed the current code in `read-number', which already uses >>`string-match'. Perhaps that should be changed regardless of my patch? > > I think so. Be my guest :-) >>> I think we're better off documenting the idiosyncrasy in the >>> `read-number' docstring as Eli suggested. >> >>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. > > The patch works if you specify the prompt with format-prompt, but if you try > to roll your own prompt like (read-number (format "Type number (DEFAULT %s): " > default) default) then confusingly there's duplication. > > Maybe you want to display the default number in a different base in the prompt. > > Maybe you want the prompt to be user-defined. > > My desire is for simplicity. I thought the motivation of your OP was a more uniform implementation of the *-read-* functions' prompt using format-patch; that's also a kind of simplicity, no? > However if the maintainers approve it, I'm happy to see it included and documented. I think that ship won't sail :-) > In any case, I appreciate your thinking :) Thanks. > Cheers, > > Joseph Steve Berman