Org-mode mailing list
 help / color / mirror / Atom feed
From: Tom Gillespie <tgbugs@gmail.com>
To: Timothy <tecosaur@gmail.com>
Cc: sebastien.miquel@posteo.eu, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [Feature request] String escaped noweb expansion
Date: Sun, 2 May 2021 11:34:22 -0700
Message-ID: <CA+G3_PO6OSLRgo2QkfCh9LGAf9u2i0bURTGuLQrA0XdWVx73UA@mail.gmail.com> (raw)
In-Reply-To: <87fsz59fuk.fsf@gmail.com>

Hi Sebastien,
    I have encountered issues with this before when trying to noweb code
into a string that was code to be sent via ssh. I ended up switching
to use typeset -f in bash in most cases now, but that is not possible
for other languages. Some languages also have enough different types
of syntax for strings that they can work around such cases, but again,
not all do.

One potential issue with this suggestion is how it would interact with
multi-line blocks, because you can't have anything on the same
starting line as the noweb expressions since it will be repeated in
front of every subsequent line.

This would also require each org-babel lang implementation to provide
a method for correctly string-escaping the nowebbed values (in some
cases e.g. shell this is decidedly non-trivial).

With all of these things in mind, I would thus suggest not trying to
overload the noweb operator for this purpose. Having a string escaped
equivalent would be nice, but because it requires more than just a
simple copy/paste into the buffer, it seems like it probably needs
separate notation. Best,
Tom


      parent reply	other threads:[~2021-05-02 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 16:24 Sébastien Miquel
2021-05-02 17:59 ` Timothy
2021-05-02 18:16   ` Sébastien Miquel
2021-05-02 18:32     ` Timothy
2021-05-02 18:34   ` Tom Gillespie [this message]

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://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+G3_PO6OSLRgo2QkfCh9LGAf9u2i0bURTGuLQrA0XdWVx73UA@mail.gmail.com \
    --to=tgbugs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebastien.miquel@posteo.eu \
    --cc=tecosaur@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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git