help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Text is read-only"... except it isn't... or shouldn't be


From: Kevin Rodgers
Subject: Re: "Text is read-only"... except it isn't... or shouldn't be
Date: Tue, 14 May 2013 23:17:44 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

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 <gebser@mousecar.com>
CC: Eli Zaretskii <eliz@gnu.org>, 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.

2. Because the default value of auto-mode-alist matches the ".gif" extension.

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.

See the "Choosing Modes" section of the Emacs manual.

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]