GNU bug report logs - #77167
31.0.50; Add method to update the max-value for progress-reporter

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: lorniu <lorniu@HIDDEN>; Keywords: confirmed; dated Sat, 22 Mar 2025 07:59:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 77167 <at> debbugs.gnu.org:


Received: (at 77167) by debbugs.gnu.org; 22 Mar 2025 11:53:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 07:53:05 2025
Received: from localhost ([127.0.0.1]:41283 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvxPV-0006IZ-05
	for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 07:53:05 -0400
Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:45139)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tvxPN-0006HQ-Rt
 for 77167 <at> debbugs.gnu.org; Sat, 22 Mar 2025 07:52:58 -0400
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5e686d39ba2so5720025a12.2
 for <77167 <at> debbugs.gnu.org>; Sat, 22 Mar 2025 04:52:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742644371; x=1743249171; darn=debbugs.gnu.org;
 h=to:subject:message-id:date:mime-version:references:in-reply-to:from
 :from:to:cc:subject:date:message-id:reply-to;
 bh=i8fu30+4rqC1s134eD9b0UzqdzaWgXvs0UHOGH8fuJw=;
 b=OKp+9miV6WlijjSD5yqJaY+7ncaE6k8opvZ4Uu4z1g1ULK1D3UO8Qn1z6wcvN0VAzX
 zc4UnpN1ryT7ov9JoRM9gstDmW+4mA+UF0BOrUzicaqDkJl1fGM6ofAyAW9lWTRSCWlJ
 I3gUxWgw8W3F5EI6/eIgJTa6DkMTg1ePrNONHtmHvVtD92LdrkX3f/hXoU9JvSpZI5Z2
 ZvURTD4qx0w2OLGEsc3VkktHrJFavsQQkfalnYNUNRXfiMsG0aaqAv8/8/OSAr1fO5yq
 +5YWgvmnLdH4YOwOZFMSdeD//3oanFXlc7UEvLirMs9UVTU14BZN3xWX59aTzCdW5Kw8
 QZiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742644371; x=1743249171;
 h=to:subject:message-id:date:mime-version:references:in-reply-to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=i8fu30+4rqC1s134eD9b0UzqdzaWgXvs0UHOGH8fuJw=;
 b=sKadCWBs8FNKuaAqx3f8S2VKhnlg6XKsVOncXrN7xclksBqLW5x6Y+YS/OeoLfo80J
 6dCjn3cuBShDxbqWj0GWiEOmWOgOJaJ+fSi3+E4HTH5sIAls3ESpaNGBNZfOB0OAlvMy
 0LLf9cqCPr/aBp7GWghjcpH5OxPs0GV75XnfJguw/oB3oLCSDcAw2OpMrHE+wVroPaDO
 z0FMYMv5nMpzik88lU/xAP/KVSCaXyxtPP0AeRMgDohmmueQOImitOISEKvXrA8+dXxN
 M0psBd9sCVaU86gVnxMXNLNnvlp84LIHh7LH3E8Wc2tHUy++ktPAk/W0SopOrV9Og6+B
 3pKg==
X-Forwarded-Encrypted: i=1;
 AJvYcCUUcgOuZSVbQtAexEg6Uw16dQt/3FMMrUfMknZO5abvEvaopllOgn7jekOBtVpg3ExYoeRuog==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzJQut1TWsfjhh/zp7jY2H9iE23/Vl4UJbIQyEWEuNPVQxxDAaz
 o0cWQ2DmnTYsG2Oh2iMVddbwERT4SnDYeqYEBK2QbOsdqebqNfm0lVQNBcl4uEi0ljY0Ugqx5ga
 XhPPe1PqKzKUoC2LLMDxWnSGBq4g=
X-Gm-Gg: ASbGncux6KnLJ3LgItPWB/oqleU2AAQ17kqd5ctZSEOaChAcCMdKorFndYat8id8QoT
 WL4bYgBfHyngXzqKLpac1qeewnEbPn25w9QiwvjIcAxQ5LuxkvI6sdmFV3AEb+L5D36R8BnugkI
 o0KAuRLdAjLUHSivaD7gFp4z/d440=
X-Google-Smtp-Source: AGHT+IHUEmPm4ADAaKvNWH+vPSO4YWTZe6qXY2ovCCjgrXJY91nJ+ni0wbopAVfUAA0Ej1c2Uf3WhVVSF5pc/4vNNo0=
X-Received: by 2002:a05:6402:35c4:b0:5e7:8efa:ba13 with SMTP id
 4fb4d7f45d1cf-5ebcd40a6b3mr6394248a12.7.1742644371318; Sat, 22 Mar 2025
 04:52:51 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 22 Mar 2025 11:52:51 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <875xk17p8v.fsf@HIDDEN>
References: <875xk17p8v.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sat, 22 Mar 2025 11:52:50 +0000
X-Gm-Features: AQ5f1JqhetC0qlVH9jNMFgI5yioHcJ8qXY35NVQ03Z57ScZP65HE0P3Sa6A7xlU
Message-ID: <CADwFkm=TzS-NPVN2N=n5FydOei7G-Orpm9SU7GPXR0pYHwZUHw@HIDDEN>
Subject: Re: bug#77167: 31.0.50;
 Add method to update the max-value for progress-reporter
To: lorniu <lorniu@HIDDEN>, 77167 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77167
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

severity 77167 wishlist
tags 77167 + confirmed
thanks

lorniu <lorniu@HIDDEN> writes:

> Progress report is good for showing the progress. But the max-value is
> determined when creating the reporter object. However, in some cases,
> max-value is not sure at the very beginning.
>
> For example, sometimes, when downloading over the network, the max-value
> is not determined until the first data is returned. In this case, initialize
> max-value of the progress object after it created maybe a choice.
>
> Is it possible to add such function to do this?
>
>   (setq reporter (make-progress-reporter "Downloading..."))
>   (setf (progress-reporter-max-value reporter) 3300) ; something like this
>   (dotimes (i 10) (progress-reporter-update reporter (* 33 i)))
>
> Many thanks!

Makes sense to me.  Patches welcome.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77167; Package emacs. Full text available.
Added tag(s) confirmed. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Mar 2025 07:58:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 03:58:14 2025
Received: from localhost ([127.0.0.1]:40668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvtkD-0003FT-HQ
	for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 03:58:13 -0400
Received: from lists.gnu.org ([2001:470:142::17]:50448)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lorniu@HIDDEN>) id 1tvowZ-0006EY-1f
 for submit <at> debbugs.gnu.org; Fri, 21 Mar 2025 22:50:39 -0400
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 <lorniu@HIDDEN>) id 1tvowS-0002SP-2s
 for bug-gnu-emacs@HIDDEN; Fri, 21 Mar 2025 22:50:32 -0400
Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <lorniu@HIDDEN>) id 1tvowP-0007g2-RL
 for bug-gnu-emacs@HIDDEN; Fri, 21 Mar 2025 22:50:31 -0400
Received: by mail-pl1-x636.google.com with SMTP id
 d9443c01a7336-2240b4de12bso24871775ad.2
 for <bug-gnu-emacs@HIDDEN>; Fri, 21 Mar 2025 19:50:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742611827; x=1743216627; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=YoGyrOdGWUDSk5p3DwHA1WcGhyBZq3EnBpqOCbzbbhw=;
 b=Js7i00FojmsOasLRiABgI6lW2NfntXRLy5ErHaxPHoy0IXho7tAVceY1aB9npnbLtb
 gZmspG2LJhGd5LGHiv4ZTjg870VnP5x1W4FAPNXt0Juq1Stgkci5cDHsJoeeE9xf3VWf
 wepJuy6TPxzX0jX54vxfy3qzxzasOd/+JL1gi7MqTOxXBrvDyHgrC5S9RenFeVFXheiP
 i7+nOXzgGbp8pS20AnUdweWBnXeEHLdVKVr6ikmLb3aIgsMD3RzDhk05NnjOy/Q0c2t/
 EzsH7W5tgbhomD228wJU/+9xn8upFMlLZ4shI27MkNyWHdTISKNJW622tMr84qRchPIC
 Mb4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742611827; x=1743216627;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=YoGyrOdGWUDSk5p3DwHA1WcGhyBZq3EnBpqOCbzbbhw=;
 b=h+DNg3smtYOFv4heR8VjXjbrWxlLNJp1n7u8Bp2rtGRguDt+hPbiWRHINaE/TihYci
 uofSUaVNLFPCTqHGzOF4zEojzO58mWox3POddF403lNI0BzbF0u0c0u5HBNY1/q9nWTy
 jrqU4hpSESepzX2Lux6VbN+d480XehIvh77OwaMTVmUGxY3h6cWuzDJjgI3DnAWXdMZm
 Ij/YAYtcg3/UViYMSlj/mJPDmBqhKV626wpUfWRDNdHtAvDt8CL1gu1taTZmBl+yBu2Y
 AKKMTxwpc9i7fi+ywSptIL7w8aMyfRtt31JzYxDXvGa+boE+rV3OwGgwveawrEY6XVWa
 twUg==
X-Gm-Message-State: AOJu0YwBShfPYRlDuDGnPwXfv8hAXC0+aITb3gZR5E0iGEoWtCwb0QPZ
 YGH2sLpbZcZa5kFfg539jIm9Ou4V5sxpubcbr2hDEervaJFkaE7kCRcBJg==
X-Gm-Gg: ASbGnctZhZOQIE/G+bsKCzOBYZRHyBWi7j2YlhanQKo5eHhVgk2Gq8iUaep8tsQJIwG
 VXQaTqSth0y+2A8iIYVYYTroedZA/q98iNOsyocJ2jbf2Ucs+59qPwigqcknu2kbunnaCWy9PGe
 0nAoAYZqieuRonS9q6TrgDVP7P4IoMZBKeUmT6knSDoalGflwa9JzkX69EDqKgOzM/X5LqltaSd
 96MFuDOWGa+QFvNbCDH3yxDx0eSHrPL3sQwDTf6WW2E1RHGdWNyg2Nbjih2MQxIQQQHputgw6Rd
 6LVI7c0YZSdO153WgDXvmK6PhpB52a9z
X-Google-Smtp-Source: AGHT+IFQQeBRH8hc9cpe1+POZWSm9Oqf6+Tge6lYwjyBKvJD1S8vPCAGAeQGp5zCuuBBVUsmXP0CWQ==
X-Received: by 2002:a05:6a20:c906:b0:1f5:8e54:9f10 with SMTP id
 adf61e73a8af0-1fe43205c56mr12270119637.34.1742611827344; 
 Fri, 21 Mar 2025 19:50:27 -0700 (PDT)
Received: from svarch ([119.132.18.85]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-73905fa39cdsm2876009b3a.25.2025.03.21.19.50.25
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 21 Mar 2025 19:50:26 -0700 (PDT)
From: lorniu <lorniu@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Add method to update the max-value for progress-reporter
X-Debbugs-Cc: 
Date: Sat, 22 Mar 2025 10:50:24 +0800
Message-ID: <875xk17p8v.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::636;
 envelope-from=lorniu@HIDDEN; helo=mail-pl1-x636.google.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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sat, 22 Mar 2025 03:58:12 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


Progress report is good for showing the progress. But the max-value is
determined when creating the reporter object. However, in some cases,
max-value is not sure at the very beginning.

For example, sometimes, when downloading over the network, the max-value
is not determined until the first data is returned. In this case, initialize
max-value of the progress object after it created maybe a choice.

Is it possible to add such function to do this?

  (setq reporter (make-progress-reporter "Downloading..."))
  (setf (progress-reporter-max-value reporter) 3300) ; something like this
  (dotimes (i 10) (progress-reporter-update reporter (* 33 i)))

Many thanks!




Acknowledgement sent to lorniu <lorniu@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#77167; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 22 Mar 2025 12:00:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.