emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Eric Schulte
Subject: Re: [Orgmode] Re: [babel] Error Before first headline.
Date: Tue, 03 Aug 2010 16:00:08 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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 <address@hidden>
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" <address@hidden> 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" <address@hidden> 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 <address@hidden> 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.
>>> address@hidden
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

reply via email to

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