emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: sjLambda@gmail.com, emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] noweb documentation update
Date: Thu, 22 Jun 2017 09:05:27 +0200	[thread overview]
Message-ID: <87fues8pu0.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAFyQvY2G_ohDeoFbQkkO8R9ubN+xC=3hA781_=t7ngxa=NQ4ag@mail.gmail.com> (Kaushal Modi's message of "Wed, 21 Jun 2017 16:57:31 +0000")

Hello,

Kaushal Modi <kaushal.modi@gmail.com> writes:

> I have attached a patch (rebased off maint) that attempts at clarifying how
> certain aspects of noweb work based on my experience, with few complete
> examples.

Thank you. Some comments follow.

> Note: I had to also revert a little bit of wording change that was made
> recently. I found pre-wording-change version easier to understand. Copying
> Lambda Coder to comment on that.
>
> This is what the current patch has in the "Noweb reference syntax section":
>
> =====
> It is possible to include the @emph{results} of a code block rather than the
> body.  This is done by appending parentheses to the code block name which
> may
> optionally contain arguments to the code block as shown below.
> =====
>
> Earlier it was:
>
> =====
> Org can handle naming of @emph{results} block, rather than the body of the
> @samp{src} code block, using ``noweb'' style references.
>
> For ``noweb'' style reference, append parenthesis to the code block name for
> arguments, as shown in this example:
> =====

I agree the latter is less clear. However, I suggest less convoluted
wording:

    Org can include the @emph{results} of a code block rather than its
    body.  To that effect, append parentheses, possibly including
    arguments, to the code block name, as show below.


> -   :PROPERTIES:
> -   :header-args: :noweb-ref fullest-disk
> -   :END:
> + :PROPERTIES:
> + :header-args: :noweb-ref fullest-disk
> + :END:

I don't think the change above is meaningful here. Anyway it should be
consistent with other examples across the manual.

>   ** query all mounted disks
>   #+BEGIN_SRC sh
> @@ -16756,25 +16769,49 @@ references in the @samp{src} code block before evaluation.
>  For the header argument @code{:noweb no}, Org does not expand ``noweb'' style
>  references in the @samp{src} code block before evaluation.
>  
> -The default is @code{:noweb no}.
> +The default is @code{:noweb no}.  Org defaults to @code{:noweb no} so as not
> +to cause errors in languages such as @samp{Ruby} where ``noweb'' syntax is
> +equally valid characters.  For example, @code{<<arg>>}.  Change Org's default
> +to @code{:noweb yes} for languages where there is no risk of confusion.

What about

    The default is @code{:noweb no}.  Org defaults to @code{:noweb no} so
    as not to cause errors in languages where ``noweb'' syntax is
    ambiguous.  For example, @samp{Ruby} language interprets
    @samp{<<arg>>} differently.  Change Org's default to @code{:noweb
    yes} for languages where there is no risk of confusion.

Note that I don't know what <<arg>> means in Ruby.

> -Org can handle naming of @emph{results} block, rather than the body of the
> -@samp{src} code block, using ``noweb'' style references.
> -
> -For ``noweb'' style reference, append parenthesis to the code block name for
> -arguments, as shown in this example:
> +It is possible to include the @emph{results} of a code block rather than the
> +body.  This is done by appending parentheses to the code block name which may
> +optionally contain arguments to the code block as shown below.

See above.

> +Notice the difference in how they get exported:
> +@example
> +In Python 3, with "str='foo'", "print(str)" would print:
> +
> +    foo
> +
> +@end example

Would it be better to split it into two distinct examples?

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2017-06-22  7:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19  4:57 How to use noweb reference with argument in other languages? numbchild
2017-06-19 10:21 ` Kaushal Modi
2017-06-19 23:40   ` numbchild
2017-06-20 16:57     ` Kaushal Modi
2017-06-21  2:03       ` numbchild
2017-06-21 16:57         ` [PATCH] noweb documentation update (Was: Re: How to use noweb reference with argument..) Kaushal Modi
2017-06-22  7:05           ` Nicolas Goaziou [this message]
2017-06-22 19:01             ` [PATCH] noweb documentation update Kaushal Modi
2017-06-22 19:13               ` Kaushal Modi
2017-06-22 19:58                 ` Nicolas Goaziou
2017-06-22 20:10                   ` Kaushal Modi
2017-06-23  5:56                     ` Nicolas Goaziou
2017-06-23 10:14                       ` Kaushal Modi

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=87fues8pu0.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=sjLambda@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).