From: Michael Brand <michael.ch.brand@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: evaluation context in call statements
Date: Wed, 26 Jun 2013 18:53:43 +0200 [thread overview]
Message-ID: <CALn3zoivLtiByMmLx_=bA_9vmo75jWY_sJQdamnD8J-h_hGZmw@mail.gmail.com> (raw)
In-Reply-To: <87ehboewrr.fsf@gmail.com>
Hi Eric
On Wed, Jun 26, 2013 at 4:54 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> http://thread.gmane.org/gmane.emacs.orgmode/72513/focus=73547
>
> They will overwrite eachother's results.
I do not understand. In order to avoid that they will overwrite
eachother's results I added `dummy_name="osx"' and `dummy_name="gnu"'
to the call arguments. What did you mean?
> We are currently discussing
> alternatives which would change this behavior.
My suggestions to this discussion have been two alternatives that
already work now and that I already used, see my use case
"unicode_normal_form_c" and my patch with the ERT in the other thread
mentioned above:
1) use :session where supported like for emacs-lisp source blocks
2) use ":var dummy_name" as a workaround where :session is not
supported like for shell source blocks
>> -------------------------------------------------------------------
>> #+NAME: i_am_curious_how_this_works
>> #+BEGIN_SRC emacs-lisp
>> (format "%s" org-babel-current-src-block-location)
>> #+END_SRC
>>
>> #+CALL: i_am_curious_how_this_works()
>>
>> #+RESULTS: i_am_curious_how_this_works()
>> : #<marker at 124 in tmp.org>
>> #+CALL: i_am_curious_how_this_works()
>>
>> (Here I expect to see the result "#<marker at 235 in tmp.org>".)
>> -------------------------------------------------------------------
>
> This works as expected. Depending on the call line executed, I get
> different points in the second results.
I am sorry, I wanted to say that I want to do something like
(note: not current behavior)
-------------------------------------------------------------------
#+NAME: i_am_curious_how_this_works
#+BEGIN_SRC emacs-lisp
(format "%s" org-babel-current-src-block-location)
#+END_SRC
#+CALL: i_am_curious_how_this_works()
#+RESULTS: i_am_curious_how_this_works()
: #<marker at 124 in tmp.org>
#+CALL: i_am_curious_how_this_works()
#+RESULTS: i_am_curious_how_this_works()
: #<marker at 236 in tmp.org>
-------------------------------------------------------------------
and would like the yet to be defined solution in discussion here to
make also this possible, together with the appropriate change if
necessary to the example given above.
Currently working alternative with the change to use ":session":
-------------------------------------------------------------------
#+NAME: i_am_curious_how_this_works
#+BEGIN_SRC emacs-lisp
(format "%s" org-babel-current-src-block-location)
#+END_SRC
#+CALL: i_am_curious_how_this_works[:session upper]()
#+RESULTS: i_am_curious_how_this_works[:session upper]()
: #<marker at 124 in tmp.org>
#+CALL: i_am_curious_how_this_works[:session lower]()
#+RESULTS: i_am_curious_how_this_works[:session lower]()
: #<marker at 267 in tmp.org>
-------------------------------------------------------------------
Currently working alternative with the change to use
":var dummy_name":
-------------------------------------------------------------------
#+NAME: i_am_curious_how_this_works
#+BEGIN_SRC emacs-lisp :var dummy_name=""
(format "%s" org-babel-current-src-block-location)
#+END_SRC
#+CALL: i_am_curious_how_this_works(dummy_name="upper")
#+RESULTS: i_am_curious_how_this_works(dummy_name="upper")
: #<marker at 143 in tmp.org>
#+CALL: i_am_curious_how_this_works(dummy_name="lower")
#+RESULTS: i_am_curious_how_this_works(dummy_name="lower")
: #<marker at 290 in tmp.org>
-------------------------------------------------------------------
> Currently if you want have separate results for call lines with the same
> variables you will need to use a dummy variable.
Ok, this answers one of my questions in the other thread and confirms
my expectation. Does it mean that my patch with the ERT as of
2013-06-19 from the other thread is ok for now and can be applied
just to reflect what is currently supported? Or should I change
something else in the patch?
Michael
next prev parent reply other threads:[~2013-06-26 16:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 17:34 evaluation context in call statements Rick Frankel
2013-06-25 19:21 ` Achim Gratz
2013-06-25 19:53 ` Achim Gratz
2013-06-25 20:06 ` Achim Gratz
2013-06-25 20:07 ` Michael Brand
2013-06-25 20:20 ` Achim Gratz
2013-06-25 20:55 ` Achim Gratz
2013-06-25 22:41 ` Eric Schulte
2013-06-26 6:29 ` Achim Gratz
2013-06-26 14:38 ` Rick Frankel
2013-06-26 15:13 ` Nicolas Goaziou
2013-06-26 15:29 ` Rick Frankel
2013-06-26 15:49 ` Eric Schulte
2013-06-26 15:06 ` Eric Schulte
2013-06-27 4:55 ` Achim Gratz
2013-06-27 6:22 ` Andreas Leha
2013-06-27 14:27 ` Achim Gratz
2013-06-27 23:12 ` Andreas Leha
2013-06-30 22:24 ` Eric Schulte
2013-07-01 10:23 ` Michael Brand
2013-07-01 13:11 ` Eric Schulte
2013-07-01 13:52 ` Michael Brand
2013-07-01 14:10 ` Eric Schulte
2013-06-26 8:38 ` Michael Brand
2013-06-26 14:54 ` Eric Schulte
2013-06-26 16:53 ` Michael Brand [this message]
2013-06-26 17:11 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALn3zoivLtiByMmLx_=bA_9vmo75jWY_sJQdamnD8J-h_hGZmw@mail.gmail.com' \
--to=michael.ch.brand@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=schulte.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).