From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Unexpected behavior of format-number with format-prompt Date: Thu, 07 Nov 2024 09:36:42 +0200 Message-ID: <86h68jqyut.fsf@gnu.org> References: <875xp0b00l.fsf@breatheoutbreathe.in> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10855"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Joseph Turner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 07 08:37:37 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 1t8x5E-0002ac-94 for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Nov 2024 08:37:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8x4c-0004i8-IB; Thu, 07 Nov 2024 02:36:58 -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 1t8x4R-0004cn-4m for emacs-devel@gnu.org; Thu, 07 Nov 2024 02:36:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8x4Q-00051A-Fm; Thu, 07 Nov 2024 02:36:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KJmZTWwOZg6gHaxrVgRyrC8mrQj1AJTOKzCe6szK+As=; b=aWM0q8E9M/oO Lo7Ua50bLR56XfLwBuCx/87RpevGC1Nr7shm7c9oZU2LMWZygb1fq1MZwOIYM/UiMoJ9bq2GOm/3w j/KwhGKzgRknmxUGx1ZoAkuyzSH1+ypUZORef4PaQNH2UNqZ40WZ4GgxLqKcfO27GYdCVnWINdDAZ XGYZwp25++ehUiVAJHK++BJyS2xdoLZtFSO1RCyWtcWcyEhdLAOCksSw9vE/DqnAYfFxG4YJeUEuk fok5kNJzeTHPO/u3bBQQL/cp9BN+AcbseUZAkiljJhmTHrew3jjJahciWeBB0jaSKIf4lu9I8aZyr kEjGIKm2RoB8g5QtECV3gw==; In-Reply-To: <875xp0b00l.fsf@breatheoutbreathe.in> (message from Joseph Turner on Wed, 06 Nov 2024 12:06:02 -0800) 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:325207 Archived-At: > From: Joseph Turner > Date: Wed, 06 Nov 2024 12:06:02 -0800 > > When used with `read-string' (and other read-* functions), > `format-prompt' DTRT: > > (let ((default "foo")) > (read-string (format-prompt "Read" default) default)) > > The prompt looks like: "Read (default foo): " > > However, `read-number' adds its own default argument: > > (let ((default 1)) > (read-number (format-prompt "Read" default) default)) > > Prompt looks like: "Read (default 1) (default 1): " > > This patch makes the behavior of `read-number' consistent with other > read-* functions: Thanks. First, this should have been sent to our issue tracker, via report-emacs-bug or submit-emacs-patch. More to the point: we cannot possibly change the behavior of read-number in such a backward-incompatible way. Especially since this behavior is old, and explicitly called out in the doc string. It is perhaps unfortunate that read-number behaves differently in this manner, but I'm afraid we will have to live with this.