[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp to change line endings for new remote file
From: |
Kevin Rodgers |
Subject: |
Re: elisp to change line endings for new remote file |
Date: |
Tue, 07 Oct 2008 00:42:18 -0600 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
yary wrote:
Hoping someone can write a line or two of elisp for my .emacs file
that will set the line endings to Unix for any new file opened via
tramp. I'm using GNU Emacs 23.0.60.1 on Windows, often creating Unix
files via plink, and usually forgetting to change the line endings
from DOS when I do. If you've already solved this in your setup,
please share.
From the "Text and Binary" node of the Emacs manual:
When you use NFS, Samba, or some other similar method to access file
systems that reside on computers using GNU or Unix systems, Emacs
should not perform end-of-line translation on any files in these file
systems--not even when you create a new file. To request this,
designate these file systems as "untranslated" file systems by calling
the function `add-untranslated-filesystem'. It takes one argument: the
file system name, including a drive letter and optionally a directory.
For example,
(add-untranslated-filesystem "Z:")
designates drive Z as an untranslated file system, and
(add-untranslated-filesystem "Z:\\foo")
designates directory `\foo' on drive Z as an untranslated file system.
Most often you would use `add-untranslated-filesystem' in your
`.emacs' file, or in `site-start.el' so that all the users at your site
get the benefit of it.
--
Kevin Rodgers
Denver, Colorado, USA