[Orgmode] Re: [babel] Error Before first headline.

2010-08-03 Thread Rustom Mody
 Hi im trying to figure out how to generate sourcefiles from babel files
and i keep getting the same error.

Tried putting a 'first headline' as it wants?
ie
* Dummy header
#+BEGIN_SRC emacs-lisp
(defun org-xor (a b)
etc
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [babel] Error Before first headline.

2010-08-03 Thread Eric Schulte
Hi,

Please include the actual error, as well as a minimal Org-mode file
sufficient to generate the error.  The email below does not contain
enough information to diagnose your problem.

Thanks -- Eric

Rustom Mody rustompm...@gmail.com writes:

 Hi im trying to figure out how to generate sourcefiles from babel files
 and i keep getting the same error.

 Tried putting a 'first headline' as it wants?
 ie
 * Dummy header
 #+BEGIN_SRC emacs-lisp
 (defun org-xor (a b)
 etc
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [babel] Error Before first headline.

2010-08-03 Thread Eric Schulte
Oh,

I missed the first message in this thread and didn't realize that the
previous message was a response to an existing bug report (one which
*did* include an error message and reproduction information).

My Apologies for the harsh reply -- Eric

also, I think the original message indicates a bug in Babel's tangling
which I will take a look at.

Eric Schulte schulte.e...@gmail.com writes:

 Hi,

 Please include the actual error, as well as a minimal Org-mode file
 sufficient to generate the error.  The email below does not contain
 enough information to diagnose your problem.

 Thanks -- Eric

 Rustom Mody rustompm...@gmail.com writes:

 Hi im trying to figure out how to generate sourcefiles from babel files
 and i keep getting the same error.

 Tried putting a 'first headline' as it wants?
 ie
 * Dummy header
 #+BEGIN_SRC emacs-lisp
 (defun org-xor (a b)
 etc
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [babel] Error Before first headline.

2010-08-03 Thread Eric Schulte
I've fixed this problem with the attached patch.

I'll push this patch up to the repository as soon as repo.or.cz comes
back online (looks like it's been down for the last couple of hours)

with the patch applied the following will now tangle
--8---cut here---start-8---
#+begin_src emacs-lisp :tangle yes
  (message is a problem?)
#+end_src
--8---cut here---end---8---

Best -- Eric

From a8ff1b0319bb536eca123b77ec1e5b3f702c2ff5 Mon Sep 17 00:00:00 2001
From: Eric Schulte schulte.e...@gmail.com
Date: Tue, 3 Aug 2010 11:20:48 -0600
Subject: [PATCH] ob-tangle: don't throw errors when we're not under of a headline

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): don't throw
  errors when we're not under of a headline
---
 lisp/ob-tangle.el |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 7464f59..a7ba072 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -234,7 +234,9 @@ code blocks by language.
 	   (setq current-heading new-heading))
 	   (setq block-counter (+ 1 block-counter
(replace-regexp-in-string [ \t] -
- (nth 4 (org-heading-components
+ (condition-case nil
+ (nth 4 (org-heading-components))
+   (error (buffer-file-name)
   (let* ((link (progn (call-interactively 'org-store-link)
   (org-babel-clean-text-properties
 			   (car (pop org-stored-links)
-- 
1.7.0.4


Eric Schulte schulte.e...@gmail.com writes:

 Oh,

 I missed the first message in this thread and didn't realize that the
 previous message was a response to an existing bug report (one which
 *did* include an error message and reproduction information).

 My Apologies for the harsh reply -- Eric

 also, I think the original message indicates a bug in Babel's tangling
 which I will take a look at.

 Eric Schulte schulte.e...@gmail.com writes:

 Hi,

 Please include the actual error, as well as a minimal Org-mode file
 sufficient to generate the error.  The email below does not contain
 enough information to diagnose your problem.

 Thanks -- Eric

 Rustom Mody rustompm...@gmail.com writes:

 Hi im trying to figure out how to generate sourcefiles from babel files
 and i keep getting the same error.

 Tried putting a 'first headline' as it wants?
 ie
 * Dummy header
 #+BEGIN_SRC emacs-lisp
 (defun org-xor (a b)
 etc
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode