From mboxrd@z Thu Jan 1 00:00:00 1970 From: shripad sinari Subject: Re: Fwd: request regarding code chunk options in org-babel. Date: Thu, 14 Mar 2013 13:04:46 -0700 Message-ID: References: <87txofcp7c.fsf@gmail.com> <87k3p9da91.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec54d3f84c68d3a04d7e808dd Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGEOT-0004PW-Qq for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 16:04:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGEON-00083p-G6 for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 16:04:53 -0400 Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:59405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGEON-00083l-8t for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 16:04:47 -0400 Received: by mail-ob0-f171.google.com with SMTP id x4so2550471obh.16 for ; Thu, 14 Mar 2013 13:04:46 -0700 (PDT) In-Reply-To: <87k3p9da91.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --bcaec54d3f84c68d3a04d7e808dd Content-Type: text/plain; charset=ISO-8859-1 Thanks Eric! Shripad Tucson, AZ On Thu, Mar 14, 2013 at 12:57 PM, Eric Schulte wrote: > shripad sinari writes: > > > Hello Eric, > > The posted solution works. But the issue is that I have to do this a lot > of > > times for selective code chunks in multiple documents. Writing the sexp > > each time is not very elegant. > > As the sexp is just elisp you can easily to add a function to your > .emacs configuration which makes this process easier. For example. > > ;; -*- emacs-lisp -*- > (defun exp-only () (if org-current-export-file "replace" "silent")) > > allowing you to then do the following in your Org-mode files > > > #+begin_src sh :results (exp-only) :exports results > echo "I want to see this in HTML/PDF, but not in Org" > #+end_src > > > Besides, if I were to come up with some solution than I did not want > > it to break anything else. > > The above solution will not break anything else. > > > Perhaps my question is still ambiguous and the right question should > > be does value of ":results" plist overrride the one from ":exports", > > i.e., is there any precedence order to the chunk options that is > > implicit, that i have not yet grasped from the documentation? > > > > I don't believe "override" is the right term here, they are orthogonal. > So, ":exports results" does mean that the results will be exported, if > those results are "silent" then while they are run during export, there > nothing is added to the exported document. > > > > > Thanks for your patience and help. > > I hope this does help. One goal of Org-mode's code block support is to > provide as much functionality as possible from a core which is as > composed of a small number of orthogonal working pieces. This maximizes > flexibility and utility with a minimum of maintenance and implementation > overhead. > > Cheers, > > > > > Regards, Shripad. > > > > Shripad > > Tucson, AZ > > > > > > On Wed, Mar 13, 2013 at 8:08 AM, Eric Schulte >wrote: > > > >> shripad sinari writes: > >> > >> > Hello all, > >> > I have been using org-mode and particularly org-babel for > reproducible > >> > research. From reading most of the code chunk options in the org > manual > >> > it seems that the follwoing table would be how one would expect > output > >> > in various formats to behave: > >> > > >> > | :results value | :exports value | In Buffer | In PDF | Evaluation | > >> > |----------------+----------------+-----------+--------+------------| > >> > | silent | results | no | yes | yes | > >> > | replace/other | none | yes | no | yes | > >> > | silent | none | no | no | yes | > >> > > >> > >> Perhaps the documentation should be changed to more clearly express that > >> adding ":results silent" will inhibit insertion of results in the buffer > >> even during export. > >> > >> > > >> > However from this thread: > >> > http://comments.gmane.org/gmane.emacs.orgmode/46625 > >> > >> Is there a reason that the solution posted in that thread does not work > >> for you? > >> > >> Best, > >> > >> > > >> > it appears that this is not the case. Is there a way, to get this > >> > table to be valid out of the box? This might be useful. > >> > > >> > Please let me know. > >> > Thanks and regards, > >> > > >> > Shripad > >> > Tucson, AZ > >> > >> -- > >> Eric Schulte > >> http://cs.unm.edu/~eschulte > >> > > -- > Eric Schulte > http://cs.unm.edu/~eschulte > --bcaec54d3f84c68d3a04d7e808dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Eric!


Shripad
Tucson, AZ
<= /div>


On Thu, Mar 14, 2013 at 12:57 PM, Eric S= chulte <schulte.eric@gmail.com> wrote:
shripad sinari <shripad.sinari@gmail.com> writes:

> Hello Eric,
> The posted solution works. But the issue is that I have to do this a l= ot of
> times for selective code chunks in multiple documents. Writing the sex= p
> each time is not very elegant.

As the sexp is just elisp you can easily to add a function to your .emacs configuration which makes this process easier. =A0For example.

=A0 =A0 =A0;; -*- emacs-lisp -*-
=A0 =A0 =A0(defun exp-only () (if org-current-export-file "replace&quo= t; "silent"))

allowing you to then do the following in your Org-mode files


=A0 =A0 =A0#+begin_src sh :results (exp-only) :exports results
=A0 =A0 =A0 =A0echo =A0"I want to see this in HTML/PDF, but not in Org= "
=A0 =A0 =A0#+end_src

> Besides, if I were to come up with some solution than I did not want > it to break anything else.

The above solution will not break anything else.

> Perhaps my question is still ambiguous and the right question should > be does value of ":results" plist overrride the one from &qu= ot;:exports",
> i.e., is there any precedence order to the chunk options that is
> implicit, that i have not yet grasped from the documentation?
>

I don't believe "override" is the right term here, they= are orthogonal.
So, ":exports results" does mean that the results will be exporte= d, if
those results are "silent" then while they are run during export,= there
nothing is added to the exported document.

>
> Thanks for your patience and help.

I hope this does help. =A0One goal of Org-mode's code block suppo= rt is to
provide as much functionality as possible from a core which is as
composed of a small number of orthogonal working pieces. =A0This maximizes<= br> flexibility and utility with a minimum of maintenance and implementation overhead.

Cheers,

>
> Regards, Shripad.
>
> Shripad
> Tucson, AZ
>
>
> On Wed, Mar 13, 2013 at 8:08 AM, Eric Schulte <schulte.eric@gmail.com>wrote:
>
>> shripad sinari <shr= ipad.sinari@gmail.com> writes:
>>
>> > Hello all,
>> > =A0I have been using org-mode and particularly org-babel for = reproducible
>> > research. From reading most of the code chunk options in the = org manual
>> > =A0it seems that the follwoing table would be how one would e= xpect output
>> > in various formats to behave:
>> >
>> > | :results value | :exports value | In Buffer | In PDF | Eval= uation |
>> > |----------------+----------------+-----------+--------+-----= -------|
>> > | silent =A0 =A0 =A0 =A0 | results =A0 =A0 =A0 =A0| no =A0 = =A0 =A0 =A0| yes =A0 =A0| yes =A0 =A0 =A0 =A0|
>> > | replace/other =A0| none =A0 =A0 =A0 =A0 =A0 | yes =A0 =A0 = =A0 | no =A0 =A0 | yes =A0 =A0 =A0 =A0|
>> > | silent =A0 =A0 =A0 =A0 | none =A0 =A0 =A0 =A0 =A0 | no =A0 = =A0 =A0 =A0| no =A0 =A0 | yes =A0 =A0 =A0 =A0|
>> >
>>
>> Perhaps the documentation should be changed to more clearly expres= s that
>> adding ":results silent" will inhibit insertion of resul= ts in the buffer
>> even during export.
>>
>> >
>> > However from this thread:
>> > http://comments.gmane.org/gmane.emacs.orgmode/46625
>>
>> Is there a reason that the solution posted in that thread does not= work
>> for you?
>>
>> Best,
>>
>> >
>> > =A0it appears that this is not the case. Is there a way, to g= et this
>> > table to be valid out of the box? This might be useful.
>> >
>> > Please let me know.
>> > Thanks and regards,
>> >
>> > Shripad
>> > Tucson, AZ
>>
>> --
>> Eric Schulte
>>
http://c= s.unm.edu/~eschulte
>>

--
Eric Schulte
http://cs.unm.edu= /~eschulte

--bcaec54d3f84c68d3a04d7e808dd--