emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Oesting <oestingm@me.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Emacs shell-script to tangle org-babel at the command line.
Date: Mon, 13 Aug 2012 11:15:45 -0700	[thread overview]
Message-ID: <060745A0-24ED-40CC-B501-B35969434F5F@me.com> (raw)

I recently wrote what I thought to be a very simply she'll script to tangle a file; simply call the script on a file, e.g. 'tangle corgi.org' and a file, 'corgi.rb' (assuming one uses Ruby) appears in the local directory.

Tangling the file from within Emacs works normally.  Tangling from this script does not work; the only interesting response is "tangled 0 code blocks from corgi.org".  The same file tangles two blocks from within Emacs.

It seems that the org-babel-tangle function is using some piece of information present in the normal Emacs loading sequence which is not found during the script load.  I could provide a large number of files, but I imagine that the problem will be obvious to someone here.

What is wrong with this code?

#!/usr/bin/emacs --script

;; The subdirectory ~/.emacs.d is to be added to the top-level elisp
;; file search.
(progn (cd "~/.emacs.d") (normal-top-level-add-subdirs-to-load-path))

;; Org-Mode, Org-Babel, and the tangle library are required, if we are
;; to proceed further.
(require 'org-install)
(require 'org)
(require 'ob-tangle)

;; Load the main configuration and setup file.
(require 'ob-ruby)
(require 'ob-python)
(require 'ob-emacs-lisp)
(require 'ob-lisp)

;; Tangle all files given.
(dolist (file command-line-args-left) 
 (princ file)
 (org-babel-tangle-file file))

             reply	other threads:[~2012-08-13 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 18:15 Matthew Oesting [this message]
2012-08-13 19:12 ` Emacs shell-script to tangle org-babel at the command line Andrew Young
2012-08-13 22:01   ` Matthew Oesting

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=060745A0-24ED-40CC-B501-B35969434F5F@me.com \
    --to=oestingm@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).