# HG changeset patch # User Stefan Monnier # Date 1106178455 0 # Node ID 939528a9d14b9b02ff252122930ea548c8d2773d # Parent bc3232a12020b1c1e3b7884aef1825d092735853 Add dotimes-with-progress-reporter. diff -r bc3232a12020 -r 939528a9d14b etc/NEWS --- 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 diff -r bc3232a12020 -r 939528a9d14b lispref/display.texi --- 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