From e6b826dd8d5347cf7ffa25d0e9f39ee0c8002b7e Mon Sep 17 00:00:00 2001 From: Anatoly Smolyaninov Date: Mon, 10 Aug 2015 11:31:14 +0600 Subject: [PATCH] Evaluation progress bar, fixes #1197 --- cider-interaction.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cider-interaction.el b/cider-interaction.el index b54e55dc0..f903f0124 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1715,14 +1715,19 @@ If `cider-interactive-eval-override' is a function, call it with the same arguments and only proceed with evaluation if it returns nil." (let ((form (or form (apply #'buffer-substring bounds))) (start (car-safe bounds)) - (end (car-safe (cdr-safe bounds)))) + (end (car-safe (cdr-safe bounds))) + (eval-buffer (current-buffer))) (unless (and cider-interactive-eval-override (functionp cider-interactive-eval-override) (funcall cider-interactive-eval-override form callback bounds)) (cider--prep-interactive-eval form) + (spinner-start 'progress-bar) (nrepl-request:eval form - (or callback (cider-interactive-eval-handler nil end)) + (lambda (&rest args) + (with-current-buffer eval-buffer (spinner-stop)) + (let ((cb (or callback (cider-interactive-eval-handler nil end)))) + (when cb (apply cb args)))) ;; always eval ns forms in the user namespace ;; otherwise trying to eval ns form for the first time will produce an error (if (cider-ns-form-p form) "user" (cider-current-ns))