Re: [O] [Babel] Padlines
Hi I assume this is related to this discussion and the patches: after updating this morning, get an error message after tangling: variable padline void. This goes away after reverting to 8.2 2 release. Default settings for padline used. Cheers, Rainer Sebastien Vauban sva-n...@mygooglest.com writes: Hi Eric, Eric Schulte wrote: The blank line which was inserted between blocks isn't anymore for me. [...] results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. Confirmed! Thanks a lot. Best regards, Seb #secure method=pgpmime mode=sign -- Rainer M. Krug email: RMKrugatgmaildotcom
Re: [O] [Babel] Padlines
Rainer M Krug rai...@krugs.de writes: Hi I assume this is related to this discussion and the patches: after updating this morning, get an error message after tangling: variable padline void. This goes away after reverting to 8.2 2 release. Default settings for padline used. Cheers, Rainer Vladimir's patch in this thread fixes this issue and has been applied. Sebastien Vauban sva-n...@mygooglest.com writes: Hi Eric, Eric Schulte wrote: The blank line which was inserted between blocks isn't anymore for me. [...] results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. Confirmed! Thanks a lot. Best regards, Seb #secure method=pgpmime mode=sign -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
Re: [O] [Babel] Padlines
Vladimir Lomov lomov...@gmail.com writes: Hello, ** Eric Schulte [2013-09-28 06:17:51 -0600]: The blank line which was inserted between blocks isn't anymore for me. ECM: --8---cut here---start-8--- * Tangle these blocks :PROPERTIES: :tangle: yes :padline: yes :END: #+begin_src emacs-lisp :file test.csv data #+end_src #+begin_src emacs-lisp :file test.csv datb #+end_src --8---cut here---end---8--- results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Best regards, Seb Hi Seb, Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. And seems that you miss another 'padline' in function 'org-babel-spec-to-string', line 323. I attached small patch which removes that line so I can tangle Org document with shell scripts. Applied, Thanks for catching this and for posting the patch. p.s. Please format future patches with git format-patch. --- WBR, Vladimir Lomov -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
Re: [O] [Babel] Padlines
Eric Schulte schulte.e...@gmail.com writes: Rainer M Krug rai...@krugs.de writes: Hi I assume this is related to this discussion and the patches: after updating this morning, get an error message after tangling: variable padline void. This goes away after reverting to 8.2 2 release. Default settings for padline used. Cheers, Rainer Vladimir's patch in this thread fixes this issue and has been applied. Thanks - will try it out then Rainer Sebastien Vauban sva-n...@mygooglest.com writes: Hi Eric, Eric Schulte wrote: The blank line which was inserted between blocks isn't anymore for me. [...] results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. Confirmed! Thanks a lot. Best regards, Seb #secure method=pgpmime mode=sign #secure method=pgpmime mode=sign -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug
Re: [O] [Babel] Padlines
Hi Eric, Eric Schulte wrote: The blank line which was inserted between blocks isn't anymore for me. [...] results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. Confirmed! Thanks a lot. Best regards, Seb -- Sebastien Vauban
Re: [O] [Babel] Padlines
Hello, ** Eric Schulte [2013-09-28 06:17:51 -0600]: The blank line which was inserted between blocks isn't anymore for me. ECM: --8---cut here---start-8--- * Tangle these blocks :PROPERTIES: :tangle: yes :padline: yes :END: #+begin_src emacs-lisp :file test.csv data #+end_src #+begin_src emacs-lisp :file test.csv datb #+end_src --8---cut here---end---8--- results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Best regards, Seb Hi Seb, Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. And seems that you miss another 'padline' in function 'org-babel-spec-to-string', line 323. I attached small patch which removes that line so I can tangle Org document with shell scripts. --- WBR, Vladimir Lomov -- Coming to Stores Near You: 101 Grammatically Correct Popular Tunes Featuring: (You Aren't Anything but a) Hound Dog It Doesn't Mean a Thing If It Hasn't Got That Swing I'm Not Misbehaving And A Whole Lot More... diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 63d0a47..f655711 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -322,7 +322,6 @@ that the appropriate major-mode is set. SPEC has the form: (insert-comment (lambda (text) (when (and comments (not (string= comments no)) ( (length text) 0)) - (when padline (insert \n)) (comment-region (point) (progn (insert text) (point))) (end-of-line nil) (insert \n) (when comment (funcall insert-comment comment))
Re: [O] [Babel] Padlines
The blank line which was inserted between blocks isn't anymore for me. ECM: --8---cut here---start-8--- * Tangle these blocks :PROPERTIES: :tangle: yes :padline: yes :END: #+begin_src emacs-lisp :file test.csv data #+end_src #+begin_src emacs-lisp :file test.csv datb #+end_src --8---cut here---end---8--- results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Best regards, Seb Hi Seb, Thanks for this bug report, there was a problem in my previous patch in this thread. I've just pushed up a fix which should solve this problem. Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
Re: [O] [Babel] Padlines
Hi Eric, Eric Schulte wrote: Sebastien Vauban sva-n...@mygooglest.com writes: Eric Schulte wrote: aditya siram aditya.si...@gmail.com 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 The blank line which was inserted between blocks isn't anymore for me. ECM: --8---cut here---start-8--- * Tangle these blocks :PROPERTIES: :tangle: yes :padline: yes :END: #+begin_src emacs-lisp :file test.csv data #+end_src #+begin_src emacs-lisp :file test.csv datb #+end_src --8---cut here---end---8--- results in: --8---cut here---start-8--- data datb --8---cut here---end---8--- Note that I tried adding :padline to yes, but I normally should not, as it is the default. Best regards, Seb -- Sebastien Vauban
Re: [O] [Babel] Padlines
Hi Eric, Eric Schulte wrote: Sebastien Vauban sva-n...@mygooglest.com writes: Eric Schulte wrote: aditya siram aditya.si...@gmail.com 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
Re: [O] [Babel] Padlines
Sebastien Vauban sva-n...@mygooglest.com writes: Hi Eric, Eric Schulte wrote: aditya siram aditya.si...@gmail.com 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. #+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} -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
Re: [O] [Babel] Padlines
aditya siram wrote: What's the rationale for having padlines by default in tangled source? It generates more readable source-code, as blocks are not glued next to each other. 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. Though, I admit that padlines yes should be smarter and add only one line *between* blocks, but NOT before the first one! Best regards, Seb -- Sebastien Vauban
Re: [O] [Babel] Padlines
aditya siram aditya.si...@gmail.com writes: Hi all, 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. Thanks! -deech 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. I just changed the value of org-babel-default-header-args:haskell, so that :padlines will be turned off by default for that language. Cheers, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
Re: [O] [Babel] Padlines
Hi Eric, Eric Schulte wrote: aditya siram aditya.si...@gmail.com 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 -- Sebastien Vauban