emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: [babel] Error Before first headline.
@ 2010-08-03 11:49 Rustom Mody
  2010-08-03 13:07 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Rustom Mody @ 2010-08-03 11:49 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 222 bytes --]

> 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

[-- Attachment #1.2: Type: text/html, Size: 274 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [babel] Error Before first headline.
  2010-08-03 11:49 [babel] Error Before first headline Rustom Mody
@ 2010-08-03 13:07 ` Eric Schulte
  2010-08-03 17:09   ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2010-08-03 13:07 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-orgmode

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 <rustompmody@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [babel] Error Before first headline.
  2010-08-03 13:07 ` Eric Schulte
@ 2010-08-03 17:09   ` Eric Schulte
  2010-08-03 22:00     ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2010-08-03 17:09 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-orgmode

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.eric@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 <rustompmody@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [babel] Error Before first headline.
  2010-08-03 17:09   ` Eric Schulte
@ 2010-08-03 22:00     ` Eric Schulte
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2010-08-03 22:00 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Rustom Mody, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ob-tangle-don-t-throw-errors-when-we-re-not-under-of.patch --]
[-- Type: text/x-diff, Size: 1070 bytes --]

From a8ff1b0319bb536eca123b77ec1e5b3f702c2ff5 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@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


[-- Attachment #3: Type: text/plain, Size: 1221 bytes --]


"Eric Schulte" <schulte.eric@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.eric@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 <rustompmody@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

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-03 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03 11:49 [babel] Error Before first headline Rustom Mody
2010-08-03 13:07 ` Eric Schulte
2010-08-03 17:09   ` Eric Schulte
2010-08-03 22:00     ` Eric Schulte

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).