emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Pontus Michael <m.pontus@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Proposal to replace the prefix repetition with whitespace during expansion of noweb references
Date: Sat, 29 Mar 2014 03:46:00 +0400	[thread overview]
Message-ID: <CAPpfmHKkpZEqFnPo8E0ow5Upb1rRR=UWRg43FcBJerTdOsqnJQ@mail.gmail.com> (raw)

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

I would like to propose a change to the behavior of noweb expansion in
relation to prefix handling. Current behavior intends to insert the text
preceding noweb reference before every successive line of referenced

For instance the expansion of following source block:

#+begin_src emacs-lisp :noweb yes
(concat <<foo>>)

In presence of this source block:

#+begin_src emacs-lisp :noweb-ref foo

Will result in code from next source block:

#+begin_src emacs-lisp
(concat "foo"
(concat "bar")

I recommend to introduce a change that will replace the inserted prefix
with whitespace of equal length. If it was the case then provided
example would produce the following code after expansion:

#+begin_src emacs-lisp
(concat "foo"

Here are the arguments in support of my proposal:

1) The proposed behavior is identical to one produced by original noweb.

2) Documentation provides a reasoning for current behavior as an example
   of reference expansion after the introduction of single-line comment
   with intention to comment all the lines caught in expansion. This
   reasoning follows simplistic assumption of semantics of arbitrary
   language and takes advantage of the single line comment notation used
   for non-intended purpose (i.e. multiline comment should have been
   used instead).

3) Continuing the line of examples given in emacs lisp, which lacks the
   notation for multiline comments I fail to see a situation where
   docstrings would not only serve the intended purpose, but in many
   cases contribute to quality and readability of the code.

4) Current behavior lacks the mechanism for handling multiple noweb
   references present on the same line. If prefix would be extracted
   from the unexpanded code and expansion would include raw noweb
   references notation. Clearly this is unexpected behavior.

If my proposal will find support in the community I can put my own
effort in bringing this change into existence.

[-- Attachment #2: Type: text/html, Size: 2308 bytes --]

             reply	other threads:[~2014-03-28 23:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 23:46 Pontus Michael [this message]
2014-03-29 15:30 ` Proposal to replace the prefix repetition with whitespace during expansion of noweb references Charles Berry
2014-03-31  8:17 ` Sebastien Vauban
2014-08-16 12:55   ` Pierre-Henry FRÖHRING
2014-08-18 11:55     ` Sebastien Vauban
2014-08-23  8:35       ` Aaron Ecay
2014-10-12 12:43         ` Bastien
2014-10-12 15:42           ` Aaron Ecay
2014-03-30 21:13 Pontus Michael
2014-04-11  9:36 ` Bastien

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:

  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='CAPpfmHKkpZEqFnPo8E0ow5Upb1rRR=UWRg43FcBJerTdOsqnJQ@mail.gmail.com' \
    --to=m.pontus@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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).