emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: evaluation context in call statements
Date: Wed, 26 Jun 2013 09:06:22 -0600	[thread overview]
Message-ID: <87k3lgewrv.fsf@gmail.com> (raw)
In-Reply-To: 87fvw5fkpt.fsf@Rainer.invalid

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

>> My vote is for adding #+name support to call lines, and then handling
>> their results in the same manner as code block results.

Achim Gratz <Stromeko@nexgo.de> writes:
> I'm not sure what this would entail other than replacing the call with
> its arguments with the name of the call in the results line.  But yes,
> that'd be a step forward, although you'd have to be careful when copying
> calls.
>

This could work exactly as named source blocks work.  E.g.,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: named-calls.org --]
[-- Type: text/x-org, Size: 432 bytes --]

Unnamed code block.

#+begin_src emacs-lisp
  'bar
#+end_src

#+RESULTS:
: bar

Named code block.

#+name: foo-block
#+begin_src emacs-lisp
  'foo
#+end_src

can have text between itself and its results

#+RESULTS: foo-block
: foo

Unnamed call line.

#+call: foo-block()

#+RESULTS: foo-block()
: foo

Named call line.

#+name: foo-call
#+call: foo-block()

Can have text between itself and its results.

#+RESULTS: foo-call
: foo

[-- Attachment #3: Type: text/plain, Size: 2311 bytes --]


Rick Frankel <rick@rickster.com> writes:
> It seems inconsistent to add #+name support to call lines but not the
> other block modifiers (#+header :var ..., etc). I think call lines are
> a special case, so would be ok with the new :target option.

See above.  This is not inconsistent, it is equivalent with how names
and code block already work, which means it is less for new users to
learn and old users to keep track of.  Also, the existing code block
results handling has not caused much confusion, and seems to be powerful
enough to deal with every use case.

Achim Gratz <Stromeko@nexgo.de> and Rick Frankel <rick@rickster.com> write:
>> My current suggestion is however to limit the results block search to
>> the same subtree and stop searching at later #+CALL and #+BEGIN_SRC
>> line.  We could make this conditional on a :[no]clobber argument to
>> keep compatibility with the current behaviour (clobbering the first
>> result would be the current and perhaps default behaviour).
>
> These search bounds make sense, but i think this should be the
> default behavior. I don't see the current behavior as making
> sense---at least to me.

I agree that the current behavior is confusing, but I don't like this
suggestion.  I expect people will be mystified when calls replace
results in the same subtree and don't replace blocks elsewhere in the
same Org-mode file.  No other parts of Org-mode's code block support
work this way.

> At the time (late 2012) I found Nicolases changes (named results
> blocks, attributes and captions on the results block and not the
> source, etc) confusing. I still find it odd that you need to evaluate
> a source block before you can e.g, add a caption or attributes to the
> results (previous behavior was that header arguments on the source
> block were used for the results in exporting.)
>

I think this behavior works well and I don't think it will change.  I
see how it could be nice to automatically apply attributes (e.g.,
captions, labels etc...) of a code block to that blocks results, but
then what if I want to export the code block body and not the results,
what if I want to export both.  I think Nicolas was right to unify,
simplify and clarify the Org-mode attribute semantics.

Thanks for the feedback.

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

  parent reply	other threads:[~2013-06-26 15:08 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 [this message]
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
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=87k3lgewrv.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /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).