branch: elpa/git-commit commit 2d33e01ffb43e95784cb8eb4c3e94026081fbfa2 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-run-hook-with-benchmark: Cosmetics --- lisp/magit-mode.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index 4c658e024b..4f7f21fed5 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -1454,17 +1454,17 @@ The additional output can be found in the *Messages* buffer." (if magit-refresh-verbose "Enabled" "Disabled"))) (defun magit-run-hook-with-benchmark (hook) - (when hook - (if magit-refresh-verbose - (let ((start (current-time))) - (message "Running %s..." hook) - (run-hook-wrapped - hook - (lambda (fn) - (message " %-50s %f" fn (benchmark-elapse (funcall fn))))) - (message "Running %s...done (%.3fs)" hook - (float-time (time-subtract (current-time) start)))) - (run-hooks hook)))) + (cond + ((not hook)) + (magit-refresh-verbose + (message "Running %s..." hook) + (message "Running %s...done (%.3fs)" hook + (benchmark-elapse + (run-hook-wrapped + hook + (lambda (fn) + (message " %-50s %f" fn (benchmark-elapse (funcall fn)))))))) + ((run-hooks hook)))) ;;; _ (provide 'magit-mode)