unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: ken <gebser@mousecar.com>
To: Kevin Rodgers <kevin.d.rodgers@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: "Text is read-only"... except it isn't... or shouldn't be
Date: Wed, 15 May 2013 07:48:19 -0400	[thread overview]
Message-ID: <51937603.1050304@mousecar.com> (raw)
In-Reply-To: <kmv5of$2d6$1@ger.gmane.org>

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 <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.

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.




  parent reply	other threads:[~2013-05-15 11:48 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13  9:47 "Text is read-only"... except it isn't... or shouldn't be ken
2013-05-13 16:13 ` Eli Zaretskii
2013-05-13 16:51   ` ken
2013-05-13 17:08     ` Eli Zaretskii
2013-05-14  2:34       ` ken
2013-05-14  6:46         ` Eli Zaretskii
2013-05-14  8:59           ` Peter Dyballa
2013-05-14 12:22             ` ken
2013-05-14 13:39               ` Eli Zaretskii
2013-05-14 20:39                 ` ken
2013-05-14 20:42                   ` Eli Zaretskii
2013-05-14 20:45                     ` Jai Dayal
2013-05-14 21:39                       ` Óscar Fuentes
2013-05-14 23:23                       ` How to unsubscribe (was: "Text is read-only"... except it isn't... or shouldn't be) Bob Proulx
2013-05-15  2:16                         ` Jai Dayal
2013-05-15  7:23                           ` Eli Zaretskii
2013-05-16 12:50                           ` Suvayu Ali
2013-05-14 21:36                     ` "Text is read-only"... except it isn't... or shouldn't be ken
2013-05-15  5:17                   ` Kevin Rodgers
2013-05-15  7:28                     ` Eli Zaretskii
2013-05-15 11:56                       ` ken
2013-05-15 12:30                         ` Eli Zaretskii
     [not found]                       ` <mailman.25840.1368618972.855.help-gnu-emacs@gnu.org>
2013-05-16  3:49                         ` Jason Rumney
2013-05-15 11:48                     ` ken [this message]
2013-05-16  6:27                       ` Kevin Rodgers
2013-05-16 11:08                         ` Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be] ken
2013-05-16 13:30                           ` Kevin Rodgers
2013-05-16 14:26                             ` ken
2013-05-16 14:39                               ` Peter Dyballa
2013-05-18 13:59                               ` Kevin Rodgers
2013-05-19 12:10                                 ` ken
2013-05-16 14:23                           ` ken
2013-05-16 14:41                             ` Peter Dyballa
2013-05-16 14:48                             ` Dmitry Gutov
2013-05-16 22:00                               ` Xue Fuqiao
2013-05-14 11:58           ` "Text is read-only"... except it isn't... or shouldn't be ken
2013-05-13 17:59     ` ken
2013-05-13 18:10       ` Eli Zaretskii
2013-05-13 18:15       ` Bob Proulx
2013-05-14  2:26         ` ken
     [not found]         ` <mailman.25692.1368498372.855.help-gnu-emacs@gnu.org>
2013-05-14  2:38           ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51937603.1050304@mousecar.com \
    --to=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kevin.d.rodgers@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).