Re: [O] Scripting with org-mode

2015-11-30 Thread Shakthi Kannan
Hi, --- On Tue, Dec 1, 2015 at 1:52 AM, Nick Dokos wrote: | IIUC, org-babel-execute-buffer is exactly what the OP | needs. \-- Yes, that did it. Thanks! SK -- Shakthi Kannan http://www.shakthimaan.com

Re: [O] Scripting with org-mode

2015-11-30 Thread John Kitchin
of course there is a simpler way ;) John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Mon, Nov 30, 2015 at 3:22 PM,

Re: [O] Scripting with org-mode

2015-11-30 Thread Nick Dokos
John Kitchin writes: > I think one of these will do what you want: > > ** Rerun all src blocks > > #+BEGIN_SRC emacs-lisp > (defun run-blocks () > (interactive) > (save-excursion > (org-element-map (org-element-parse-buffer) 'src-block > (lambda (src-block) > (goto-char (org

Re: [O] Scripting with org-mode

2015-11-30 Thread John Kitchin
I think one of these will do what you want: ** Rerun all src blocks #+BEGIN_SRC emacs-lisp (defun run-blocks () (interactive) (save-excursion (org-element-map (org-element-parse-buffer) 'src-block (lambda (src-block) (goto-char (org-element-property :begin src-block))

Re: [O] Scripting with org-mode

2015-11-30 Thread briangpowell .
* Assuming that entire file is made up of shell commands (like the ones in the example you gave) since, in such a case as your example the "#" in the first column would ignore the rest of the lines as comments: M< Mx set-mark M> Mx shell-command-on-region On Mon, Nov 30, 2015 at 11:43 AM, Shakthi

[O] Scripting with org-mode

2015-11-30 Thread Shakthi Kannan
Hi, Is there a way to execute all the org-mode code blocks in a file, and send the output to stdout? For example, I have the following org file: === BEGIN === * Greeting #+BEGIN_SRC sh :results output echo "Hello $USER! Today is `date`" #+END_SRC * Current directory #+BEGIN_SRC sh :results