From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [Babel] Padlines Date: Fri, 20 Sep 2013 15:26:42 -0600 Message-ID: <87siwz5gml.fsf@gmail.com> References: <87y56t7rix.fsf@gmail.com> <86pps5okk0.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8DW-00078C-J1 for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:26:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN8DO-0002Hs-Na for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:26:22 -0400 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:33665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN8DO-0002He-5a for emacs-orgmode@gnu.org; Fri, 20 Sep 2013 17:26:14 -0400 Received: by mail-pb0-f43.google.com with SMTP id md4so855616pbc.16 for ; Fri, 20 Sep 2013 14:26:13 -0700 (PDT) In-Reply-To: <86pps5okk0.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 19 Sep 2013 00:02:23 +0200") 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain "Sebastien Vauban" writes: > Hi Eric, > > Eric Schulte wrote: >> aditya siram writes: >>> What's the rationale for having padlines by default in tangled source? It >>> generates wrong programs for languages where whitespace is significant >>> (Haskell) and, for me, doesn't noticeably improve the look of the tangled >>> file in cases where it isn't. >> >> It is possible to change the value of default header arguments on a >> per-language basis because e.g., while (:padlines "yes") may make sense >> for sh, it probably doesn't for Haskell. > > Could it be possible that ":padline yes" does not insert a blank line in front > of the very first block, only *between* all blocks? > > Best regards, > Seb I just pushed up a commit which implements this behavior. See the attached file for an example. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=padline-example.org #+Title: Examples with the new padline behavior #+headers: :tangle pad-yes-with-shebang.sed #+headers: :shebang "#!/bin/sed -f" #+headers: :padline "yes" #+begin_src sed 1 {N;s/\n//1} #+end_src #+headers: :tangle pad-no-with-shebang.sed #+headers: :shebang "#!/bin/sed -f" #+headers: :padline "no" #+begin_src sed 1 {N;s/\n//1} #+end_src #+headers: :tangle pad-yes-without-shebang.sed #+headers: :padline "yes" #+begin_src sed 1 {N;s/\n//1} #+end_src #+headers: :tangle pad-no-without-shebang.sed #+headers: :padline "no" #+begin_src sed 1 {N;s/\n//1} #+end_src 1. Tangle the above four blocks with =C-c C-v t=. 2. Execute the following code block to view the contents of the resulting sed files. #+begin_src sh :results scalar head pad*sed #+end_src #+RESULTS: : ==> padline-example.sed <== : #!/bin/sed -f : : 1 {N;s/\n//1} : : ==> pad-no-without-shebang.sed <== : 1 {N;s/\n//1} : : ==> pad-no-with-shebang.sed <== : #!/bin/sed -f : 1 {N;s/\n//1} : : ==> pad-yes-without-shebang.sed <== : 1 {N;s/\n//1} : : ==> pad-yes-with-shebang.sed <== : #!/bin/sed -f : : 1 {N;s/\n//1} --=-=-= Content-Type: text/plain -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D --=-=-=--