From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olle Palmius Subject: [babel] Error Before first headline. Date: Tue, 3 Aug 2010 13:02:05 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1872633740==" Return-path: Received: from [140.186.70.92] (port=39310 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgFJG-0005Hr-O2 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:05:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgFG3-0007wf-44 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:02:08 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:65083) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgFG3-0007wW-1v for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:02:07 -0400 Received: by vws16 with SMTP id 16so3405245vws.0 for ; Tue, 03 Aug 2010 04:02:06 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1872633740== Content-Type: multipart/alternative; boundary=0016367d5dee6497e1048ce93f51 --0016367d5dee6497e1048ce93f51 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi im trying to figure out how to generate sourcefiles from babel files and i keep getting the same error. I have tried a few different codeblocks from the documentation and the only thing that changes is the "position" number. I hope i have not missed something in the documentation. Code: #+BEGIN_SRC emacs-lisp (defun org-xor (a b) "Exclusive or." (if a (not b) b)) #+END_SRC Debug message: Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer test.org") signal(error ("Before first headline at position 1 in buffer test.org")) error("Before first headline at position %d in buffer %s" 1 #) byte-code("\300\301`p#\207" [error "Before first headline at position %d in buffer %s"] 4) org-back-to-heading(t) org-heading-components() byte-code("\306\307 !\210p=10eb\210\310 \311\312#\203\370 --0016367d5dee6497e1048ce93f51 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi im trying to figure out how to generate sourcefiles from babel
files = and i keep getting the same error.
I have tried a few different codebloc= ks from the documentation
and the only thing that changes is the "= position" number.
I hope i have not missed something in the documentation.


Code:<= br>
#+BEGIN_SRC emacs-lisp=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
(defu= n org-xor (a b)
=A0"Exclusive or."
(if a (not b) b))
#+E= ND_SRC
=A0

Debug message:

Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer test.org")
= =A0 signal(error ("Before first headline at position 1 in buffer
<= a href=3D"http://test.org">test.org"))
=A0 error("Before first headline at position %d in buffer %s" 1 <= br>#<buffer test.org>)
=A0 byte-co= de("\300\301`p#\207" [error "Before first headline at
po= sition %d in buffer %s"] 4)
=A0 org-back-to-heading(t)
=A0 org-heading-components()
=A0 byte-code= ("\306\307 !\210p=10eb\210\310 \311\312#\203\370
--0016367d5dee6497e1048ce93f51-- --===============1872633740== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1872633740==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rustom Mody Subject: Re: [babel] Error Before first headline. Date: Tue, 3 Aug 2010 17:19:32 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0266769080==" Return-path: Received: from [140.186.70.92] (port=44638 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgFzy-0000PM-Rn for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:49:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgFzx-0008Oq-Gl for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:49:34 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:59927) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgFzx-0008Oi-E9 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 07:49:33 -0400 Received: by iwn2 with SMTP id 2so6356736iwn.0 for ; Tue, 03 Aug 2010 04:49:32 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --===============0266769080== Content-Type: multipart/alternative; boundary=001485ea883a0f6aa2048ce9e982 --001485ea883a0f6aa2048ce9e982 Content-Type: text/plain; charset=ISO-8859-1 > 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 --001485ea883a0f6aa2048ce9e982 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > Hi im trying to figure out how to generate sourcefiles from babel file= s and i keep getting the same error.

Tried putting a 'first head= line' as it wants?
ie
* Dummy header
#+BEGIN_SRC emacs-lisp=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
(defun org-xor (a b)
etc
--001485ea883a0f6aa2048ce9e982-- --===============0266769080== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0266769080==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [babel] Error Before first headline. Date: Tue, 03 Aug 2010 07:07:22 -0600 Message-ID: <87d3tzydwh.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=48323 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgINy-0003xw-G7 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 10:22:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgINx-0000Ef-F4 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 10:22:30 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:46762) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgINx-0000EY-CQ for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 10:22:29 -0400 Received: by gyb11 with SMTP id 11so2194321gyb.0 for ; Tue, 03 Aug 2010 07:22:28 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [babel] Error Before first headline. Date: Tue, 03 Aug 2010 11:09:34 -0600 Message-ID: <87mxt3tyfu.fsf@gmail.com> References: <87d3tzydwh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=51003 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgL3K-0003aF-CN for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:13:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgL08-0004RK-QM for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:10:13 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:41519) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgL08-0004R5-OB for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:10:04 -0400 Received: by yxs7 with SMTP id 7so2268117yxs.0 for ; Tue, 03 Aug 2010 10:10:04 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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" 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [babel] Error Before first headline. Date: Tue, 03 Aug 2010 16:00:08 -0600 Message-ID: <87eiefpdav.fsf@gmail.com> References: <87d3tzydwh.fsf@gmail.com> <87mxt3tyfu.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=56944 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgPWx-0006XF-TO for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 18:00:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgPWv-0005BV-P3 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 18:00:15 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:52374) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgPWv-0005BR-JV for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 18:00:13 -0400 Received: by pxi7 with SMTP id 7so4062331pxi.0 for ; Tue, 03 Aug 2010 15:00:12 -0700 (PDT) In-Reply-To: <87mxt3tyfu.fsf@gmail.com> (Eric Schulte's message of "Tue, 03 Aug 2010 11:09:34 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Rustom Mody , emacs-orgmode --=-=-= 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ob-tangle-don-t-throw-errors-when-we-re-not-under-of.patch >From a8ff1b0319bb536eca123b77ec1e5b3f702c2ff5 Mon Sep 17 00:00:00 2001 From: Eric Schulte 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" 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" 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 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--