From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: yary Newsgroups: gmane.emacs.help Subject: Re: elisp to change line endings for new remote file Date: Tue, 7 Oct 2008 08:41:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <06d7be73-e1e2-4640-b32f-4d5bd9103cd8@k36g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1223397670 19623 80.91.229.12 (7 Oct 2008 16:41:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2008 16:41:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 18:41:58 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KnFd6-0003T7-8L for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 18:41:48 +0200 Original-Received: from localhost ([127.0.0.1]:51676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnFc2-00073a-Jk for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 12:40:42 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!w1g2000prk.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 65.208.210.97 Original-X-Trace: posting.google.com 1223394094 5408 127.0.0.1 (7 Oct 2008 15:41:34 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 7 Oct 2008 15:41:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w1g2000prk.googlegroups.com; posting-host=65.208.210.97; posting-account=d6bTuAkAAADNFwa37uXnhaYqYjfOS8nU User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.30 Safari/525.13, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163142 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58489 Archived-At: Thanks all. I already knew about add-untranslated-filesystem. tramp/ plink is smart enough to not translate its files, so that's not the solution for creating new files with unix line endings. On Oct 7, 2:43=A0am, Peter Dyballa wrote: > Am 06.10.2008 um 19:07 schrieb yary: ... > There is before-save-hook. It could be (time-stamp). You could add =A0 > (via the customisation interface) another function that changes from =A0 > DOS to UNIX file endings, (set-buffer-file-coding-system coding- > system &optional force nomodify). ... That seems close to the right thing, but I'd want to call after opening a new "tramp" file, not before saving- if it has MS-DOS line endings already, I want to change it manually. > Another option is to put into your init file: > > =A0 =A0 =A0 =A0 (prefer-coding-system =A0 =A0'utf-8-unix) > > although I doubt that this would change *existing* line endings. =A0 That's also a good answer, as I don't want to change existing endings- just want to make my new files correct for the platform. Though I'd have a problem when I opened up a new file on the Windows side. (Curse that CR, how many thousands of hours have been wasted due to you...)