[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Proposal to replace the prefix repetition with whitespace during

From: Sebastien Vauban
Subject: Re: [O] Proposal to replace the prefix repetition with whitespace during expansion of noweb references
Date: Mon, 31 Mar 2014 10:17:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Pontus Michael wrote:
> 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"
>         "bar")
> #+end_src
> 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.

I am more or less the one who asked for the current behavior because
I wanted to be able to easily comment blocks in SQL or ELisp or ...

--8<---------------cut here---------------start------------->8---
FROM table
WHERE <<cond1>> AND
      -- <<cond2>> AND
--8<---------------cut here---------------end--------------->8---

However, as you say, in the SQL case, I could have used multiline

This is a pity it does not exist in ELisp.

However, your arguments 1 and 4 are important to me. Hence, I'd see no
objection to move in the direction you propose (insert whitespaces, so
that indentation is correctly done).

Best regards,

Sebastien Vauban

reply via email to

[Prev in Thread] Current Thread [Next in Thread]