From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: Proposal to replace the prefix repetition with whitespace during expansion of noweb references Date: Mon, 31 Mar 2014 10:17:20 +0200 Message-ID: <86a9c6235b.fsf@somewhere.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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--- SELECT * FROM table WHERE <> AND -- <> AND <> --8<---------------cut here---------------end--------------->8--- However, as you say, in the SQL case, I could have used multiline comments. 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, Seb -- Sebastien Vauban