emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Giorgio Valoti <giorgio_v@me.com>
To: emacs-orgmode@gnu.org
Subject: Link to original Org file with batch mode, a follow-up
Date: Tue, 05 Jul 2011 06:51:04 +0200	[thread overview]
Message-ID: <CD687828-A385-4795-A05C-BD5B69DDD94B@me.com> (raw)
In-Reply-To: <EB3317BD-4907-4B2E-8E67-CCEAAD6AF81E@me.com>


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	other threads:[~2011-07-05  4:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04  4:58 Link to original Org file with batch mode Giorgio Valoti
2011-07-05  4:51 ` Giorgio Valoti [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CD687828-A385-4795-A05C-BD5B69DDD94B@me.com \
    --to=giorgio_v@me.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).