From mboxrd@z Thu Jan 1 00:00:00 1970 From: chris.m.malone@gmail.com Subject: Re: Re: Two questions about using a =#+begin_src emacs-lisp= block Date: Tue, 22 Feb 2011 18:23:24 +0000 Message-ID: References: <87d3mkc5br.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1763277824==" Return-path: Received: from [140.186.70.92] (port=55777 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrwtU-0004kS-3m for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 13:23:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrwtS-000724-GQ for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 13:23:27 -0500 Received: from mail-yw0-f71.google.com ([209.85.213.71]:35597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrwtS-00071x-8y for emacs-orgmode@gnu.org; Tue, 22 Feb 2011 13:23:26 -0500 Received: by ywo7 with SMTP id 7so2797978ywo.6 for ; Tue, 22 Feb 2011 10:23:25 -0800 (PST) In-Reply-To: <87d3mkc5br.fsf@gmail.com> 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 , Chris Malone Cc: emacs-orgmode --===============1763277824== Content-Type: multipart/alternative; boundary=bcaec53f398b724982049ce31301 --bcaec53f398b724982049ce31301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes On Feb 22, 2011 1:06pm, Eric Schulte wrote: > Chris Malone chris.m.malone@gmail.com> writes: > > Ok, this is still perplexing me, as I have a new version from git and I > > still get the error. The following is complete list (sorry for the long > > email!) of what I have done: > > > > * Get a fresh copy of =org-mode= from git and byte-compile: > > > > #+begin_src: sh > > cd ~/install/org-mode > > mkdir new_git_clone > > cd new_git_clone > > git clone git://orgmode.org/org-mode.git > > cd org-mode; make &> make.out > > ln -s ~/install/org-mode/new_git_clone/org-mode > ~/install/org-mode/current > > #+end_src > > > if you are worried that you don't have the correct version of Org-mode > installed you can check the output of the `org-version' function. Mine > reads > "Org-mode version 7.4 (release_7.4.510.g1e35)" RIght - I was worried that I had possibly changed a lisp file that could be causing the error, so I wanted a fresh copy. > > > > During the =make= process, I noticed quite a few warnings. An example is > > below (for a complete copy of =make.out=, see > > http://astro.sunysb.edu/cmalone/nolink/make.out > [...] > > Are such warnings normal? > > > yes, these are normal compiler warnings which are generally cleaned up > before releases but shouldn't have any negative impact on the behavior > of Org-mode Ok, good to know. > > > > * Make sure my =.emacs= file is pointing to the correct location > > Here is a copy of the =org-mode=-relevant sections of my =.emacs= file: > > > [...] > > > > * Attempt an export of the =org-mode= file found here: > > http://astro.sunysb.edu/cmalone/nolink/python_class_lstings.org > > > One thing to note here, is that for your emacs-lisp block to work on > export, you need to change this > #+begin_src emacs-lisp :exports both > (buffer-file-name) > #+end_src > to this > #+begin_src emacs-lisp :var file-name=(buffer-file-name) :exports both > file-name > #+end_src > because only header arguments are guaranteed to be evaluated in the > original org-mode buffer during export. Again, thanks for pointing this out earlier. I hadn't changed it for the example, because the error was not associated with whether or not the actual =emacs-lisp= code returned anything meaningful. > That said I was able to export your example file (without the change > above) to html. When exporting to latex I ran into an issue, the > problem here is that the LaTeX exporter *requires* at least one > headline. It explicitly export the pre-first-headline and > post-first-headline portions of the Org-mode buffer separately. When > there is no headline, and the buffer contains code blocks, then they are > exported *twice*, which causes the error you mentioned, because after > the first pass of the code-block export, the results in the file are not > valid for another pass of the exporter. > If you place a "* " before the "Let's start this..." line, then the > errors should disappear. > Hope this helps. > Best -- Eric That fixed it! Sorry for the trouble for something that seems so minor! Thanks again. Chris --bcaec53f398b724982049ce31301 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Feb 22, 2011 1:06pm, Eric Schulte <schulte.eric@gmail.com> wrote:<= br />> Chris Malone chris.m.malone@gmail.com> writes:
>
>
>
> > Ok, this is still perplexing me, as I have= a new version from git and I
>
> > still get the error= . =A0The following is complete list (sorry for the long
>
>= ; > email!) of what I have done:
>
> >
> > > * Get a fresh copy of =3Dorg-mode=3D from git and byte-compile= :
>
> >
>
> > #+begin_src: sh
= >
> > =A0 cd ~/install/org-mode
>
> > = =A0 mkdir new_git_clone
>
> > =A0 cd new_git_clone
>
> > =A0 git clone git://orgmode.org/org-mode.git
>= ;
> > =A0 cd org-mode; make &> make.out
>
>= > =A0 ln -s ~/install/org-mode/new_git_clone/org-mode ~/install/org-mod= e/current
>
> > #+end_src
>
> >
>
>
>
> if you are worried that you don'= ;t have the correct version of Org-mode
>
> installed you = can check the output of the `org-version' function. =A0Mine
> <= br />> reads
>
>
>
> "Org-mode v= ersion 7.4 (release_7.4.510.g1e35)"
>
>

R= Ight - I was worried that I had possibly changed a lisp file that could be = causing the error, so I wanted a fresh copy.
>
> >
>
> > During the =3Dmake=3D process, I noticed quite a few = warnings. =A0An example is
>
> > below (for a complete = copy of =3Dmake.out=3D, see
>
> > http://astro.sunysb.e= du/cmalone/nolink/make.out
>
> [...]
>
> = > Are such warnings normal?
>
> >
>
&g= t;
>
> yes, these are normal compiler warnings which are = generally cleaned up
>
> before releases but shouldn't= have any negative impact on the behavior
>
> of Org-mode<= br />>
>

Ok, good to know.

>
&g= t; >
>
> > * Make sure my =3D.emacs=3D file is point= ing to the correct location
>
> > Here is a copy of the= =3Dorg-mode=3D-relevant sections of my =3D.emacs=3D file:
>
= > >
>
> [...]
>
> >
> > > * Attempt an export of the =3Dorg-mode=3D file found here:>
> > http://astro.sunysb.edu/cmalone/nolink/python_class= _lstings.org
>
> >
>
>
>
> One thing to note here, is that for your emacs-lisp block to work on=
>
> export, you need to change this
>
> =
>
> #+begin_src emacs-lisp :exports both
>
= > =A0(buffer-file-name)
>
> #+end_src
>
= >
>
> to this
>
>
>
&g= t; #+begin_src emacs-lisp :var file-name=3D(buffer-file-name) :exports both=
>
> =A0file-name
>
> #+end_src
>= ;
>
>
> because only header arguments are guaran= teed to be evaluated in the
>
> original org-mode buffer d= uring export.
>
>

Again, thanks for pointing t= his out earlier. I hadn't changed it for the example, because the erro= r was not associated with whether or not the actual =3Demacs-lisp=3D code r= eturned anything meaningful.


>
> That said I w= as able to export your example file (without the change
>
>= ; above) to html. =A0When exporting to latex I ran into an issue, the
= >
> problem here is that the LaTeX exporter *requires* at least= one
>
> headline. =A0It explicitly export the pre-first-h= eadline and
>
> post-first-headline portions of the Org-mo= de buffer separately. =A0When
>
> there is no headline, an= d the buffer contains code blocks, then they are
>
> expor= ted *twice*, which causes the error you mentioned, because after
> =
> the first pass of the code-block export, the results in the file= are not
>
> valid for another pass of the exporter.
= >
>
>
> If you place a "* " before = the "Let's start this..." line, then the
>
>= errors should disappear.
>
>
>
> Hope t= his helps.
>
>
>
> Best -- Eric
>= ;
That fixed it! Sorry for the trouble for something that seems so m= inor! Thanks again.

Chris --bcaec53f398b724982049ce31301-- --===============1763277824== 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 --===============1763277824==--