emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Amy Grinn <grinn.amy@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: noweb-start and noweb-end header args
Date: Wed, 06 Mar 2024 18:07:10 -0500	[thread overview]
Message-ID: <s31ttljufhd.fsf@gmail.com> (raw)
In-Reply-To: <s31il1zwpu2.fsf@gmail.com> (Amy Grinn's message of "Wed, 06 Mar 2024 06:40:37 -0500")

Amy Grinn <grinn.amy@gmail.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Amy Grinn <grinn.amy@gmail.com> writes:
>>
>>> I would like to add support for setting 'org-babel-noweb-wrap-start and
>>> 'org-babel-noweb-wrap-end for each src block individually
>>
>> May you please explain the use case when changing the default values
>> is useful?
>
> Of course!  Changing the default values can be useful to prevent syntax
> highlighting errors in a specific language.  In the example I gave, <<<
> and >>> aren't recognized as the beginning of a heredoc in a shell
> script the way <<firewall-safe-mode>> would be.

To expand on this, some major modes can fundamentally conflict with the
default noweb syntax.  Here is a valid shell script *and* a valid noweb
reference to a block named EOF:

cat <<EOF>> file.txt
Hello
EOF

I hope this helps explain why the wrap-start and wrap-end options were
necessary to include more than a decade ago.  In terms of actually using
them, it's a bit cumbersome, especially in Org mode buffers that use
multiple languages.

The second diff I sent (under the termux handle, accidentally) is my
preferred solution (:noweb yes <<< >>>).  This would avoid the need for
new header arguments to be introduced while maintaining backwards
compatibility.  It also feels natural to specify the two options
together: I can't think of a good reason to only need to specify the
wrap-end option.


  parent reply	other threads:[~2024-03-06 23:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 19:22 noweb-start and noweb-end header args Amy Grinn
2024-03-05 22:41 ` termux
2024-03-06 11:21 ` Ihor Radchenko
2024-03-06 11:40   ` Amy Grinn
2024-03-06 11:47     ` Ihor Radchenko
2024-03-06 12:05       ` Amy Grinn
2024-03-06 13:33         ` Ihor Radchenko
2024-03-06 16:04           ` Amy Grinn
2024-03-07 13:50             ` Ihor Radchenko
2024-03-06 23:07     ` Amy Grinn [this message]
2024-03-07 13:58       ` Ihor Radchenko
2024-03-07 14:33         ` Amy Grinn
2024-03-07 14:49           ` Ihor Radchenko
2024-03-07 14:04 ` Ihor Radchenko
2024-03-07 15:06   ` Amy Grinn
2024-04-08 14:04   ` [FR] :noweb-wrap header arg Amy Grinn
2024-04-11 14:03     ` Ihor Radchenko
2024-04-11 18:46       ` Amy Grinn
2024-04-13 13:17         ` Ihor Radchenko

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=s31ttljufhd.fsf@gmail.com \
    --to=grinn.amy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).