From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: progress indicator for code blocks? Date: Tue, 02 Sep 2014 11:18:29 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkEd-0006uK-LN for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOkEX-0005CW-JH for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:18:43 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:43651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkEX-0005CO-DT for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:18:37 -0400 Received: by mail-wi0-f182.google.com with SMTP id z2so7439453wiv.9 for ; Tue, 02 Sep 2014 02:18:36 -0700 (PDT) In-Reply-To: (John Kitchin's message of "Sun, 31 Aug 2014 08:03:28 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Thanks for this snippet - I think something along these lines should be included into org out-of-the-box.=20 There are many cases where I simply use C-g to go back to emacs while the evaluation is still running - would your snippet still work? Rainer John Kitchin writes: > John Kitchin writes: > > I am currently using this bit of advice to change the color of code > blocks while they are being executed so there is a visual hint something > is happening. > > ;; give us some hint we are running > (defadvice org-babel-execute-src-block (around progress nil activate) > (set-face-attribute > 'org-block-background nil :background "LightSteelBlue") > (message "Running your code block") > ad-do-it > (set-face-attribute 'org-block-background nil :background "gray") > (message "Done with code block")) > > >> Hi all, >> I am using org-mode in a class, and some students wondered if it was >> possible for there to be a progress bar of some kind while a code block >> is running. Right now Emacs just appears to lock up and there is no >> indication anything is happening, especially the first time we run a >> python block. >> >> I found make-progress-reporter and tried something like this:: >> >> #+BEGIN_SRC emacs-lisp >> (defadvice org-babel-execute-src-block (around progress nil activate) >> (let ((pr (make-progress-reporter "Running"))) >> ad-do-it >> (progress-reporter-done pr))) >> #+END_SRC >> >> but there is no way to update it, so it doesn't quite do anything >> useful. >> >> What I would really like is an hourglass or some spinning thing. Does >> anyone know how to get that (in a cross-platform way)? =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUBYtpAAoJENvXNx4PUvmCDNYH/jEymL4TTuHlUOQaOEkRIWRv x5fyywGknkW07PApHbM4XSa3BFBn78HNiwA6tIJb/OreaSKH7hcFlhXE2Y4YoEmf HYR9mQhfcpMT5AHcplTAb6AryRRbzkqVdXa0Hr1KXsZEQw1vUXdJJxqaKxu5r0kA nNhGSLopnmCCr9mKDp9hIPDZ24+KBwTesqOxtVFA94s0Fpw7IGNL/7wXlzDS6zsm 2tk4WL5PabAAOjKoWFnGYfKUTBxFFzgRPAEK+WsPx0GMJQHV2uNDQKhC4l2Bk+8Z tYGprGYk8UK/fY0hXS8czTv/ak9RE+9tmJ4B56ctm2T0wFoJTSbXbb0z1uK9/Dc= =B0Zt -----END PGP SIGNATURE----- --=-=-=--