[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31697: 27.0.50; Add new macro dolist-with-progress-reporter
From: |
Tino Calancha |
Subject: |
bug#31697: 27.0.50; Add new macro dolist-with-progress-reporter |
Date: |
Sun, 17 Jun 2018 18:38:14 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Tino Calancha <tino.calancha@gmail.com> writes:
> Tino Calancha <tino.calancha@gmail.com> writes:
>
>> + (declare (indent 2) (debug ((symbolp form &optional form) form body)))
>> + (let ((prep (make-symbol "--dolist-progress-reporter--"))
>> + (count (make-symbol "--dolist-count--")))
>> + `(let ((,prep ,reporter-or-message)
>> + (,count 0))
>> + (when (stringp ,prep)
>> + (setq ,prep (make-progress-reporter ,prep 0 (1- (length ,(cadr
>> spec))))))
>> + (dolist ,spec
>> + ,@body
>> + (progress-reporter-update ,prep (setq ,count (1+ ,count))))
>> + (progress-reporter-done ,prep)
>> + (or ,@(cdr (cdr spec)) nil))))
> As pointed out by Noam in Bug#31696, I am also evaluating twice here the
> form at (nth 1 SPEC). I must add another variable.
> Updated patch.
Implemented into master branch as commit
'Add new macro dolist-with-progress-reporter'
(edb1f85a27817a3fac38bb85752671414819203b)