From f0d3d9feb068b5bff633efaf355c31706caaa94f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 Jan 2005 23:47:35 +0000 Subject: [PATCH] Add dotimes-with-progress-reporter. --- etc/NEWS | 6 +++--- lispref/display.texi | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index bdbc8cc7a8..753855b46e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2512,9 +2512,9 @@ back the match can start; this is a way to keep it from taking too long. +++ ** New functions `make-progress-reporter', `progress-reporter-update', -`progress-reporter-force-update' and `progress-reporter-done' provide -a simple and efficient way for a command to present progress messages -for the user. +`progress-reporter-force-update', `progress-reporter-done', and +`dotimes-with-progress-reporter' provide a simple and efficient way for +a command to present progress messages for the user. --- ** To manipulate the File menu using easy-menu, you must specify the diff --git a/lispref/display.texi b/lispref/display.texi index 375db42412..f24432615e 100644 --- a/lispref/display.texi +++ b/lispref/display.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002 -@c Free Software Foundation, Inc. +@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, +@c 2002, 2005 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../info/display @node Display, Calendar, Processes, Top @@ -633,6 +633,22 @@ never print it, there are many good reasons for this not to happen. Secondly, ``done'' is more explicit. @end defun +@defmac dotimes-with-progress-reporter (var count [result]) message body... +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. + +You can rewrite the example in the beginning of this node using +this macro this way: + +@example +(dotimes-with-progress-reporter + (k 500) + "Collecting some mana for Emacs..." + (sit-for 0.01)) +@end example +@end defmac + @node Invisible Text @section Invisible Text -- 2.20.1