emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Rasmus <rasmus@gmx.us>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [BUG] Noweb reference eval syntax does not work
Date: Thu, 12 May 2016 19:35:15 -0400	[thread overview]
Message-ID: <87mvnu97f0.fsf@gmail.com> (raw)
In-Reply-To: <87futs3dxi.fsf@gmx.us>

Hi Rasmus, hi all,

2016ko maiatzak 8an, Rasmus-ek idatzi zuen:

[...]

> As you mention, we’d loose the ability to chain together multiple blocks.
> I reckon they are meaningfully the same language, so I don’t see a loss.
> The example shown in the manual also does not convince me of the
> usefullness of this.

Ditto.

> 
>> It is redundant with #+NAME: keyword and slightly broken. Also it
>> induces hacks like `org-babel-use-quick-and-dirty-noweb-expansion' to
>> work-around its shortcomings. 
>> 
>> Besides, it doesn't make much sense to add the same parameters to
>> a bunch of blocks, so I find the syntax dubious.
>> 
>> I understand it can be a handy shortcut for inserting multiple blocks,
>> but, all in all, I tend to think it would be simpler to just remove the
>> feature, along with `:noweb-sep' and
>> `org-babel-use-quick-and-dirty-noweb-expansion'.
> 
> I’m happy to kill it off in Org-9.  I don’t know how widely the chaining
> of blocks is used, though, and whether the fix is always as simple as
> uniting the blocks.

I think that we can provide a replacement to noweb-ref as follows:

* Code blocks
:PROPERTIES:
:header-args: :noweb-ref foo
:END:

#+begin_src python
block 1
#+end_src

#+begin_src python
block 2
#+end_src

* Concat

The old way

#+begin_src python
<<foo>>
#+end_src

The new way:

#+begin_src python
<<concat-blocks-of-lang-in-headline("python","Code blocks")>>
#+end_src

concat-blocks-of-lang-in-headline would have to be an elisp source block
implementing the appropriate behavior which is present in the document
or in the library of babel.

(And I think it would be good if the LoB contained some useful
predefined blocks like this one, in addition to those added by the
user.  A “standard library of babel” as it were.)

> 
>> What do you, and others, think? Is NAME enough for noweb syntax, or is
>> there a real need fo :noweb-ref?

To put it another way: it seems to me that the functionality of
:noweb-ref can be reimplemented in terms of other primitives.  And given
Nicolas’s comments about the complications and bugs it introduces, I’d
be in favor of deprecating and eventually removing it.

-- 
Aaron Ecay

  parent reply	other threads:[~2016-05-13  0:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 21:39 [BUG] Noweb reference eval syntax does not work fm4d
2016-05-08  9:26 ` Nicolas Goaziou
2016-05-08 12:57   ` Rasmus
2016-05-08 16:32     ` Thomas S. Dye
2016-05-11 21:34       ` Nicolas Goaziou
2016-05-11 22:40         ` Samuel Wales
2016-05-11 23:19         ` Charles C. Berry
2016-05-12 23:35     ` Aaron Ecay [this message]
2016-05-15 22:40       ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2016-08-04 21:11 Karsten Schmidt
2016-08-05  2:25 ` Charles C. Berry

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=87mvnu97f0.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).