From: "Eric Schulte" <schulte.eric@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [Babel] Coding system of tangled files?
Date: Thu, 18 Nov 2010 07:07:05 -0700 [thread overview]
Message-ID: <87tyjeheqt.fsf@gmail.com> (raw)
In-Reply-To: 801v6ieqjl.fsf@mundaneum.com
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 <wxhgmqzgwmuf@spammotel.com> 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
> ./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
next prev parent reply other threads:[~2010-11-18 14:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 12:59 [Babel] Coding system of tangled files? Sébastien Vauban
2010-11-18 14:07 ` Eric Schulte [this message]
2010-11-22 12:41 ` Sébastien Vauban
2010-11-22 13:20 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tyjeheqt.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=wxhgmqzgwmuf@spammotel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).