From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: configuring coding systems for loading/saving Date: Thu, 06 May 2010 17:23:21 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1273188244 23957 80.91.229.12 (6 May 2010 23:24:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 May 2010 23:24:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 07 01:24:03 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1OAAQD-0002IX-LC for geh-help-gnu-emacs@m.gmane.org; Fri, 07 May 2010 01:24:01 +0200 Original-Received: from localhost ([127.0.0.1]:36942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAAQD-0000yW-59 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 May 2010 19:24:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAAPk-0000vK-9e for help-gnu-emacs@gnu.org; Thu, 06 May 2010 19:23:32 -0400 Original-Received: from [140.186.70.92] (port=38090 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAAPi-0000qt-Ae for help-gnu-emacs@gnu.org; Thu, 06 May 2010 19:23:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAAPg-0001w7-OL for help-gnu-emacs@gnu.org; Thu, 06 May 2010 19:23:30 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:39555) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAAPg-0001vf-Ig for help-gnu-emacs@gnu.org; Thu, 06 May 2010 19:23:28 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OAAPc-00024B-2f for help-gnu-emacs@gnu.org; Fri, 07 May 2010 01:23:24 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 May 2010 01:23:24 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 May 2010 01:23:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 39 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:73534 Archived-At: David Madore wrote: > I also tried this: > > (setq select-safe-coding-system-accept-default-p > '(lambda (coding) (string= coding buffer-file-coding-system))) > > which I think should do more or less what I want (accept an encoding > as safe only if it matches exactly the buffer-file-coding-system), but > it fails for a stupid reason: coding is typically something like > "iso-8859-1" whereas buffer-file-coding-system is typically something > like "iso-8859-1-unix" - and I don't know how to test more > intelligently than with string-equal. How about: (equal (coding-system-get coding 'mime-charset) (coding-system-get buffer-file-coding-system 'mime-charset) or (equal (coding-system-change-eol-conversion coding 'unix) (coding-system-change-eol-conversion buffer-file-coding-system 'unix)) Can someone explain why (coding-system-change-eol-conversion 'iso-8859-1 nil) ⇒ iso-8859-1 (coding-system-change-eol-conversion 'iso-8859-1-unix nil) ⇒ iso-latin-1 > Also, I'm afraid overriding > select-safe-coding-system-accept-default-p could have unpleasant > effects (e.g., if some Emacs application wishes to suggest that the > previously chosen file encoding is inadequate). -- Kevin Rodgers Denver, Colorado, USA