From: Noam Postavsky Date: Sat, 12 Oct 2013 17:52:57 +0000 (-0400) Subject: make `with-elapsed-timer' hygienic X-Git-Tag: emacs-29.0.90~1306^2~15^2~437^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3d871c79947351459ab5f1b65a4f8ff81bcf570c;p=emacs.git make `with-elapsed-timer' hygienic --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 33aa332fd16..9e5d2cbc945 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -322,14 +322,15 @@ (defmacro with-elapsed-timer (text &rest forms) (if use-package-verbose - `(let ((now (current-time))) - (message "%s..." ,text) - (prog1 ,@forms - (let ((elapsed - (float-time (time-subtract (current-time) now)))) - (if (> elapsed ,use-package-minimum-reported-time) - (message "%s...done (%.3fs)" ,text elapsed) - (message "%s...done" ,text))))) + (let ((nowvar (make-symbol "now"))) + `(let ((,nowvar (current-time))) + (message "%s..." ,text) + (prog1 ,@forms + (let ((elapsed + (float-time (time-subtract (current-time) ,nowvar)))) + (if (> elapsed ,use-package-minimum-reported-time) + (message "%s...done (%.3fs)" ,text elapsed) + (message "%s...done" ,text)))))) `(prog1 ,@forms))) (put 'with-elapsed-timer 'lisp-indent-function 1)