[O] How to build a project from org files using ant/make?

2012-03-02 Thread Robert McIntyre
Hi,

I use org-babel to produce the source and html documentation for my projects.

My projects generally look like this:

[~/tmp/org-project] $ tree
.
|-- html
|   `-- proj.html
|-- org
|   `-- proj.org
`-- src
`-- namesace
|-- prog_1.clj
`-- prog_2.clj

Here prog_1.clj, prog_2.clj, and proj.html are all generated from the
proj.org file.

Because the source and html files are generated files, I don't include
them in source control.

When I download my project on another computer, I want to be able to
generate all these files again, preferably from a makefile/build.xml,
etc.

What is the best practice for doing this?  Right now, I maintain two
shell scripts called tangle and weave that invoke emacs on the
project, but these rely on my specific emacs setup.  How can I make it
possible for someone to build my project if they have emacs and
make/ant?  What are other people doing when it comes to automatically
building a project whose source files are generated from org files?

sincerely,
--Robert McIntyre



[O] How to format really long #+whatever lines

2011-11-01 Thread Robert McIntyre
In my literate org projects at http://aurellem.com/, I often have to
use very long lines such as:

#+description: Capture video from a JMonkeyEngine3 Application with
Xuggle, and use gstreamer to compress the video to upload to YouTube.

#+begin_src clojure :noweb yes :tangle ../src/pokemon/types.clj :var
pokemon-table-gen-one=pokemon-table-gen-one :var
pokemon-table-gen-two=pokemon-table-gen-two :exports none

They wrap off the end of my screen and are hard to edit.

Is there a way to use multiple lines to achieve the same effect?  I
couldn't find anything in the org manual.

sincerely,
--Robert McIntyre



[O] [bug] cannot execute shell code blocks

2011-07-19 Thread Robert McIntyre
I can't execute any sh code blocks for this file anymore.  This has to be a
very recently introduced problem.




#+BABEL: :exports both :results verbatim :noweb yes :cache yes


* Setup

Code Execution no longer works for this file.
I get instead:
progn: Symbol's function definition is void: org-babel-result-hash

This must have been a very recent change -- the results blocks are
from executing these blocks in the morning.

org-version gives:
release_7.6-116-g90d7
Org-mode version 7.6 (release_7.6.116.g90d7)

sincerely,
Robert McIntyre

First, I checked out the source to jMonkeyEngine using the following
command:

#+begin_src sh
# svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
sleep 2;
echo  Checked out revision 7881.
#+end_src

#+results[41b64eeb0a6cd4c98f3d52ace4342bfde961aeab]:
:  Checked out revision 7881.

Building jMonkeyEngine is easy enough:

#+begin_src sh
#cd jme3
#ant jar | tail -n 2
sleep 2;
echo BUILD SUCCESSFUL\nTotal time: 11 seconds;
#+end_src

#+results[6f2a3e338f959eebdee983364c8c621ed0e49618]:
: BUILD SUCCESSFUL
: Total time: 11 seconds



sincerely,
--Robert McIntyre


Re: [O] [bug] cannot execute shell code blocks

2011-07-19 Thread Robert McIntyre
BTW, this only fails to evaluate when :cache yes is present, as shown by
this example

#+begin_src sh
echo  Checked out revision 7881.
#+end_src

#+results:
: Checked out revision 7881.

#+begin_src sh :cache yes
echo  Checked out revision 7881.
#+end_src

gives error:
progn: Symbol's function definition is void: org-babel-result-hash


sorry about the confusing message earlier.

sincerely,
--Robert McIntyre



On Tue, Jul 19, 2011 at 3:10 AM, Robert McIntyre r...@mit.edu wrote:

 I can't execute any sh code blocks for this file anymore.  This has to be a
 very recently introduced problem.




 #+BABEL: :exports both :results verbatim :noweb yes :cache yes


 * Setup

 Code Execution no longer works for this file.
 I get instead:
 progn: Symbol's function definition is void: org-babel-result-hash

 This must have been a very recent change -- the results blocks are
 from executing these blocks in the morning.

 org-version gives:
 release_7.6-116-g90d7
 Org-mode version 7.6 (release_7.6.116.g90d7)

 sincerely,
 Robert McIntyre

 First, I checked out the source to jMonkeyEngine using the following
 command:

 #+begin_src sh
 # svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
 sleep 2;
 echo  Checked out revision 7881.
 #+end_src

 #+results[41b64eeb0a6cd4c98f3d52ace4342bfde961aeab]:
 :  Checked out revision 7881.

 Building jMonkeyEngine is easy enough:

 #+begin_src sh
 #cd jme3
 #ant jar | tail -n 2
 sleep 2;
 echo BUILD SUCCESSFUL\nTotal time: 11 seconds;
 #+end_src

 #+results[6f2a3e338f959eebdee983364c8c621ed0e49618]:
 : BUILD SUCCESSFUL
 : Total time: 11 seconds



 sincerely,
 --Robert McIntyre



[O] [bug] (:cache yes) not respected for the second nameless code block during html export

2011-07-18 Thread Robert McIntyre
M-x org-version yields:
release_7.6-105-gbfed5
Org-mode version 7.6 (release_7.6.105.gbfed5)

When I try to export this file to html, org re-evaulates the second code
block, even though it has :cache yes

https://gist.github.com/1090173

sincerely,
--Robert McIntyre


[O] [PATCH] Adding support for :results output for clojure src blocks.

2011-07-12 Thread Robert McIntyre
This small patch handles :results output for clojure src blocks by using
clojure's with-out-str function.

Please let me know if I've done anything wrong as this is my first patch to
org-mode.

sincerely,
--Robert McIntyre
diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index a72b14c..00013b8 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -62,16 +62,22 @@
 			 vars \n  )
 			]\n body ))
 		  body
-(if (or (member code result-params)
-	(member pp result-params))
-	(format
-	 (concat
-	  (let [org-mode-print-catcher (java.io.StringWriter.)] 
-	  (clojure.pprint/with-pprint-dispatch clojure.pprint/%s-dispatch 
-	  (clojure.pprint/pprint (do %s) org-mode-print-catcher) 
-	  (str org-mode-print-catcher
-	 (if (member code result-params) code simple) body)
-  body)))
+(cond 
+ ((or (member code result-params)
+	  (member pp result-params))
+  (format
+   (concat
+	(let [org-mode-print-catcher (java.io.StringWriter.)] 
+	(clojure.pprint/with-pprint-dispatch clojure.pprint/%s-dispatch 
+	(clojure.pprint/pprint (do %s) org-mode-print-catcher) 
+	(str org-mode-print-catcher
+   (if (member code result-params) code simple) body))
+ ;; if (:results output), collect printed output 
+ ((member output result-params)
+  (format (clojure.core/with-out-str %s) body))
+ (t body
+
+
 
 (defun org-babel-execute:clojure (body params)
   Execute a block of Clojure code with Babel.


[O] Some bugs with ob-clojure.el and some more with ob-sh.el

2011-07-09 Thread Robert McIntyre
I've made a gist at

https://gist.github.com/1073383

that details some problems with ob-clojure.el and ob-sh.el.

In particular, there are a few problems with :results verbatim/scalar and
:results output for the two modes.

M-x org-version returns:
Org-mode version 7.5 (release_7.5.516.gf06e.dirty)

I hope that this will be helpful to someone in squashing some bugs.  If
there are any questions please email me.  I'd love to help in any way I can
to make org-mode even better.

sincerely,
--Robert McIntyre


[O] Fwd: Some bugs with ob-clojure.el and some more with ob-sh.el

2011-07-09 Thread Robert McIntyre
-- Forwarded message --
From: Robert McIntyre r...@mit.edu
Date: Sat, Jul 9, 2011 at 11:04 AM
Subject: Re: [O] Some bugs with ob-clojure.el and some more with ob-sh.el
To: Bastien b...@altern.org


Great idea --- I updated my version of Org such that:


M-x org-version returns:
Org-mode version 7.6 (release_7.6.32.ga493b.dirty)

Now even more of my tests fail :(

I've updated the gist accordingly.  It's at https://gist.github.com/1073383

In particular, ob-clojure.el doesn't seem to respect spaces when a function
returns a literal string.

Thanks for responding so fast, and If I can do anything else to help please
let me know.

sincerely,
--Robert McIntyre



On Sat, Jul 9, 2011 at 7:13 AM, Bastien b...@altern.org wrote:

 Hi Robert,

 Robert McIntyre r...@mit.edu writes:

  I've made a gist at
 
  https://gist.github.com/1073383

 Thanks for this feedback.

  that details some problems with ob-clojure.el and ob-sh.el.
 
  In particular, there are a few problems with :results verbatim/scalar
  and :results output for the two modes.
 
  M-x org-version returns:
  Org-mode version 7.5 (release_7.5.516.gf06e.dirty)

 Can you check if you have the same errors with the latest Org
 version -- either  7.6 or the one from git?

 Thanks a lot,

 --
  Bastien



[O] problem with html export when using clojure and :exports both

2011-06-24 Thread Robert McIntyre
Hi everyone --- I've been working on making a website using clojure and
org-mode, and have run into what I think may be a bug.

Any help would be appreciated as to whether this is a bug, or if I am doing
something wrong.

sincerely,
--Robert McIntyre

M-x org-version gives:

release_7.5-435-gd3100
Org-mode version 7.5 (release_7.5.435.gd3100)

M-x version gives:
GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-11-23 on
rothera, modified by Debian


and the following file fails on conversion to html with the error message

Export buffer:
Exporting...
org-babel-exp processing...
if: Wrong number of arguments: called-interactively-p, 1


BEGIN FILE TEST.ORG

#+begin_src clojure :exports both
(+ 1 2)
#+end_src

#+results:
: 3

END FILE TEST.ORG


sincerely,
--Robert McIntyre


Re: [O] problem with html export when using clojure and :exports both

2011-06-24 Thread Robert McIntyre
Thanks for your reply -- I've updated using `git pull` and while some of the
relevant files have changed, I still have the same problem.

M-x org-version yields:
release_7.5-440-g00c62
Org-mode version 7.5 (release_7.5.440.g00c62)



sincerely,
--Robert McIntyre


On Fri, Jun 24, 2011 at 6:55 PM, Eric Schulte schulte.e...@gmail.comwrote:

 Hi Robert,

 It looks like this is an issue which should have been fixed by a commit
 I made last week, namely

 ,
 | commit db1c3f6a3ea5d9cb25c8fad5aae434fc1d424152
 | Author: Eric Schulte schulte.e...@gmail.com
 | Date:   Thu Jun 16 21:32:54 2011 -0700
 |
 | Revert replacing calls to now-defunct function `interactive-p'
 |
 | This reverts commit 4f084e14672d4768bbff1614857ca9218230df69.
 `

 Updating to the HEAD of the git repo should fix this problem.

 Cheers -- Eric

 Robert McIntyre r...@mit.edu writes:

  Hi everyone --- I've been working on making a website using clojure and
  org-mode, and have run into what I think may be a bug.
 
  Any help would be appreciated as to whether this is a bug, or if I am
 doing
  something wrong.
 
  sincerely,
  --Robert McIntyre
 
  M-x org-version gives:
 
  release_7.5-435-gd3100
  Org-mode version 7.5 (release_7.5.435.gd3100)
 
  M-x version gives:
  GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-11-23
 on
  rothera, modified by Debian
 
 
  and the following file fails on conversion to html with the error message
 
  Export buffer:
  Exporting...
  org-babel-exp processing...
  if: Wrong number of arguments: called-interactively-p, 1
 
 
  BEGIN FILE TEST.ORG
 
  #+begin_src clojure :exports both
  (+ 1 2)
  #+end_src
 
  #+results:
  : 3
 
  END FILE TEST.ORG
 
 
  sincerely,
  --Robert McIntyre

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte/



Re: [O] question about :results scalar

2011-06-21 Thread Robert McIntyre
Excellent --- I'm glad that the interaction with emacs-lisp is straightened
out!

I've been continuing working with source blocks and the same problem seems
to be present with clojure interaction.

#+begin_src clojure :exports both :results scalar
(ns whatever)
(defn works? [] true)
#+end_src

#+results:
| function | whatever/works? |


The clojure repl would normally output the text

#'whatever/works?

but this is being converted into an org-mode table, ignoring the :results
scalar declaration.

futrhermore, the same test with emacs-lisp also fails as in this example


#+begin_src clojure :results scalar
'(1 2 3)
#+end_src

#+results:
| 1 | 2 | 3 |

---


also, although :results scalar still works,  :results verbatim does not work
quite yet for emacs-lisp

#+begin_src emacs-lisp :results scalar
;;(debug t nil)
'(1 2 3)
#+end_src

#+results:
: (1 2 3)


#+begin_src emacs-lisp :results verbatim
;;(debug t nil)
'(1 2 3)
#+end_src

#+results:
| 1 | 2 | 3 |



M-x org-version returns:
Org-mode version 7.5 (release_7.5.414.g56de5.dirty)


Thank you so much for your prompt attention to my last comments!

sincerely,
--Robert McIntyre


On Sun, Jun 19, 2011 at 6:08 PM, Eric Schulte schulte.e...@gmail.comwrote:

 Hi Rob,

 Thanks for pointing this out.  The emacs-lisp interaction is so simple
 we apparently never implemented checks which are routine in other
 languages.  I just pushed up a fix to the git repository so the
 :results scalar header argument combination should now be respected
 for emacs-lisp.

 Thanks -- Eric

 Robert McIntyre r...@mit.edu writes:

  hi --- I'm working through the org manual and have run into a strange
  problem with :results scalar
 
  M-x org-version gives Org-mode version 7.5
 (release_7.5.288.gcec8.dirty).
 
  I've made a code block using #+begin_src emacs-lisp :results scalar,
  with the source just being '(1 2 3), but I get back an org-table
  instead of the expected : (1 2 3). what am I doing wrong?
 
  a minimal example file can be found here:
   https://gist.github.com/1034648
 
  I also get the same thing when trying the stable Org-mode version 7.5.
 
  sincerely,
  --Robert McIntyre
 

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte/



[O] question about :results scalar

2011-06-19 Thread Robert McIntyre
hi --- I'm working through the org manual and have run into a strange
problem with :results scalar

M-x org-version gives Org-mode version 7.5 (release_7.5.288.gcec8.dirty).

I've made a code block using #+begin_src emacs-lisp :results scalar,
with the source just being '(1 2 3), but I get back an org-table
instead of the expected : (1 2 3). what am I doing wrong?

a minimal example file can be found here:
 https://gist.github.com/1034648

I also get the same thing when trying the stable Org-mode version 7.5.

sincerely,
--Robert McIntyre