emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Rustom Mody <rustompmody@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Re: [babel] Error Before first headline.
Date: Tue, 03 Aug 2010 16:00:08 -0600	[thread overview]
Message-ID: <87eiefpdav.fsf@gmail.com> (raw)
In-Reply-To: <87mxt3tyfu.fsf@gmail.com> (Eric Schulte's message of "Tue, 03 Aug 2010 11:09:34 -0600")

[-- 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

      reply	other threads:[~2010-08-03 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=87eiefpdav.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rustompmody@gmail.com \
    /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).