unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 49536@debbugs.gnu.org
Subject: bug#49536: 28.0.50; Confusing dolist-with-progress-reporter behaviour
Date: Tue, 13 Jul 2021 03:18:20 +0200	[thread overview]
Message-ID: <87o8b7t3j7.fsf@web.de> (raw)
In-Reply-To: <87bl77tulj.fsf@posteo.net> (Philip Kaludercic's message of "Mon,  12 Jul 2021 15:33:44 +0000")

Philip Kaludercic <philipk@posteo.net> writes:

> I am not sure if this is intentional

Looks more like a typical problem with counting...

> but in case it is no, the following patch should fix it:
>
> From f7da2585886bd4fd795713a605ff6bd17a4c337a Mon Sep 17 00:00:00 2001
> From: Philip Kaludercic <philipk@posteo.net>
> Date: Mon, 12 Jul 2021 17:26:43 +0200
> Subject: [PATCH] Fix dolist-with-progress-reporter behaviour
>
> * subr.el (dolist-with-progress-reporter): Use the length of list
>   argument as maximal value the reporter with reach
> ---
>  lisp/subr.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index e49c277335..20f40be40d 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -5880,7 +5880,7 @@ dolist-with-progress-reporter
>             (,count 0)
>             (,list ,(cadr spec)))
>         (when (stringp ,prep)
> -         (setq ,prep (make-progress-reporter ,prep 0 (1- (length ,list)))))
> +         (setq ,prep (make-progress-reporter ,prep 0 (length ,list))))

I think this patch is correct: 0 stands for 0% finished, and we have
finished after processing 100% of the list's elements, whose number is
(length list).  With other words: we have (+ 1 (length list)) steps: one
after having processed each element, plus the one before having started.

Are you able to install the patch, or does someone else have to do it?


Thanks,

Michael.





  reply	other threads:[~2021-07-13  1:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 15:33 bug#49536: 28.0.50; Confusing dolist-with-progress-reporter behaviour Philip Kaludercic
2021-07-13  1:18 ` Michael Heerdegen [this message]
2021-07-13  6:54   ` Philip Kaludercic
2021-07-13 13:14     ` Lars Ingebrigtsen
2022-07-16 12:32       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8b7t3j7.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=49536@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).