I have a version 23.xxx Emacs, and I do get the message about the coding that disagree with the buffer. I will try what you propose in this message and the next one and let you know if this solves the issue. Thanks for the information !! Vincent. > Date: Sat, 9 May 2009 10:01:15 +0300 > From: eliz@gnu.org > To: vincent.b.1@hotmail.fr > CC: emacs-devel@gnu.org > Subject: Re: How to overwrite completely a buffer with a file, with overwriting also the coding system ? > > > From: =?iso-8859-1?Q?Vincent_Bela=EFche?= > > Date: Fri, 8 May 2009 23:07:44 +0200 > > > > When I create a new target-file from a template, emacs-template creates a buffer for this target-file, which therefore is created with the default coding-system (iso-latin-1-dos for my machine), and then emacs-template insert into this buffer the content of the template file. Now I want that the file be created with iso-latin-1-unix coding. Even though the template file contains a -*- coding: iso-latin-1-unix -*- the target file is created with dos end-of-lines. > > What Emacs version is this? I think Emacs 23 will ask the user for > confirmation if the `coding:' cookie disagrees with the buffer's > encoding. > > In any case, if you call the `find-auto-coding' function right after > inserting the template, this function will tell you what encoding > should the buffer use, taking into account the file's name and the > `coding:' cookie. You can then set the right encoding by calling > `set-buffer-file-coding-system'. > > _________________________________________________________________ Découvrez toutes les possibilités de communication avec vos proches http://www.microsoft.com/windows/windowslive/default.aspx