From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BUG][Babel] Exporting text before heading Date: Fri, 16 Jul 2010 13:02:07 -0700 Message-ID: <87pqyngpq8.fsf@gmail.com> References: <87iq4ffrbq.wl%n.goaziou@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=54980 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZr70-0004e5-HQ for emacs-orgmode@gnu.org; Fri, 16 Jul 2010 16:02:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZr6y-0007hI-RR for emacs-orgmode@gnu.org; Fri, 16 Jul 2010 16:02:22 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:56145) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZr6y-0007h2-KH for emacs-orgmode@gnu.org; Fri, 16 Jul 2010 16:02:20 -0400 Received: by pxi7 with SMTP id 7so2377234pxi.0 for ; Fri, 16 Jul 2010 13:02:19 -0700 (PDT) In-Reply-To: <87iq4ffrbq.wl%n.goaziou@gmail.com> (Nicolas Goaziou's message of "Fri, 16 Jul 2010 16:12:57 +0200") 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: Nicolas Goaziou Cc: Org Mode List --=-=-= Hi Nicolas, I was able to export your example to html without any problems, however I did receive the same error you mentioned when exporting to LaTeX. The attached patch fixes the LaTeX export on my system, please give it a try and let me know if it works for you. I'm going to look into this a little bit more, as it seems that for LaTeX export the "#+begin_src org" block is being processed /twice/ by org-exp (probably due to the LaTeX exports mechanism for first exporting the header of a file and then exporting the body), which is not desirable and could be the root issue which this patch may just paper over. Cheers -- Eric --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=require-info-for-org-exp-block.patch diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index b500e55..565c75f 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -97,13 +97,15 @@ none ----- do not display either code or results upon export" (goto-char (match-beginning 0)) (let* ((info (org-babel-get-src-block-info)) (params (nth 2 info))) - ;; expand noweb references in the original file - (setf (nth 1 info) - (if (and (cdr (assoc :noweb params)) - (string= "yes" (cdr (assoc :noweb params)))) - (org-babel-expand-noweb-references - info (get-file-buffer org-current-export-file)) - (nth 1 info))) + ;; bail if we couldn't get any info from the block + (when info + ;; expand noweb references in the original file + (setf (nth 1 info) + (if (and (cdr (assoc :noweb params)) + (string= "yes" (cdr (assoc :noweb params)))) + (org-babel-expand-noweb-references + info (get-file-buffer org-current-export-file)) + (nth 1 info)))) (org-babel-exp-do-export info 'block)))) (defun org-babel-exp-inline-src-blocks (start end) --=-=-= Nicolas Goaziou writes: > Hello, > > I can't export the following file, would it be to latex or html. > > ----- > #+TITLE: Title > > - First element > > #+BEGIN_SRC org > ,- one > ,- two > #+END_SRC > > 1. sub-item > > #+BEGIN_EXAMPLE > Line 1 > Line 2 > #+END_EXAMPLE > > 2. another sub-item > > - Another element > ----- > > If I remove one of the blocks, I can export again to latex or html. > Same thing if I add an heading between the title and the first > element. > > If I only add plain text before the first element, or an heading after > the list, it won't work. > > I tried to bisect but it appears this org file had never been exported > successfully to html and stopped getting exported successfully to > latex since the following commit: > > ----- > commit d4781b9d88a6e85c0792e6e24de49834b19b4e57 > Author: Carsten Dominik > Date: Fri Jul 9 10:06:17 2010 +0200 > > Keep BABEL meta lines in tact > > * lisp/org-latex.el (org-export-latex-first-lines): Do not mark > meta lines for removal. Do not remove BABEL config lines during export > ----- > > Because of this, I tend to think it is babel related, even though > removing only the example block also solves the problem. > > Config is minimal, so all variables should be at default value, and > the last lines in *Message* buffer are : > > ----- > Exporting... > org-babel-exp processing... > setf: Wrong type argument: consp, nil > ----- > > Regards, > > -- Nicolas > > _______________________________________________ > 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 --=-=-=--