A progress indicator for code blocks in org-mode courtesy
of John Kitchin:
;; 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"))
7 thoughts on “A progress indicator for code blocks in org-mode”
Cool. I think it’d be nicer if it used text-properties to highlight only the currently evaluating block, instead of changing the face, which affects all blocks not only in this buffer but all buffers. I don’t know how to actually do this though 🙂
This is what I have so far: http://pastebin.com/RPfyePgS
It adds a text overlay on the current code block, sets the background to yellow, then creates a timer to delete the overlay 0.5 seconds after the block has finished evaluating. That way if it’s instantaneous you still get feedback. (0.1 seconds might be better)
With timers there’s the possibility that you start evaluating another block before the timer has fired. I haven’t tested this.
Well, how embarrassing. Nevermind, the code doesn’t work. Back to the drawing board.
“Grant Rettke: A progress indicator for code blocks in #org-mode” http://t.co/9nqCOSVgV6
Thanks for sharing your work.
I found the problem. I needed (redisplay) after placing the overlays. http://pastebin.com/NJg8QVdq