From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: Re: "Text is read-only"... except it isn't... or shouldn't be Date: Wed, 15 May 2013 07:48:19 -0400 Message-ID: <51937603.1050304@mousecar.com> References: <5190B6C2.3060801@mousecar.com> <83y5bi97sp.fsf@gnu.org> <51911A2B.6070100@mousecar.com> <83r4ha959c.fsf@gnu.org> <5191A2BA.7080108@mousecar.com> <83bo8e83ef.fsf@gnu.org> <6DBF2725-3120-4A0D-A23B-C1C16CA8AF22@Web.DE> <51922C68.1030700@mousecar.com> <8338tp8yuu.fsf@gnu.org> <5192A11F.1080003@mousecar.com> Reply-To: gebser@mousecar.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1368618526 10765 80.91.229.3 (15 May 2013 11:48:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 May 2013 11:48:46 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kevin Rodgers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 15 13:48:45 2013 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 1UcaCL-0000Fz-Hd for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2013 13:48:45 +0200 Original-Received: from localhost ([::1]:51658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcaCL-0001fT-4n for geh-help-gnu-emacs@m.gmane.org; Wed, 15 May 2013 07:48:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcaC7-0001fK-H5 for help-gnu-emacs@gnu.org; Wed, 15 May 2013 07:48:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcaC5-0005CQ-1C for help-gnu-emacs@gnu.org; Wed, 15 May 2013 07:48:31 -0400 Original-Received: from mout.perfora.net ([74.208.4.195]:59962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcaC4-00059q-Om for help-gnu-emacs@gnu.org; Wed, 15 May 2013 07:48:28 -0400 Original-Received: from dellap.mousecar.net (dsl093-011-016.cle1.dsl.speakeasy.net [66.93.11.16]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MehSi-1Uru9g3eeW-00OG79; Wed, 15 May 2013 07:48:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 In-Reply-To: X-Provags-ID: V02:K0:sIu+mpEtwuLJsTZtusNJdBb0/gNRsKoLJpDQ632C72l j6Y9id2nH9248NbPGdEKWLgWklRRh2dVszsr7+nE2shrCAfSYh nSZR1BTYcfIc6vc0VJaCnWPuXpYG8/Cf655HHxWRKPi+y3fSLC 4GTI6fC0Hha+wZex03pcM6zS7jrFLcbyM2TEsZjrX0o5rDkxHA pJhdVZUpVlegsoT6Wa7rkmMmrt5scAibZmqaMMU02ZPwWLU3vl mfz5E4WpAHrr6QoCgOMauLqdY4JEa2y3SomUDkolApseaQxW8e SMZkeucAZ9FQvCt2cEAvn1FyV2x+H2aZPlKRZjsNXdyjykqZYv 8tiAoDfsA3m7EiR77ow4A+5JKxcWXwfqo6w5c6ruj X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 74.208.4.195 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:90803 Archived-At: On 05/15/2013 01:17 AM Kevin Rodgers wrote: > On 5/14/13 2:39 PM, ken wrote: >> On 05/14/2013 09:39 AM Eli Zaretskii wrote: >>>> Date: Tue, 14 May 2013 08:22:00 -0400 >>>> From: ken >>>> CC: Eli Zaretskii , help-gnu-emacs@gnu.org >>>> >>>> [...] overly simplistic strategy for determining a file type merely >>>> by looking at the filename extension, especially when this can be >>>> more suitably and accurately and intelligently accomplished by >>>> determining a file's magic number as the Linux "file" utility does. >>> >>> Emacs does look at the magic signature, see magic-mode-alist. >>> >> >> They why didn't it see that my file was (obviously) a text file and >> not an image >> file? > > 1. Because the default value of magic-mode-alist is nil. If you mean this functionality was turned off in this version I recently installed, then, yes, that agrees with what I said earlier in this thread: emacs no longer determines a file's magic upon visiting a file. The more comprehensive fix, then, would be to set magic-mode-alist to t, yes? If so, what elisp statement(s) do you think would best accomplish that? > > 2. Because the default value of auto-mode-alist matches the ".gif" > extension. The documentation suggests that magic-mode-alist, if turned on, will override auto-mode-alist. > > 3. Because it is not obvious what the signature is for a text file -- > perhaps > something like "\\`[[:print:]\t\f\r\n]", which is so general that it > would > prevent most of the existing automatic method from working. Yes, the damned humans with their writing so random and the different languages characters and syntaxes and punctuation etc. make such evaluation nigh impossible. Probably for this reason, magic mode adopts a different strategy. The linux "file" utility, referred to earlier in this thread, probably does this also, as it makes fairly reliable evaluations of files' contents.