Add dotimes-with-progress-reporter.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 19 Jan 2005 23:47:35 +0000 (23:47 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 19 Jan 2005 23:47:35 +0000 (23:47 +0000)
etc/NEWS
lispref/display.texi

index bdbc8cc..753855b 100644 (file)
--- 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
index 375db42..f244326 100644 (file)
@@ -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