Re: [O] Prevent creating empty lines with trailing spaces when tangling noweb

2017-05-06 Thread Kaushal Modi
On Sat, May 6, 2017, 3:23 AM Nicolas Goaziou wrote: > Hello, > > Kaushal Modi writes: > > I'd rather clean every empty line upon tangling, or let the user do it > with `org-babel-post-tangle-hook'. I just tried this again and it worked this time! (add-hook 'org-babel-post-tangle-hook #'d

Re: [O] Prevent creating empty lines with trailing spaces when tangling noweb

2017-05-06 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > Notice that the empty line is created between noweb segments as expected > because of ":noweb-sep "\\n\\n"". But what was unexpected to me was the > creation of empty line with spaces inserted to match the indentation. > > Is this by design? I lean towards "yes".

Re: [O] Prevent creating empty lines with trailing spaces when tangling noweb

2017-05-05 Thread Kaushal Modi
On Sat, May 6, 2017 at 2:30 AM Kaushal Modi wrote: > +(setq body-str (replace-regexp-in-string "^[ \n\r]*\n" "\n" > body-str))) > > Just one correction to this regexp so that two or more consecutive empty lines in the source block get retained: (setq body-str (replace-regexp-in-string "^[ ]+

[O] Prevent creating empty lines with trailing spaces when tangling noweb

2017-05-05 Thread Kaushal Modi
Hello, I have this MWE: #+TITLE: Org babel tangle and noweb #+PROPERTY: header-args:shell :shebang "#!/usr/bin/env bash" * Shell Script #+BEGIN_SRC shell :noweb yes :tangle code.sh exec emacs -Q "$@" \ --eval '(progn <> )' 2>/dev/null >