Re: [Orgmode] [PATCH] comments exporting

2010-06-15 Thread Nicolas Goaziou
Hello,
 Eric Schulte writes:

 Not to look a gift patch in the mouth, but while this patch fixes the
 above issue it looks like it introduces a new problem.

If you want a quick hack, just remove the space I introduced in the
comment regexp. But, imho, it isn't a real solution as #+source is
definitely not a comment and should not be caught by the regexp
comments.

I don't know yet what org-babel is really doing with the #+source
and #+results lines, but if they are no longer needed for exportation,
there should be a function to clean them before exporting.

In addition, there is another problem. In the example below, the
second item actually starts a brand new list upon exporting.

--8---cut here---start-8---
** comments not commented
# $some stuff
# some more stuff$ -- I should be a comment line

 1) a source block inside of an =enumerate=
#+source: plotxy
#+begin_src emacs-lisp :exports results
  (message I think so)
#+end_src

can cause problems

 2) another line

--8---cut here---end---8---

If I had to take a guess, I'd say that org-babel messes with
indentation and org-latex, being very sensitive about indentation when
it comes to lists, gets disoriented.

So, is the result replacing the source code in the same
column as the #+begin_src ?

So I think something has to be fixed in org-babel.

I will look at it tomorrow,

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


Re: [Orgmode] [PATCH] comments exporting

2010-06-15 Thread Eric Schulte
Hi Nicolas,

Thanks for the thoughtful response.

Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,
 Eric Schulte writes:

 Not to look a gift patch in the mouth, but while this patch fixes the
 above issue it looks like it introduces a new problem.

 If you want a quick hack, just remove the space I introduced in the
 comment regexp. But, imho, it isn't a real solution as #+source is
 definitely not a comment and should not be caught by the regexp
 comments.


yes, I suppose so.  When our #+source and #+results statements always
started on column zero they were being cleaned up later in the export
cycle so this wasn't a problem.


 I don't know yet what org-babel is really doing with the #+source
 and #+results lines, but if they are no longer needed for exportation,
 there should be a function to clean them before exporting.


Agreed, I'll take a look at this org-babel pre-processing later today
and add in functionality to clean up #+source: and #+results: lines.


 In addition, there is another problem. In the example below, the
 second item actually starts a brand new list upon exporting.


This problem I can't reproduce.


 ** comments not commented
 # $some stuff
 # some more stuff$ -- I should be a comment line

  1) a source block inside of an =enumerate=
 #+source: plotxy
 #+begin_src emacs-lisp :exports results
   (message I think so)
 #+end_src

 can cause problems

  2) another line


after Org-babel pre-processing the above is converted to the following
for me

--8---cut here---start-8---
# $some stuff
# some more stuff$ -- I should be a comment line

1) a source block inside of an =enumerate=
   #+source: plotxy


   #+results: plotxy
   : I think so
   can cause problems

2) another line
--8---cut here---end---8---

which exports to latex as expected.

Hopefully after I've made the above changes this list interruption will
cease, if not then I'll need to find an example I can reproduce.



 If I had to take a guess, I'd say that org-babel messes with
 indentation and org-latex, being very sensitive about indentation when
 it comes to lists, gets disoriented.

 So, is the result replacing the source code in the same
 column as the #+begin_src ?


yup, it's the same column, the only possible culprit I can see is two
empty lines (notice those are not indented but are truly empty) between
the #+source and #+results lines.


 So I think something has to be fixed in org-babel.

 I will look at it tomorrow,

 Regards,

Thanks, as always, for your help -- Eric

___
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


Re: [Orgmode] [PATCH] comments exporting

2010-06-15 Thread Nicolas Goaziou
Hi,
 Eric Schulte writes:

 This problem I can't reproduce.

My bad. I wasn't on git head. There is no such problem anymore. After
you've made your changes, all should be set, hopefully.

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


[Orgmode] [PATCH] comments exporting

2010-06-14 Thread Nicolas Goaziou
 Eric Schulte writes:

 A potentially related issue,
 The following org-mode snippet doesn't export correctly to latex,
 presumably because of protection issues similar to those addressed in
 your patch.  Any ideas?

 --8---cut here---start-8---
 ** comments not commented

 # $some stuff
 # some more stuff$ -- I should be a comment line
 --8---cut here---end---8---

Yes.

Actually, the latex stuff is processed before taking care of comments
(one of the last actions in every exporter). So the $...$ snippet is
matched by org-latex and protected.

This patch removes protection check from comment deletion : something
in comment must not be exported anyway. I don't see any corner case
right now.

 This patch looks great.  Since it's 10 lines long, I must ask if you've
 signed the FSF papers for contributions to Emacs?  If not is that
 something you're willing to do?

I have sent the signed papers last Wednesday (I had to since my patch
for org-babel-asymptote). I'm now waiting for their mail.

Regards,

--
Nicolas



0001-Fix-comments-export-in-latex.patch
Description: Binary data
___
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


Re: [Orgmode] [PATCH] comments exporting

2010-06-14 Thread Eric Schulte
Hi Nicolas,

Nicolas Goaziou n.goaz...@gmail.com writes:

 Eric Schulte writes:

 A potentially related issue,
 The following org-mode snippet doesn't export correctly to latex,
 presumably because of protection issues similar to those addressed in
 your patch.  Any ideas?

 --8---cut here---start-8---
 ** comments not commented

 # $some stuff
 # some more stuff$ -- I should be a comment line
 --8---cut here---end---8---

 Yes.

 Actually, the latex stuff is processed before taking care of comments
 (one of the last actions in every exporter). So the $...$ snippet is
 matched by org-latex and protected.

 This patch removes protection check from comment deletion : something
 in comment must not be exported anyway. I don't see any corner case
 right now.


Great.  Thanks for the continuous flow of useful patches.

Not to look a gift patch in the mouth, but while this patch fixes the
above issue it looks like it introduces a new problem.

Before the patch the following

--8---cut here---start-8---
** comments not commented

# $some stuff
# some more stuff$ -- I should be a comment line

1) a source block inside of an =enumerate=
   #+source: plotxy
   #+begin_src emacs-lisp :exports results
 (message I think so)
   #+end_src

   can cause problems
--8---cut here---end---8---

exports to

--8---cut here---start-8---
\section{comments not commented}
\label{sec-1}


# some more stuff$ -- I should be a comment line

\begin{enumerate}
\item a source block inside of an \texttt{enumerate}


\begin{verbatim}
I think so
\end{verbatim}

   can cause problems
\end{enumerate}
--8---cut here---end---8---

while after the patch it exports to

--8---cut here---start-8---
\section{comments not commented}
\label{sec-1}



\begin{enumerate}
\item a source block inside of an \texttt{enumerate}
   \#+source: plotxy


   \#+results: plotxy
\begin{verbatim}
I think so
\end{verbatim}

   can cause problems
\end{enumerate}
--8---cut here---end---8---

which is wrong in a different way.


 This patch looks great.  Since it's 10 lines long, I must ask if you've
 signed the FSF papers for contributions to Emacs?  If not is that
 something you're willing to do?

 I have sent the signed papers last Wednesday (I had to since my patch
 for org-babel-asymptote). I'm now waiting for their mail.


Oh, how forgetful of me, there's a todo in my agenda with your name on
it about checking up on the status of the FSF papers.

Thanks! -- Eric


 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