Re: [O] Controlling new line characters during tangle

2017-07-01 Thread Nicolas Goaziou
Hello,

Giacomo M  writes:

> Ok, rudimentary elisp knowledge seems to help here:
>
> #+BEGIN_SRC emacs-lisp
> (defun jack/dos2unix-post-tangle-hook ()
> (set-buffer-file-coding-system 'unix 't)
> (save-buffer)
> )
> (add-hook 'org-babel-post-tangle-hook 'jack/dos2unix-post-tangle-hook)
> #+END_SRC

Thank you for sharing.

Would it make sense to provide a :tangle-coding-system attribute? Would
you want to implement it?

Regards,

-- 
Nicolas Goaziou



Re: [O] Controlling new line characters during tangle

2017-06-22 Thread Giacomo M

  
  
Ok, rudimentary elisp knowledge seems to help here:
#+BEGIN_SRC emacs-lisp
  (defun jack/dos2unix-post-tangle-hook ()
    (set-buffer-file-coding-system 'unix 't)
    (save-buffer)
    )
  (add-hook 'org-babel-post-tangle-hook
  'jack/dos2unix-post-tangle-hook)
  #+END_SRC

Thanks,

Giacomo

Il 6/21/2017 1:02 PM, Kaushal Modi ha
  scritto:


  
On Wed, Jun 21, 2017, 5:21 AM Giacomo M 
  wrote:

Hi all,
  
  I'm using emacs also under Windows, and would need to tangle
  scripts/config files to be used under Unix.
  
  
  
  
 Is there
  any header argument
  to enforce the desired new line characters in the tangled
  files?

  
  
  
  At which point would you like to enforce the new line
characters?
  
  
  Can you post a MWE and explain what that it tangles to vs
what you'd actually like to see in the tangled file?
  


  
  -- 
  
  
Kaushal Modi
  


  




Re: [O] Controlling new line characters during tangle

2017-06-21 Thread Giacomo M
Dear Kashual,

1. I visit a (Unix EOL[1]) org file on Windows.
2. I write a shell script in a shell source block to be tangled.
3. I tangle it.
4. As a result, I get a (Windows EOL) shell script, while I would like a
Unix EOL shell script.

Thanks,

Giacomo

[1] End Of Line convention

On Jun 21, 2017 13:02, "Kaushal Modi"  wrote:

> On Wed, Jun 21, 2017, 5:21 AM Giacomo M  wrote:
>
>> Hi all,
>>
>> I'm using emacs also under Windows, and would need to tangle
>> scripts/config files to be used under Unix.
>
>
> Is there any header argument
>> to enforce the desired new line characters in the tangled files?
>>
>
> At which point would you like to enforce the new line characters?
>
> Can you post a MWE and explain what that it tangles to vs what you'd
> actually like to see in the tangled file?
>
>> --
>
> Kaushal Modi
>


Re: [O] Controlling new line characters during tangle

2017-06-21 Thread Kaushal Modi
On Wed, Jun 21, 2017, 5:21 AM Giacomo M  wrote:

> Hi all,
>
> I'm using emacs also under Windows, and would need to tangle
> scripts/config files to be used under Unix.


Is there any header argument
> to enforce the desired new line characters in the tangled files?
>

At which point would you like to enforce the new line characters?

Can you post a MWE and explain what that it tangles to vs what you'd
actually like to see in the tangled file?

> --

Kaushal Modi


[O] Controlling new line characters during tangle

2017-06-21 Thread Giacomo M

Hi all,

I'm using emacs also under Windows, and would need to tangle 
scripts/config files to be used under Unix. Is there any header argument 
to enforce the desired new line characters in the tangled files?


Thanks,

Giacomo