From 849631c1b7e9c5c4a90655208265de9db0854bb2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 17 Jun 2018 13:13:52 +0300 Subject: [PATCH] Fix last change * etc/NEWS: Fix last added entry. * lisp/subr.el (dotimes-with-progress-reporter) (dolist-with-progress-reporter): Fix the advertised signature. * doc/lispref/display.texi (Progress): Fix last change. (Bug#31696) (Bug#31697) --- doc/lispref/display.texi | 28 ++++++++++++++++++---------- etc/NEWS | 4 +++- lisp/subr.el | 8 ++++---- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index feeb1caf197..a3dca1cd9c9 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -472,43 +472,51 @@ Secondly, @samp{done} is more explicit. @defmac dotimes-with-progress-reporter (var count [result]) reporter-or-message body@dots{} This is a convenience macro that works the same way as @code{dotimes} does, but also reports loop progress using the functions described -above. It allows you to save some typing. +above. It allows you to save some typing. The argument +@var{reporter-or-message} can be either a string or a progress +reporter object. -You can rewrite the example in the beginning of this node using -this macro this way: +You can rewrite the example in the beginning of this subsection using +this macro as follows: @example +@group (dotimes-with-progress-reporter (k 500) "Collecting some mana for Emacs..." (sit-for 0.01)) +@end group @end example +Using a reporter object as the @var{reporter-or-message} argument is +useful if you want to specify the optional arguments in +@var{make-progress-reporter}. For instance, you can write the +previous example as follows: -The second argument @code{reporter-or-message} might be a progress -reporter object. This is useful if you want to specify the optional -arguments in @code{make-progress-reporter}. -For instance, you can write previous example as follows: @example +@group (dotimes-with-progress-reporter (k 500) (make-progress-reporter "Collecting some mana for Emacs..." 0 500 0 1 1.5) (sit-for 0.01)) +@end group @end example @end defmac @defmac dolist-with-progress-reporter (var count [result]) reporter-or-message body@dots{} This is another convenience macro that works the same way as @code{dolist} does, but also reports loop progress using the functions described -above. As in @code{dotimes-with-progress-reporter}, @code{reporter-or-message} can be -a progress reporter or an string. -We can rewrite our previous example with this macro as follows: +above. As in @code{dotimes-with-progress-reporter}, +@code{reporter-or-message} can be a progress reporter or a string. +You can rewrite the previous example with this macro as follows: @example +@group (dolist-with-progress-reporter (k (number-sequence 0 500)) "Collecting some mana for Emacs..." (sit-for 0.01)) +@end group @end example @end defmac diff --git a/etc/NEWS b/etc/NEWS index b5d3d59320a..5a3a27ee4af 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -617,7 +617,9 @@ manual for more details. * Lisp Changes in Emacs 27.1 +++ -** New macro dolist-with-progress-reporter. +** New macro 'dolist-with-progress-reporter'. +This works like 'dolist', but reports progress similar to +'dotimes-with-progress-reporter'. +++ ** New hook 'after-delete-frame-functions'. diff --git a/lisp/subr.el b/lisp/subr.el index dc946bd90b0..7ac1c912818 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5050,11 +5050,11 @@ case, use this string to create a progress reporter. At each iteration, print the reporter message followed by progress percentage in the echo area. After the loop is finished, -print the reporter message followed by word \"done\". +print the reporter message followed by the word \"done\". This macro is a convenience wrapper around `make-progress-reporter' and friends. -\(fn (VAR COUNT [RESULT]) MESSAGE BODY...)" +\(fn (VAR COUNT [RESULT]) REPORTER-OR-MESSAGE BODY...)" (declare (indent 2) (debug ((symbolp form &optional form) form body))) (let ((prep (make-symbol "--dotimes-prep--")) (end (make-symbol "--dotimes-end--"))) @@ -5078,9 +5078,9 @@ case, use this string to create a progress reporter. At each iteration, print the reporter message followed by progress percentage in the echo area. After the loop is finished, -print the reporter message followed by word \"done\". +print the reporter message followed by the word \"done\". -\(fn (VAR LIST [RESULT]) MESSAGE BODY...)" +\(fn (VAR LIST [RESULT]) REPORTER-OR-MESSAGE BODY...)" (declare (indent 2) (debug ((symbolp form &optional form) form body))) (let ((prep (make-symbol "--dolist-progress-reporter--")) (count (make-symbol "--dolist-count--")) -- 2.39.5