From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#49536: 28.0.50; Confusing dolist-with-progress-reporter behaviour Date: Mon, 12 Jul 2021 15:33:44 +0000 Message-ID: <87bl77tulj.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25653"; mail-complaints-to="usenet@ciao.gmane.io" To: 49536@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 12 17:34:55 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1m2xxP-0006OS-9H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Jul 2021 17:34:55 +0200 Original-Received: from localhost ([::1]:54694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2xxN-00008B-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Jul 2021 11:34:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2xwY-0007Vz-EE for bug-gnu-emacs@gnu.org; Mon, 12 Jul 2021 11:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2xwY-0005CQ-5B for bug-gnu-emacs@gnu.org; Mon, 12 Jul 2021 11:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2xwY-000080-1S for bug-gnu-emacs@gnu.org; Mon, 12 Jul 2021 11:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Jul 2021 15:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49536 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1626104036477 (code B ref -1); Mon, 12 Jul 2021 15:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Jul 2021 15:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:38700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2xwR-00007c-OV for submit@debbugs.gnu.org; Mon, 12 Jul 2021 11:33:56 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2xwQ-00007V-Aw for submit@debbugs.gnu.org; Mon, 12 Jul 2021 11:33:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2xwQ-00077n-1X for bug-gnu-emacs@gnu.org; Mon, 12 Jul 2021 11:33:54 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:33023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2xwM-00053D-Co for bug-gnu-emacs@gnu.org; Mon, 12 Jul 2021 11:33:53 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 04935240104 for ; Mon, 12 Jul 2021 17:33:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1626104026; bh=Gaqh1ClDfeo1T7W1gDTIuWKqaf2lZKu4xqs2MFs7ARo=; h=From:To:Subject:Autocrypt:Date:From; b=gTE4gm45H2li+bQZ4+n8DRfQod1//McjX/Ta/fnjwZmIxKfe0Q4HepBWEtgt1WpJ5 PGW0QW9nFtYNBfrhV/MTlM4f9xjeD3+O5rgpCLtX2qQofNvh5QfXXPUX5E70EYJeqA XS3Nk2nWikIVa/0Ve+M8nSkM6RqhRQNl2XP8+FT3X6Be40XTptjtbeKBZ0/H+XWvge LbdaWX76zC/QeVPZJdI6ylDBFiwW65Jk2rKrWICD5kTN6aIMPopL4pvjM3YX6DJabJ 0YzVt+lnqDxakBAYs/4gJRuYE19gJXxgyOeoV2MgRt2h9f7mIWvb7SA98D45MZC3ai ud6gqyI2ysOPQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GNnqF1d4wz9rxN for ; Mon, 12 Jul 2021 17:33:45 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209828 Archived-At: --=-=-= Content-Type: text/plain When evaluating this form (dolist-with-progress-reporter (i (number-sequence 1 4)) "Doing stuff" (sleep-for 1)) I would expect to get the messages Doing stuff... Doing stuff...25% Doing stuff...50% Doing stuff...75% Doing stuff...Done each update after one argument of the list has been handled. Instead, it seems I get Doing stuff... Doing stuff...33% Doing stuff...66% Doing stuff...100% Doing stuff...Done This confuses me, because after "processing" one out of four elements, I wouldn't expect the message to say I already finished a third. And on the other side, I am still not done after reaching 100%, and in this case, am still waiting for the last element to be processed. I am not sure if this is intentional, but in case it is no, the following patch should fix it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-dolist-with-progress-reporter-behaviour.patch >From f7da2585886bd4fd795713a605ff6bd17a4c337a Mon Sep 17 00:00:00 2001 From: Philip Kaludercic 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)))) (dolist (,(car spec) ,list) ,@body (progress-reporter-update ,prep (setq ,count (1+ ,count)))) -- 2.30.2 --=-=-= Content-Type: text/plain In GNU Emacs 28.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-06-20 built on icterid Repository revision: 869db473cbd510270faec2ba43dd4a5ba10b0020 Repository branch: feature/rcirc-update Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure --with-native-compilation' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: TeX-PDF-mode: t paredit-mode: t flymake-mode: t flyspell-mode: t outline-minor-mode: t rcirc-track-minor-mode: t display-time-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t winner-mode: t electric-pair-mode: t recentf-mode: t save-place-mode: t savehist-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/philip/.config/emacs/elpa/transient-0.3.6/transient hides /home/philip/Code/src/emacs/lisp/transient Features: (shadow emacsbug sh-script executable ps-mode descr-text allout locate grep windmove magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util preview reporter desktop frameset tex-buf tex-fold reftex-dcr reftex-auc reftex reftex-loaddefs reftex-vars font-latex latex latex-flymake tex-ispell tex-style tex texmathp tex-mode latexenc org-goto tramp-sshfs tramp-smb tramp-rclone tramp-fuse tramp-gvfs zeroconf tramp-crypt tramp-adb ibuffer ibuffer-loaddefs git-rebase tramp-cmds gnus-draft vc-annotate em-alias em-basic em-dirs esh-var em-hist em-ls em-script em-tramp em-unix em-cmpl em-glob em-pred em-prompt em-rebind em-smart esh-mode em-term two-column debug ps-mule mhtml-mode css-mode smie js sgml-mode htmlize cl url-http url-gw url-cache url-auth display-line-numbers cal-move calc-forms calc-bin calc-frac calc-lang calc-mode calc-undo calc-math calcalg2 calccomp calc-arith calc-misc calc-alg calc-ext calc-aent calc-menu calc calc-loaddefs calc-macs whitespace hi-lock ffap apropos facemenu modus-vivendi-theme help-at-pt tabify man gdb-mi gud cl-print edebug backtrace shortdoc yasnippet-snippets yasnippet help-fns avy tramp-cache tramp-sh pulse view reposition flymake-cc macrostep-c cmacexp macrostep cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs cc-vars cc-defs cc-bytecomp org-clock cus-edit cus-start finder-inf char-fold misearch multi-isearch shell-command+ markdown-mode color mailalias bbdb-pgp bbdb-message autocrypt-message flow-fill mm-archive qp magit-extras magit-patch goto-addr bug-reference dired-aux pp vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs mule-util sort smiley gnus-cite mail-extr gnus-bcklg org-duration diary-lib diary-loaddefs cal-iso ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe ol-docview ol-bibtex bibtex ol-bbdb ol-w3m face-remap org-agenda org-refile gnus-async gnus-ml autocrypt-gnus autocrypt nndraft nnmh epa-file gnutls network-stream nsm nnmaildir nnfolder bbdb-gnus bbdb-mua bbdb-com nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win time-stamp quail vc-backup log-view vc-fossil vc make-mode sp-tutor doc-view jka-compr image-mode exif ps-print ps-print-loaddefs ps-def lpr vc-svn ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox org-element org ob ob-tangle ob-ref ob-lob ob-table org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp org-table org-keys org-loaddefs find-func avl-tree ol ob-exp ob-core org-compat advice ob-eval org-macs waffel hl-line tramp tramp-loaddefs trampver tramp-integration tramp-compat ls-lisp etags fileloop generator xref project paredit checkdoc flymake-proc flymake thingatpt flyspell ispell noutline outline dired-x rcirc parse-time iso8601 time bbdb bbdb-site timezone sendmail gnus nnheader magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff git-commit log-edit message rmc puny rfc822 mml mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor term disp-table ehelp eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util dired dired-loaddefs shell pcomplete server magit-mode transient format-spec magit-git magit-section comp comp-cstr warnings cl-extra help-mode derived benchmark magit-utils which-func imenu vc-git diff-mode vc-dispatcher ido crm dash hippie-exp winner elec-pair recentf tree-widget wid-edit saveplace savehist paren modus-operandi-theme modus-themes edmacro kmacro holidays hol-loaddefs cal-menu calendar cal-loaddefs cus-load setup load compile easy-mmode files-x pcase rx text-property-search comint ansi-color ring autoload radix-tree lisp-mnt tex-site slime-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 2097065 1884485) (symbols 48 83251 983) (strings 32 372750 132457) (string-bytes 1 11364694) (vectors 16 144289) (vector-slots 8 3652510 1692147) (floats 8 1786 6127) (intervals 56 83336 56698) (buffers 992 157)) -- Philip K. --=-=-=--