emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [Babel] Coding system of tangled files?


From: Eric Schulte
Subject: Re: [Orgmode] [Babel] Coding system of tangled files?
Date: Thu, 18 Nov 2010 07:07:05 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Seb,

I think this should be possible using the `org-babel-post-tangle-hook'
to re-save the file with a specified encoding.  After looking into this
a little bit it appears that you should be able to add a function to
this hook which will update the `save-buffer-coding-system' variable and
then re-save the buffer.  This should allow you to save tangled files in
arbitrary code systems.  For information on coding systems following
this Org-mode link into the elisp documentation by calling M-x
org-open-at-point on the following line.

[[info:elisp:Coding%20Systems][info:elisp:Coding Systems]]

Best -- Eric

Sébastien Vauban <address@hidden> writes:

> #+TITLE:     Format for tangling files
> #+DATE:      2010-11-18
>
> #+BABEL: :comments yes
>
> * Script
>
> #+begin_src sh :tangle doit.sh
> #!/bin/bash
> # Example
>
> ls
> date
> #+end_src
>
> * Execute it in a Bash shell
>
> The tangled file, when launched from withing a Bash shell, returns errors:
>
> #+begin_src sh
> address@hidden:.../Accounting/dev 127$ ./doit.sh 
> ./doit.sh: line 4: $'\r': command not found
> ./doit.sh: line 5: $'ls\r': command not found
> ./doit.sh: line 6: $'date\r': command not found
> #+end_src
>
> The reason is that the tangled file is saved as UTF-8-dos (being under
> Windows). It should be saved in unix format. Is there a way to impose this?
>
> Best regards,
>   Seb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]