From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: how to set file coding system but using per directory variables Date: Tue, 04 Mar 2014 07:49:04 +0100 Message-ID: <53157760.1020502@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1393915506 25768 80.91.229.3 (4 Mar 2014 06:45:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2014 06:45:06 +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 Mar 04 07:45:14 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WKj6I-0005ll-B1 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Mar 2014 07:45:14 +0100 Original-Received: from localhost ([::1]:43413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKj6H-0007SY-Mv for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Mar 2014 01:45:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKj60-0007OW-9I for help-gnu-emacs@gnu.org; Tue, 04 Mar 2014 01:45:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKj5s-00038u-Vn for help-gnu-emacs@gnu.org; Tue, 04 Mar 2014 01:44:56 -0500 Original-Received: from moutng.kundenserver.de ([212.227.17.10]:58955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKj5s-00038m-M1 for help-gnu-emacs@gnu.org; Tue, 04 Mar 2014 01:44:48 -0500 Original-Received: from purzel.sitgens (brln-4dba6b41.pool.mediaWays.net [77.186.107.65]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0MLPHO-1WLH3c0X22-000gNu; Tue, 04 Mar 2014 07:44:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-Provags-ID: V02:K0:Im4W2MmG5HmRxVGssjDQswH9oMD57TXL6bTEOSQeWue JZzwaAges27fa7ZuPn5+LPShJ+LeLRTezPrjFAIO/0amyggC2l 0D78lotsCG7mKGtL4luRKFI2C0dH0yFzuIQkDFV1wFYxkOejn2 JQvblP3dcRvKGg41LWtDwtOVdbmUkdEQvvp2A9mq49RBxv8Ve9 s/d5yQp5ZPVSYyPTufZdZbkqrAJYfgbTdTOoY1cgEAu8KW0/Po my2vWh6t/xjZ6NtkmCu9q+zbmj+gg54Q9sWk5obf/mqS2zgjFV e7BajGDG0ITDcf18C5Uy8DJhOufr2G1eJ3hNMw39faVlukXdmd 8GeKu9Dpuf0Rm/mpzrUsP/+ntvuWKv4/mSyVgoaDN X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.10 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96247 Archived-At: Am 01.03.2014 13:54, schrieb Paul K: > when I add following as first llne in a buffer it is properly interpretted > > -*- coding: windows-1250-dos -*- > > > I don't want to add any headers to files though, so I created > .dir-locals.el file with following content: > ((nil . ((buffer-file-coding-system . windows-1250-dos) > (coding-system-for-read . windows-1250-dos) > (coding-system-for-write . windows-1250-dos)))) > > > then when I open file coding system is not automatically converted, I need > to do extra buffer reverting for declared coding system to be applied. > > do You have any ideas? > > best regards, > Maybe needs a string - "windows-1250-dos" ? Alternatively - Would it help to define it at the end of buffer instead? ;; Local Variables: ;; coding: windows-1250-dos ;; End: Also employing tweaked find-file command seems possible: (defun find-file-windows-1250-dos (filename &optional wildcards) "Edit file FILENAME using coding-system windows-1250-dos. See find-file for documentation" (interactive (find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer))) (let ((coding-system-for-read 'windows-1250-dos) (coding-system-for-write 'windows-1250-dos) (value (find-file-noselect filename nil nil wildcards))) (if (listp value) (mapcar 'switch-to-buffer (nreverse value)) (switch-to-buffer value))))