emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [Babel] Padlines
Date: Mon, 23 Sep 2013 09:31:20 +0200	[thread overview]
Message-ID: <86hadcdmev.fsf@somewhere.org> (raw)
In-Reply-To: 87siwz5gml.fsf@gmail.com

Hi Eric,

Eric Schulte wrote:
> "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org> writes:
>> Eric Schulte wrote:
>>> aditya siram <aditya.siram-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
>
> I just pushed up a commit which implements this behavior.  See the
> attached file for an example.
>
> #+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}

That seems perfect, and solves corner-cases I wouldn't have thought of (with
shebang). Thanks a lot!

Best regards,
  Seb

-- 
Sebastien Vauban

  reply	other threads:[~2013-09-23  7:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 22:36 [Babel] Padlines aditya siram
2013-09-18  7:32 ` Sebastien Vauban
2013-09-18 21:23 ` Eric Schulte
2013-09-18 22:02   ` Sebastien Vauban
2013-09-20 21:26     ` Eric Schulte
2013-09-23  7:31       ` Sebastien Vauban [this message]
     [not found]       ` <87siwz5gml.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-27 14:53         ` Sebastien Vauban
2013-09-28 12:17           ` Eric Schulte
2013-09-30  8:54             ` Sebastien Vauban
2013-10-01 10:28               ` Rainer M Krug
2013-10-01 11:59                 ` Eric Schulte
2013-10-01 12:53                   ` Rainer M Krug
2013-10-01  5:57             ` Vladimir Lomov
2013-10-01 11:59               ` Eric Schulte

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

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

  git send-email \
    --in-reply-to=86hadcdmev.fsf@somewhere.org \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /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
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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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