changeset 59651:939528a9d14b

Add dotimes-with-progress-reporter.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 19 Jan 2005 23:47:35 +0000
parents bc3232a12020
children 9672303dbf4f
files etc/NEWS lispref/display.texi
diffstat 2 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Wed Jan 19 23:46:31 2005 +0000
+++ b/etc/NEWS	Wed Jan 19 23:47:35 2005 +0000
@@ -2512,9 +2512,9 @@
 
 +++
 ** 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
--- a/lispref/display.texi	Wed Jan 19 23:46:31 2005 +0000
+++ b/lispref/display.texi	Wed Jan 19 23:47:35 2005 +0000
@@ -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 @@
 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