From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [Babel] Coding system of tangled files? Date: Thu, 18 Nov 2010 07:07:05 -0700 Message-ID: <87tyjeheqt.fsf@gmail.com> References: <801v6ieqjl.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=36173 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ5kK-0002DW-OE for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 09:45:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ5kI-0001xM-9w for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 09:45:56 -0500 Received: from mail-vw0-f41.google.com ([209.85.212.41]:55808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ5kI-0001x7-7a for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 09:45:54 -0500 Received: by vws10 with SMTP id 10so1679327vws.0 for ; Thu, 18 Nov 2010 06:45:53 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org 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=C3=A9bastien Vauban 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 > sva@MEDIACENTER:.../Accounting/dev 127$ ./doit.sh=20 > ./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 thi= s? > > Best regards, > Seb