emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Purpose of :results raw
@ 2013-04-19 22:11 Sebastien Vauban
  2013-04-19 22:27 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2013-04-19 22:11 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Now that ":results drawer" has been introduced, I wonder why we still have
":results raw".

As once stated in this ML:

     The sole purpose of raw results is to allow inserting an headline (I mean
     a real headline, not comma protected) in the buffer, because headlines
     cannot be contained in anything else than headlines.

But drawer does the same. And drawer results can be replaced upon re-execution
(unlike raw).

So, is there still a use case for raw?

Best regards,
  Seb

PS- I could imagine that there would be a real use case if, for example, raw
did not allow "cycling" on the (tabular) results, while drawer would. But it's
not the case.

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] Purpose of :results raw
  2013-04-19 22:11 [babel] Purpose of :results raw Sebastien Vauban
@ 2013-04-19 22:27 ` Nicolas Goaziou
  2013-04-20  7:14   ` Sebastien Vauban
  2013-04-20 21:34   ` John Hendy
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2013-04-19 22:27 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Now that ":results drawer" has been introduced, I wonder why we still have
> ":results raw".
>
> As once stated in this ML:
>
>      The sole purpose of raw results is to allow inserting an headline (I mean
>      a real headline, not comma protected) in the buffer, because headlines
>      cannot be contained in anything else than headlines.
>
> But drawer does the same. 

What makes you think drawers do the same? Drawers cannot contain
headlines.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] Purpose of :results raw
  2013-04-19 22:27 ` Nicolas Goaziou
@ 2013-04-20  7:14   ` Sebastien Vauban
  2013-04-20 11:52     ` Nicolas Goaziou
  2013-04-20 21:34   ` John Hendy
  1 sibling, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2013-04-20  7:14 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Nicolas,

Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>
>> Now that ":results drawer" has been introduced, I wonder why we still have
>> ":results raw".
>>
>> As once stated in this ML:
>>
>>      The sole purpose of raw results is to allow inserting an headline (I
>>      mean a real headline, not comma protected) in the buffer, because
>>      headlines cannot be contained in anything else than headlines.
>>
>> But drawer does the same.
>
> What makes you think drawers do the same?

The fact that the following output a normally behaving headline[1], AFAICS.

--8<---------------cut here---------------start------------->8---
#+begin_src sh :results drawer :exports both
echo "* Unescaped headline"
#+end_src

#+results:
:RESULTS:
* Unescaped headline
:END:
--8<---------------cut here---------------end--------------->8---

Though, effectively, when exported, it's not right:

--8<---------------cut here---------------start------------->8---
\lstset{language=sh,numbers=none}
\begin{lstlisting}
  echo "* Unescaped headline"
\end{lstlisting}

:RESULTS:

\section*{Unescaped headline}
\label{sec-7}
:END:
--8<---------------cut here---------------end--------------->8---

as ":RESULTS:" and ":END:" words aren't removed from the export.

> Drawers cannot contain headlines.

Do you mean it, because of the wrong export?  By wrong, I don't mean "buggy",
but "not foreseen as I (= me) thought".

Best regards,
  Seb

[1] Correct face used in the Org buffer, correct folding when TAB'ing, etc.

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] Purpose of :results raw
  2013-04-20  7:14   ` Sebastien Vauban
@ 2013-04-20 11:52     ` Nicolas Goaziou
       [not found]       ` <CAJcAo8uRp8xOk+_cZefMc8PBfMDywzARdkTyCR_FDuXCLjAnZA@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2013-04-20 11:52 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> The fact that the following output a normally behaving headline[1], AFAICS.
>
> #+begin_src sh :results drawer :exports both
> echo "* Unescaped headline"
> #+end_src
>
> #+results:
> :RESULTS:
> * Unescaped headline
> :END:
>
> Though, effectively, when exported, it's not right:

[...]

> Do you mean it, because of the wrong export?  By wrong, I don't mean "buggy",
> but "not foreseen as I (= me) thought".

Both cycling mechanism and fontification are bad indicators about the
syntax at point. Use either `org-element-at-point' or
`org-element-context' to know what is really parsed, according to the
Org syntax.

I will slowly integrate org-element-at-point in core interactive
functions, like visibility cycling. Though, fontification will have to
wait, because the parser isn't ready for that yet.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] Purpose of :results raw
  2013-04-19 22:27 ` Nicolas Goaziou
  2013-04-20  7:14   ` Sebastien Vauban
@ 2013-04-20 21:34   ` John Hendy
  1 sibling, 0 replies; 6+ messages in thread
From: John Hendy @ 2013-04-20 21:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: public-emacs-orgmode-mXXj517/zsQ, Sebastien Vauban



On Fri, Apr 19, 2013 at 5:27 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>
>
> Hello,
>
> "Sebastien Vauban"
> <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>
>> Now that ":results drawer" has been introduced, I wonder why we still have
>> ":results raw".
>>
>> As once stated in this ML:
>>
>>      The sole purpose of raw results is to allow inserting an headline (I mean
>>      a real headline, not comma protected) in the buffer, because headlines
>>      cannot be contained in anything else than headlines.
>>
>> But drawer does the same.
>
> What makes you think drawers do the same? Drawers cannot contain
> headlines.
>

But back to the original question, what does =:results raw=
accomplish? From my view, even if they *can* contain headlines, they
get exported twice, and re-running the code block just adds duplicate
output to whatever was already there. Consider this test file:

#+begin_src orgmode

* Heading

#+begin_src R :session r :results output raw :exports results

cat("* Heading2\n")
cat("This is some test text\n")

#+end_src

#+RESULTS:
* Heading2
This is some test text

#+begin_src R :session r :results output drawer :exports results

cat("* Heading3\n")
cat("This is some test text\n")

#+end_src

#+RESULTS:
:RESULTS:
* Heading3
This is some test text
:END:


* Heading 4

#+begin_src R :session r :results output drawer :exports results

cat("This is some test text\n")

#+end_src

#+RESULTS:
:RESULTS:
This is some test text
:END:

#+end_src

"** Heading2" gets exported twice, and the :RESULTS: and :END: drawer
property indicators are also being exported. Yes, I can delete the
=:results raw= output, but that's time consuming, especially as one
tweaks code and re-evaluates to check the results. One has to do this
every time not to flood the document with duplicate results.

See Eric Schulte's response here:
- http://lists.gnu.org/archive/html/emacs-orgmode/2012-08/msg01224.html

I was getting multiple instance with =:results output raw= and was
instructed to use =:results output org= for the very reason that it
would be able to discern the output and replace it upon subsequent
block evaluations.

Now consider this recent thread:
- http://www.mail-archive.com/emacs-orgmode@gnu.org/msg70016.html

The gist of that long discussion is that =:results output org= was
replaced by =:results output drawer=, but it seems we haven't
recreated all of the existing functionality. There's another thread
out there in which for a while it was to be =:results output wrap=
and/or =:wrap org= in order to do something like this (output actual
Org-mode syntax from a code block and have it exported as if it was
actually written in the document).

There are instances where I'd like to generate numerous plots and then
create subheadings for the various iterations of my loops, so having
the ability to actual print "** Subheading" to a results block and
have it exported would be useful. Seems that =:results raw= is now the
only way to do that, and export only works if you delete whatever
results are down there already prior to doing so.

Let me know if there's another/better way.


Thanks,
John

>
> Regards,
>
> --
> Nicolas Goaziou
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [babel] Purpose of :results raw
       [not found]       ` <CAJcAo8uRp8xOk+_cZefMc8PBfMDywzARdkTyCR_FDuXCLjAnZA@mail.gmail.com>
@ 2013-04-22  1:43         ` Samuel Wales
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Wales @ 2013-04-22  1:43 UTC (permalink / raw)
  To: emacs-orgmode

[headers were somehow set to other than the mailing list itself.
maybe a gmane bug?]

On 4/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> I will slowly integrate org-element-at-point in core interactive
> functions, like visibility cycling. Though, fontification will have to
> wait, because the parser isn't ready for that yet.

In the grand scheme, this might be a minor point, but:

While consistency is a good thing, I am nevertheless glad for that
last point.  I am concerned that incorporating the parser into
fontification will break inline footnotes that have more than one
paragraph (unless it is designed to be flexible enough to allow that).

To me, paragraphs naturally fit in inline footnotes, just as they do
in non-inline ones, but that is incompatible with the current parser,
which treats paragraphs as semantically larger units than inline
footnotes.

I appreciate your workaround for making them work again in export,
which works.  Fontification currently works perfectly also as it
always has; I just don't want that to stop working for those who, like
me, use inline footnotes similarly to non-inline ones, occasionally
with more than one paragraph.

This of course leaves us open to the accusation that nobody should be
so long-winded in a footnote as to have more than one paragraph (and
quotes and more, which currently work perfectly, <ahem>), but the same
would apply to non-inline footnotes also, and Org is in any case by
tradition highly flexible.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is NO hope without action.  This means YOU.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-22  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19 22:11 [babel] Purpose of :results raw Sebastien Vauban
2013-04-19 22:27 ` Nicolas Goaziou
2013-04-20  7:14   ` Sebastien Vauban
2013-04-20 11:52     ` Nicolas Goaziou
     [not found]       ` <CAJcAo8uRp8xOk+_cZefMc8PBfMDywzARdkTyCR_FDuXCLjAnZA@mail.gmail.com>
2013-04-22  1:43         ` Samuel Wales
2013-04-20 21:34   ` John Hendy

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).