emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Link to original Org file with batch mode, a follow-up


From: Giorgio Valoti
Subject: [O] Link to original Org file with batch mode, a follow-up
Date: Tue, 05 Jul 2011 06:51:04 +0200

Il giorno 04/lug/2011, alle ore 06:58, Giorgio Valoti ha scritto:

> Hi,
> when I try to tangle files in batch mode, using a command like this:
> 
> emacs -batch ~/Developer/PROJECTS/gmp/project.org --eval="(org-babel-tangle)"
> 
> the resulting files do not have links to the original file, i.e.:
> 
> <!-- [[][GUI:1]] -->
> 
> while if I tangle from emacs I get this, as expected:
> 
> <!-- [[id:5E3B176A-50C7-4DC3-A54F-D769000D8D8A][GUI:1]] -->
> 
> Is there a way to generate links in batch mode? Or perhaps should I use a 
> different way to invoke tangling from the command line?


While looking at this, I discovered that :comments no web option does not work 
IDs, but only with paths, i.e. with this file:

# [[file:~/Desktop/org-links-test.org::*A%20section][A-section:1]]

ls -la

# A-section:1 ends here



(org-babel-detangle) works

but not with this:

# [[id:5E3B176A-50C7-4DC3-A54F-D769000D8D8A][A-section:1]]

ls -la

# A-section:1 ends here



Also, (org-babel-detangle) does not seem to work with nested blocks:

#! /bin/bash

# [[file:~/Desktop/org-links-test.org::*Main%20block][main-block]]

# [[file:~/Desktop/org-links-test.org::*Block%201][block1]]
echo 'this is the first block!'
# block1 ends here


# [[file:~/Desktop/org-links-test.org::*Block%202][block2]]
echo 'the second block!'
# block2 ends here

# main-block ends here



generated from this file:

* Detangling nested block

** Block 1
   #+srcname: block1
   #+begin_src sh
     echo 'this is the first block'    
   #+end_src

** Block 2
   #+srcname: block2
   #+begin_src sh
     echo 'the second block'
   #+end_src

** Main block
   #+srcname: main-block
   #+begin_src sh :comments noweb :noweb yes :tangle script2.sh :shebang #! 
/bin/bash
     <<block1>>
     <<block2>>     
   #+end_src


Hope this helps




Ciao
--
Giorgio Valoti




reply via email to

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