emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] progress indicator for code blocks?


From: Rainer M Krug
Subject: Re: [O] progress indicator for code blocks?
Date: Tue, 02 Sep 2014 11:18:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Thanks for this snippet - I think something along these lines should be
included into org out-of-the-box. 

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 <address@hidden> writes:

> John Kitchin <address@hidden> 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)?

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

Attachment: pgpt8M1tfdGSu.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]