* "Text is read-only"... except it isn't... or shouldn't be
@ 2013-05-13 9:47 ken
2013-05-13 16:13 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: ken @ 2013-05-13 9:47 UTC (permalink / raw)
To: help-gnu-emacs
A file which I've been opening in emacs and editing for a few years in
emacs suddenly with emacs version 22.1.1 became read-only. I open it,
can navigate around in it (though the cursor/mark isn't visible), but
when I try to edit it, I'm not allowed. I get a message in the
minibuffer saying, "Text is read-only". The beginning of the modeline
is "-u: --". I can open this same file in vi and edit it (as the same
user) without any problem at all. I don't have this problem with any
other file I edit in emacs, just this one. The OS is linux, kernel
version 2.6.18.384, and the permissions for this file are 664 and I am
the owner of the file. If I change (i.e., mv) the name of the file to
something else, emacs behaves normally and lets me edit the file just
like any other file. So I'm pretty sure that the problem is that emacs
has a problem with the file name and thinks I shouldn't be allowed to
edit it. How do I turn this behavior off?
thanks much.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
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
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-13 16:13 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Mon, 13 May 2013 05:47:46 -0400
> From: ken <gebser@mousecar.com>
>
> A file which I've been opening in emacs and editing for a few years in
> emacs suddenly with emacs version 22.1.1 became read-only. I open it,
> can navigate around in it (though the cursor/mark isn't visible), but
> when I try to edit it, I'm not allowed. I get a message in the
> minibuffer saying, "Text is read-only". The beginning of the modeline
> is "-u: --". I can open this same file in vi and edit it (as the same
> user) without any problem at all. I don't have this problem with any
> other file I edit in emacs, just this one. The OS is linux, kernel
> version 2.6.18.384, and the permissions for this file are 664 and I am
> the owner of the file. If I change (i.e., mv) the name of the file to
> something else, emacs behaves normally and lets me edit the file just
> like any other file. So I'm pretty sure that the problem is that emacs
> has a problem with the file name and thinks I shouldn't be allowed to
> edit it. How do I turn this behavior off?
What does Emacs say if you type this:
M-: major-mode RET
in the buffer that visits this file you aren't allowed to edit?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 16:13 ` Eli Zaretskii
@ 2013-05-13 16:51 ` ken
2013-05-13 17:08 ` Eli Zaretskii
2013-05-13 17:59 ` ken
0 siblings, 2 replies; 41+ messages in thread
From: ken @ 2013-05-13 16:51 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
>> Date: Mon, 13 May 2013 05:47:46 -0400
>> From: ken <gebser@mousecar.com>
>>
>> A file which I've been opening in emacs and editing for a few years in
>> emacs suddenly with emacs version 22.1.1 became read-only. I open it,
>> can navigate around in it (though the cursor/mark isn't visible), but
>> when I try to edit it, I'm not allowed. I get a message in the
>> minibuffer saying, "Text is read-only". The beginning of the modeline
>> is "-u: --". I can open this same file in vi and edit it (as the same
>> user) without any problem at all. I don't have this problem with any
>> other file I edit in emacs, just this one. The OS is linux, kernel
>> version 2.6.18.384, and the permissions for this file are 664 and I am
>> the owner of the file. If I change (i.e., mv) the name of the file to
>> something else, emacs behaves normally and lets me edit the file just
>> like any other file. So I'm pretty sure that the problem is that emacs
>> has a problem with the file name and thinks I shouldn't be allowed to
>> edit it. How do I turn this behavior off?
>
> What does Emacs say if you type this:
>
> M-: major-mode RET
>
> in the buffer that visits this file you aren't allowed to edit?
>
image-mode
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 16:51 ` ken
@ 2013-05-13 17:08 ` Eli Zaretskii
2013-05-14 2:34 ` ken
2013-05-13 17:59 ` ken
1 sibling, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-13 17:08 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Mon, 13 May 2013 12:51:55 -0400
> From: ken <gebser@mousecar.com>
> CC: help-gnu-emacs@gnu.org
>
>
> > What does Emacs say if you type this:
> >
> > M-: major-mode RET
> >
> > in the buffer that visits this file you aren't allowed to edit?
> >
>
> image-mode
That explains everything, doesn't it? Your file has a file-name
extension that matches some image file, so Emacs enters the Image mode
for it, and doesn't let you edit images (because image-editing
capabilities are not yet part of Emacs).
Solution: remove that extension from auto-mode-alist, and Bob's your
uncle.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 16:51 ` ken
2013-05-13 17:08 ` Eli Zaretskii
@ 2013-05-13 17:59 ` ken
2013-05-13 18:10 ` Eli Zaretskii
2013-05-13 18:15 ` Bob Proulx
1 sibling, 2 replies; 41+ messages in thread
From: ken @ 2013-05-13 17:59 UTC (permalink / raw)
To: help-gnu-emacs
n 05/13/2013 12:51 PM ken wrote:
>
>>> Date: Mon, 13 May 2013 05:47:46 -0400
>>> From: ken <gebser@mousecar.com>
>>>
>>> A file which I've been opening in emacs and editing for a few years in
>>> emacs suddenly with emacs version 22.1.1 became read-only. I open it,
>>> can navigate around in it (though the cursor/mark isn't visible), but
>>> when I try to edit it, I'm not allowed. I get a message in the
>>> minibuffer saying, "Text is read-only". The beginning of the modeline
>>> is "-u: --". I can open this same file in vi and edit it (as the same
>>> user) without any problem at all. I don't have this problem with any
>>> other file I edit in emacs, just this one. The OS is linux, kernel
>>> version 2.6.18.384, and the permissions for this file are 664 and I am
>>> the owner of the file. If I change (i.e., mv) the name of the file to
>>> something else, emacs behaves normally and lets me edit the file just
>>> like any other file. So I'm pretty sure that the problem is that emacs
>>> has a problem with the file name and thinks I shouldn't be allowed to
>>> edit it. How do I turn this behavior off?
>>
>> What does Emacs say if you type this:
>>
>> M-: major-mode RET
>>
>> in the buffer that visits this file you aren't allowed to edit?
>>
>
> image-mode
If I do "M-x text-mode", it's still not possible to edit the file... I
still get the message "Text is read-only".
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 17:59 ` ken
@ 2013-05-13 18:10 ` Eli Zaretskii
2013-05-13 18:15 ` Bob Proulx
1 sibling, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-13 18:10 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Mon, 13 May 2013 13:59:52 -0400
> From: ken <gebser@mousecar.com>
> CC: Eli Zaretskii <eliz@gnu.org>
>
> >> What does Emacs say if you type this:
> >>
> >> M-: major-mode RET
> >>
> >> in the buffer that visits this file you aren't allowed to edit?
> >>
> >
> > image-mode
>
> If I do "M-x text-mode", it's still not possible to edit the file... I
> still get the message "Text is read-only".
What is the name of that file?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
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>
1 sibling, 2 replies; 41+ messages in thread
From: Bob Proulx @ 2013-05-13 18:15 UTC (permalink / raw)
To: help-gnu-emacs
ken wrote:
> If I do "M-x text-mode", it's still not possible to edit the file...
> I still get the message "Text is read-only".
Use:
C-x C-q
Which means:
C-x C-q runs the command read-only-mode
Change whether the current buffer is read-only.
Good for an individual one-off named file that you don't normally want
to edit.
Bob
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 18:15 ` Bob Proulx
@ 2013-05-14 2:26 ` ken
[not found] ` <mailman.25692.1368498372.855.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 41+ messages in thread
From: ken @ 2013-05-14 2:26 UTC (permalink / raw)
To: help-gnu-emacs
n 05/13/2013 02:15 PM Bob Proulx wrote:
> ken wrote:
>> If I do "M-x text-mode", it's still not possible to edit the file...
>> I still get the message "Text is read-only".
>
> Use:
>
> C-x C-q
>
> Which means:
>
> C-x C-q runs the command read-only-mode
> Change whether the current buffer is read-only.
>
> Good for an individual one-off named file that you don't normally want
> to edit.
>
> Bob
>
This puts the buffer *into* read-only mode but doing the same again
doesn't toggle out of it. This isn't how the documentation says it's
supposed to work, but that's what happens.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-13 17:08 ` Eli Zaretskii
@ 2013-05-14 2:34 ` ken
2013-05-14 6:46 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: ken @ 2013-05-14 2:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On 05/13/2013 01:08 PM Eli Zaretskii wrote:
>> Date: Mon, 13 May 2013 12:51:55 -0400
>> From: ken <gebser@mousecar.com>
>> CC: help-gnu-emacs@gnu.org
>>
>>
>>> What does Emacs say if you type this:
>>>
>>> M-: major-mode RET
>>>
>>> in the buffer that visits this file you aren't allowed to edit?
>>>
>>
>> image-mode
>
> That explains everything, doesn't it? Your file has a file-name
> extension that matches some image file, so Emacs enters the Image mode
> for it, and doesn't let you edit images (because image-editing
> capabilities are not yet part of Emacs).
>
> Solution: remove that extension from auto-mode-alist, and Bob's your
> uncle.
Cool. That's what I want. So I guess I put something in ~/.emacs...
but what?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
[not found] ` <mailman.25692.1368498372.855.help-gnu-emacs@gnu.org>
@ 2013-05-14 2:38 ` Barry Margolin
0 siblings, 0 replies; 41+ messages in thread
From: Barry Margolin @ 2013-05-14 2:38 UTC (permalink / raw)
To: help-gnu-emacs
In article <mailman.25692.1368498372.855.help-gnu-emacs@gnu.org>,
ken <gebser@mousecar.com> wrote:
> n 05/13/2013 02:15 PM Bob Proulx wrote:
> > ken wrote:
> >> If I do "M-x text-mode", it's still not possible to edit the file...
> >> I still get the message "Text is read-only".
> >
> > Use:
> >
> > C-x C-q
> >
> > Which means:
> >
> > C-x C-q runs the command read-only-mode
> > Change whether the current buffer is read-only.
> >
> > Good for an individual one-off named file that you don't normally want
> > to edit.
> >
> > Bob
> >
>
> This puts the buffer *into* read-only mode but doing the same again
> doesn't toggle out of it. This isn't how the documentation says it's
> supposed to work, but that's what happens.
It does in most buffers. There's something weird going on in that
particular buffer. It sounds like it's setting read-only text properties
on parts of the buffer -- is that part of image editing mode?
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 2:34 ` ken
@ 2013-05-14 6:46 ` Eli Zaretskii
2013-05-14 8:59 ` Peter Dyballa
2013-05-14 11:58 ` "Text is read-only"... except it isn't... or shouldn't be ken
0 siblings, 2 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-14 6:46 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Mon, 13 May 2013 22:34:34 -0400
> From: ken <gebser@mousecar.com>
> CC: help-gnu-emacs@gnu.org
>
> > That explains everything, doesn't it? Your file has a file-name
> > extension that matches some image file, so Emacs enters the Image mode
> > for it, and doesn't let you edit images (because image-editing
> > capabilities are not yet part of Emacs).
> >
> > Solution: remove that extension from auto-mode-alist, and Bob's your
> > uncle.
>
> Cool. That's what I want. So I guess I put something in ~/.emacs...
> but what?
I don't know what is the file-name extension of that file, so I cannot
give a precise recipe. Assuming for a moment that its extension is
.png, I see that auto-mode-alist includes this element:
("\\.png\\'" . image-mode)
So to remove this, you need to do this:
(delete '("\\.png\\'" . image-mode) auto-mode-alist)
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 6:46 ` Eli Zaretskii
@ 2013-05-14 8:59 ` Peter Dyballa
2013-05-14 12:22 ` ken
2013-05-14 11:58 ` "Text is read-only"... except it isn't... or shouldn't be ken
1 sibling, 1 reply; 41+ messages in thread
From: Peter Dyballa @ 2013-05-14 8:59 UTC (permalink / raw)
To: Eli Zaretskii, ken; +Cc: help-gnu-emacs
Am 14.05.2013 um 08:46 schrieb Eli Zaretskii:
>>> Solution: remove that extension from auto-mode-alist, and Bob's your
>>> uncle.
>>
>> Cool. That's what I want. So I guess I put something in ~/.emacs...
>> but what?
>
> I don't know what is the file-name extension of that file, so I cannot
> give a precise recipe. Assuming for a moment that its extension is
> .png, I see that auto-mode-alist includes this element:
>
> ("\\.png\\'" . image-mode)
>
> So to remove this, you need to do this:
>
> (delete '("\\.png\\'" . image-mode) auto-mode-alist)
Since this removes all image support from PNG (or the actual type of) files it might be more useful to either rename the file temporarily or to create a link with an extension like .txt and edit that link.
--
Greetings
Pete
If you don't find it in the index, look very carefully through the entire catalogue.
– Sears, Roebuck, and Co., Consumer's Guide, 1897
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 6:46 ` Eli Zaretskii
2013-05-14 8:59 ` Peter Dyballa
@ 2013-05-14 11:58 ` ken
1 sibling, 0 replies; 41+ messages in thread
From: ken @ 2013-05-14 11:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On 05/14/2013 02:46 AM Eli Zaretskii wrote:
>> Date: Mon, 13 May 2013 22:34:34 -0400
>> From: ken <gebser@mousecar.com>
>> CC: help-gnu-emacs@gnu.org
>>
>>> That explains everything, doesn't it? Your file has a file-name
>>> extension that matches some image file, so Emacs enters the Image mode
>>> for it, and doesn't let you edit images (because image-editing
>>> capabilities are not yet part of Emacs).
>>>
>>> Solution: remove that extension from auto-mode-alist, and Bob's your
>>> uncle.
>>
>> Cool. That's what I want. So I guess I put something in ~/.emacs...
>> but what?
>
> I don't know what is the file-name extension of that file, so I cannot
> give a precise recipe. Assuming for a moment that its extension is
> .png, I see that auto-mode-alist includes this element:
>
> ("\\.png\\'" . image-mode)
>
> So to remove this, you need to do this:
>
> (delete '("\\.png\\'" . image-mode) auto-mode-alist)
>
Thanks. That worked.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 8:59 ` Peter Dyballa
@ 2013-05-14 12:22 ` ken
2013-05-14 13:39 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: ken @ 2013-05-14 12:22 UTC (permalink / raw)
To: Peter Dyballa; +Cc: help-gnu-emacs
On 05/14/2013 04:59 AM Peter Dyballa wrote:
>
> Am 14.05.2013 um 08:46 schrieb Eli Zaretskii:
>
>>>> Solution: remove that extension from auto-mode-alist, and Bob's
>>>> your uncle.
>>>
>>> Cool. That's what I want. So I guess I put something in
>>> ~/.emacs... but what?
>>
>> I don't know what is the file-name extension of that file, so I
>> cannot give a precise recipe. Assuming for a moment that its
>> extension is .png, I see that auto-mode-alist includes this
>> element:
>>
>> ("\\.png\\'" . image-mode)
>>
>> So to remove this, you need to do this:
>>
>> (delete '("\\.png\\'" . image-mode) auto-mode-alist)
>
> Since this removes all image support from PNG (or the actual type of)
> files it might be more useful to either rename the file temporarily
> or to create a link with an extension like .txt and edit that link.
Yeah, I thought about all that. As I said in my original post though,
I've been happily editing this file with this name for years. I would
sooner switch to using vi on it than to change the file's name in any
way. Second and more importantly, I don't care for the Windozy attitude
toward users, treating then like idiots and upon that rationale, taking
control away from users, or their 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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 12:22 ` ken
@ 2013-05-14 13:39 ` Eli Zaretskii
2013-05-14 20:39 ` ken
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-14 13:39 UTC (permalink / raw)
To: help-gnu-emacs
> 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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 13:39 ` Eli Zaretskii
@ 2013-05-14 20:39 ` ken
2013-05-14 20:42 ` Eli Zaretskii
2013-05-15 5:17 ` Kevin Rodgers
0 siblings, 2 replies; 41+ messages in thread
From: ken @ 2013-05-14 20:39 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
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?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 20:39 ` ken
@ 2013-05-14 20:42 ` Eli Zaretskii
2013-05-14 20:45 ` Jai Dayal
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
1 sibling, 2 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-14 20:42 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Tue, 14 May 2013 16:39:59 -0400
> From: ken <gebser@mousecar.com>
> CC: help-gnu-emacs@gnu.org
>
> 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?
I have no idea, and won't have one, unless you disclose the name of
that file.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
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-14 21:36 ` "Text is read-only"... except it isn't... or shouldn't be ken
1 sibling, 2 replies; 41+ messages in thread
From: Jai Dayal @ 2013-05-14 20:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
How do I unsubscribe to this trivial list
On Tue, May 14, 2013 at 1:42 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Tue, 14 May 2013 16:39:59 -0400
> > From: ken <gebser@mousecar.com>
> > CC: help-gnu-emacs@gnu.org
> >
> > 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?
>
> I have no idea, and won't have one, unless you disclose the name of
> that file.
>
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 20:42 ` Eli Zaretskii
2013-05-14 20:45 ` Jai Dayal
@ 2013-05-14 21:36 ` ken
1 sibling, 0 replies; 41+ messages in thread
From: ken @ 2013-05-14 21:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On 05/14/2013 04:42 PM Eli Zaretskii wrote:
>> Date: Tue, 14 May 2013 16:39:59 -0400
>> From: ken <gebser@mousecar.com>
>> CC: help-gnu-emacs@gnu.org
>>
>> 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?
>
> I have no idea, and won't have one, unless you disclose the name of
> that file.
>
list.gif
Would it make a difference if the basename (without the extension) were
named something else?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
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
1 sibling, 0 replies; 41+ messages in thread
From: Óscar Fuentes @ 2013-05-14 21:39 UTC (permalink / raw)
To: Jai Dayal; +Cc: help-gnu-emacs
Jai Dayal <dayalsoap@gmail.com> writes:
> How do I unsubscribe to this trivial list
See the bottom of this page:
https://lists.gnu.org/mailman/listinfo/help-gnu-emacs
You are served.
^ permalink raw reply [flat|nested] 41+ messages in thread
* How to unsubscribe (was: "Text is read-only"... except it isn't... or shouldn't be)
2013-05-14 20:45 ` Jai Dayal
2013-05-14 21:39 ` Óscar Fuentes
@ 2013-05-14 23:23 ` Bob Proulx
2013-05-15 2:16 ` Jai Dayal
1 sibling, 1 reply; 41+ messages in thread
From: Bob Proulx @ 2013-05-14 23:23 UTC (permalink / raw)
To: help-gnu-emacs
Jai Dayal wrote:
> How do I unsubscribe to this trivial list
You would unsubscribe by the same method you used to subscribe. If
you had emailed help-gnu-emacs-request@gnu.org with a "subscribe"
commend then email it again with "unsubscribe" command. If you used
the web interface before then use the web interface again.
https://lists.gnu.org/mailman/listinfo/help-gnu-emacs
I tend not to like the web interface because it is so far removed
from email that people forget how they did it. At least with email
the control addresses can be derived from knowing the main mailing
list address.
In addition every mailing list message includes this information in
the headers. The List-* headers are standard and every mailing list
includes them.
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
<mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
If all else fails then write to the mailing list admins and ask for
assistance. The humans who run mailing lists can be found by
appending -OWNER to the end of the mailing list address.
help-gnu-emacs-OWNER@gnu.org
Bob
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: How to unsubscribe (was: "Text is read-only"... except it isn't... or shouldn't be)
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
0 siblings, 2 replies; 41+ messages in thread
From: Jai Dayal @ 2013-05-15 2:16 UTC (permalink / raw)
To: help-gnu-emacs
There are no headers for me. Emacs users make erroneous assumptions again!!
On Tue, May 14, 2013 at 4:23 PM, Bob Proulx <bob@proulx.com> wrote:
> Jai Dayal wrote:
> > How do I unsubscribe to this trivial list
>
> You would unsubscribe by the same method you used to subscribe. If
> you had emailed help-gnu-emacs-request@gnu.org with a "subscribe"
> commend then email it again with "unsubscribe" command. If you used
> the web interface before then use the web interface again.
>
> https://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
> I tend not to like the web interface because it is so far removed
> from email that people forget how they did it. At least with email
> the control addresses can be derived from knowing the main mailing
> list address.
>
> In addition every mailing list message includes this information in
> the headers. The List-* headers are standard and every mailing list
> includes them.
>
> List-Id: Users list for the GNU Emacs text editor <
> help-gnu-emacs.gnu.org>
> List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs
> >,
> <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
> List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
> List-Post: <mailto:help-gnu-emacs@gnu.org>
> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
> <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
>
> If all else fails then write to the mailing list admins and ask for
> assistance. The humans who run mailing lists can be found by
> appending -OWNER to the end of the mailing list address.
>
> help-gnu-emacs-OWNER@gnu.org
>
> Bob
>
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-14 20:39 ` ken
2013-05-14 20:42 ` Eli Zaretskii
@ 2013-05-15 5:17 ` Kevin Rodgers
2013-05-15 7:28 ` Eli Zaretskii
2013-05-15 11:48 ` ken
1 sibling, 2 replies; 41+ messages in thread
From: Kevin Rodgers @ 2013-05-15 5:17 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: How to unsubscribe (was: "Text is read-only"... except it isn't... or shouldn't be)
2013-05-15 2:16 ` Jai Dayal
@ 2013-05-15 7:23 ` Eli Zaretskii
2013-05-16 12:50 ` Suvayu Ali
1 sibling, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-15 7:23 UTC (permalink / raw)
To: help-gnu-emacs
> From: Jai Dayal <dayalsoap@gmail.com>
> Date: Tue, 14 May 2013 19:16:59 -0700
>
> There are no headers for me. Emacs users make erroneous assumptions again!!
There always are. You just probably don't know how to display them in
whatever email client you are using. The only assumption was that you
do know that.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-15 5:17 ` Kevin Rodgers
@ 2013-05-15 7:28 ` Eli Zaretskii
2013-05-15 11:56 ` ken
[not found] ` <mailman.25840.1368618972.855.help-gnu-emacs@gnu.org>
2013-05-15 11:48 ` ken
1 sibling, 2 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-15 7:28 UTC (permalink / raw)
To: help-gnu-emacs
> From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
> Date: Tue, 14 May 2013 23:17:44 -0600
>
> 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.
If the request is that any *.gif file whose signature doesn't match be
rejected by image-mode, then I suggest to file a feature request bug
using "M-x report-emacs-bug RET".
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-15 5:17 ` Kevin Rodgers
2013-05-15 7:28 ` Eli Zaretskii
@ 2013-05-15 11:48 ` ken
2013-05-16 6:27 ` Kevin Rodgers
1 sibling, 1 reply; 41+ messages in thread
From: ken @ 2013-05-15 11:48 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
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>
1 sibling, 1 reply; 41+ messages in thread
From: ken @ 2013-05-15 11:56 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On 05/15/2013 03:28 AM Eli Zaretskii wrote:
>> From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
>> Date: Tue, 14 May 2013 23:17:44 -0600
>>
>> ....
>
> If the request is that any *.gif file whose signature doesn't match be
> rejected by image-mode, then I suggest to file a feature request bug
> using "M-x report-emacs-bug RET".
>
As said earlier, this problem first appeared after my last emacs
upgrade, and this after editing this same file for, perhaps ten, perhaps
more years. It would seem then that someone upstream decided already
not to make magic-mode-alist the default.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-15 11:56 ` ken
@ 2013-05-15 12:30 ` Eli Zaretskii
0 siblings, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2013-05-15 12:30 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Wed, 15 May 2013 07:56:01 -0400
> From: ken <gebser@mousecar.com>
> CC: help-gnu-emacs@gnu.org
>
> > If the request is that any *.gif file whose signature doesn't match be
> > rejected by image-mode, then I suggest to file a feature request bug
> > using "M-x report-emacs-bug RET".
> >
>
> As said earlier, this problem first appeared after my last emacs
> upgrade, and this after editing this same file for, perhaps ten, perhaps
> more years. It would seem then that someone upstream decided already
> not to make magic-mode-alist the default.
If you want this issue to be fixed, I suggest to report it as a bug.
Otherwise, you will have to hack auto-mode-alist forever. Which is
fine with me, if it suits you, because I don't have a file named
list.gif that is nowhere near a GIF image.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
[not found] ` <mailman.25840.1368618972.855.help-gnu-emacs@gnu.org>
@ 2013-05-16 3:49 ` Jason Rumney
0 siblings, 0 replies; 41+ messages in thread
From: Jason Rumney @ 2013-05-16 3:49 UTC (permalink / raw)
To: help-gnu-emacs
On Wednesday, 15 May 2013 19:56:01 UTC+8, ken wrote:
> As said earlier, this problem first appeared after my last emacs
> upgrade
This information is meaningless without specifying which version you upgraded from.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: "Text is read-only"... except it isn't... or shouldn't be
2013-05-15 11:48 ` ken
@ 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
0 siblings, 1 reply; 41+ messages in thread
From: Kevin Rodgers @ 2013-05-16 6:27 UTC (permalink / raw)
To: help-gnu-emacs
On 5/15/13 5:48 AM, ken wrote:
> 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:
>>>> 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.
No, you misunderstand. After file local variables and
interpreter-mode-alist, magic-mode-alist is merely the first relevant
option that is consulted when automatically setting the major mode.
Then auto-mode-alist (which matches the file name), then
magic-fallback-mode-alist (which matches the file contents, like
magic-mode-alist, but which is not nil by default).
That is why I suggested you actually read the "Choosing Modes" section of the
Emacs manual.
Any part of that algorithm might have changed between your unnamed previous
version and the current Emacs version, probably in response to specific bug
reports and after review by the maintainers.
> 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?
No, t is not a valid alist.
You could remove the ".gif" entry from auto-mode-alist, and add an entry to
magic-fallback-mode-alist. According to my /usr/share/file/magic, the regexp
should be "\\`GIF8".
Here is my guess at the lisp:
(setq auto-mode-alist
(remove '("\\.gif\\'" . image-mode) auto-mode-alist))
(setq magic-fallback-mode-alist
(cons '("\\`GIF8" . image-mode) magic-fallback-mode-alist))
>> 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.
More precisely: If there is an entry in magic-mode-alist that matches the
filecontents, it has precedence over 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.
Yes: Instead of trying to detect text files by their content, detect all the
other kinds of files by their content or name (and then default to Fundamental
mode).
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 41+ messages in thread
* Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
2013-05-16 6:27 ` Kevin Rodgers
@ 2013-05-16 11:08 ` ken
2013-05-16 13:30 ` Kevin Rodgers
2013-05-16 14:23 ` ken
0 siblings, 2 replies; 41+ messages in thread
From: ken @ 2013-05-16 11:08 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On 05/16/2013 02:27 AM Kevin Rodgers wrote:
> On 5/15/13 5:48 AM, ken wrote:
>> 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:
>>>>> Emacs does look at the magic signature, see magic-mode-alist.
>>>>
>>>> ....
>
> Yes: Instead of trying to detect text files by their content, detect all
> the
> other kinds of files by their content or name (and then default to
> Fundamental
> mode).
>
So given this:
echo This is not an image file. > list.gif; emacs list.gif &
which mode should emacs invoke?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: How to unsubscribe (was: "Text is read-only"... except it isn't... or shouldn't be)
2013-05-15 2:16 ` Jai Dayal
2013-05-15 7:23 ` Eli Zaretskii
@ 2013-05-16 12:50 ` Suvayu Ali
1 sibling, 0 replies; 41+ messages in thread
From: Suvayu Ali @ 2013-05-16 12:50 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, May 14, 2013 at 07:16:59PM -0700, Jai Dayal wrote:
> There are no headers for me. Emacs users make erroneous assumptions again!!
It seems you are using the Gmail web interface. To see the headers
click on "Show original" on the drop down menu on your top right.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
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:23 ` ken
1 sibling, 1 reply; 41+ messages in thread
From: Kevin Rodgers @ 2013-05-16 13:30 UTC (permalink / raw)
To: help-gnu-emacs
On 5/16/13 5:08 AM, ken wrote:
> On 05/16/2013 02:27 AM Kevin Rodgers wrote:
>> On 5/15/13 5:48 AM, ken wrote:
>>> 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:
>>>>>> Emacs does look at the magic signature, see magic-mode-alist.
>>>>>
>>>>> ....
>>
>> Yes: Instead of trying to detect text files by their content, detect all
>> the
>> other kinds of files by their content or name (and then default to
>> Fundamental
>> mode).
>>
>
> So given this:
>
> echo This is not an image file. > list.gif; emacs list.gif &
>
> which mode should emacs invoke?
If you agree with the convention that .gif files are GIF images, then
image-mode.
If you choose to violate that convention, then I suggest:
echo -e "-*- mode: Text;-*-\nThis is not an image file." > list.gif; emacs list.gif
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
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:23 ` ken
2013-05-16 14:41 ` Peter Dyballa
2013-05-16 14:48 ` Dmitry Gutov
1 sibling, 2 replies; 41+ messages in thread
From: ken @ 2013-05-16 14:23 UTC (permalink / raw)
Cc: help-gnu-emacs, Kevin Rodgers
On 05/16/2013 07:08 AM ken wrote:
> On 05/16/2013 02:27 AM Kevin Rodgers wrote:
>> On 5/15/13 5:48 AM, ken wrote:
>>> 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:
>>>>>> Emacs does look at the magic signature, see magic-mode-alist.
>>>>>
>>>>> ....
>>
>> Yes: Instead of trying to detect text files by their content, detect all
>> the
>> other kinds of files by their content or name (and then default to
>> Fundamental
>> mode).
>>
>
> So given this:
>
> echo This is not an image file. > list.gif; emacs list.gif &
>
> which mode should emacs invoke?
>
If this question can't be answered straightforwardly and unambiguously,
then there's really no sense in discussing code... or filing a bug
report. For how could it be determined whether the code is working or not?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
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
0 siblings, 2 replies; 41+ messages in thread
From: ken @ 2013-05-16 14:26 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On 05/16/2013 09:30 AM Kevin Rodgers wrote:
> On 5/16/13 5:08 AM, ken wrote:
>> On 05/16/2013 02:27 AM Kevin Rodgers wrote:
>>> On 5/15/13 5:48 AM, ken wrote:
>>>> 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:
>>>>>>> Emacs does look at the magic signature, see magic-mode-alist.
>>>>>>
>>>>>> ....
>>>
>>> Yes: Instead of trying to detect text files by their content, detect all
>>> the
>>> other kinds of files by their content or name (and then default to
>>> Fundamental
>>> mode).
>>>
>>
>> So given this:
>>
>> echo This is not an image file. > list.gif; emacs list.gif &
>>
>> which mode should emacs invoke?
>
> If you agree with the convention that .gif files are GIF images, then
> image-mode.
>
> If you choose to violate that convention, then I suggest:
>
> echo -e "-*- mode: Text;-*-\nThis is not an image file." > list.gif;
> emacs list.gif
>
$ echo This is not an image file. > list.gif; file list.gif
list.gif: ASCII text
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
2013-05-16 14:26 ` ken
@ 2013-05-16 14:39 ` Peter Dyballa
2013-05-18 13:59 ` Kevin Rodgers
1 sibling, 0 replies; 41+ messages in thread
From: Peter Dyballa @ 2013-05-16 14:39 UTC (permalink / raw)
To: gebser; +Cc: help-gnu-emacs, Kevin Rodgers
Am 16.05.2013 um 16:26 schrieb ken:
> $ echo This is not an image file. > list.gif; file list.gif
> list.gif: ASCII text
File always reads a few bytes into the file. You can cleverly use file to suggest GNU Emacs to open your GIF file as a text file.
--
Greetings
Pete
There are very few jobs that actually require a penis or vagina. All other jobs should be open to everybody.
– Florynce Kennedy
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
2013-05-16 14:23 ` ken
@ 2013-05-16 14:41 ` Peter Dyballa
2013-05-16 14:48 ` Dmitry Gutov
1 sibling, 0 replies; 41+ messages in thread
From: Peter Dyballa @ 2013-05-16 14:41 UTC (permalink / raw)
To: gebser; +Cc: help-gnu-emacs, Kevin Rodgers
Am 16.05.2013 um 16:23 schrieb ken:
>> which mode should emacs invoke?
>>
>
> If this question can't be answered straightforwardly and unambiguously, then there's really no sense in discussing code... or filing a bug report. For how could it be determined whether the code is working or not?
My collection of GNU Emacsen 22.1…24.3.50 open your GIF file in Image mode, when invoked with -Q. This is clean, reliable, and straightforward behaviour.
--
Greetings
Pete
If the majority of cooking accidents happen in the kitchen, then why don't we just cook in other rooms?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
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
1 sibling, 1 reply; 41+ messages in thread
From: Dmitry Gutov @ 2013-05-16 14:48 UTC (permalink / raw)
To: ken; +Cc: help-gnu-emacs, Kevin Rodgers
ken <gebser@mousecar.com> writes:
> If this question can't be answered straightforwardly and
> unambiguously, then there's really no sense in discussing code... or
> filing a bug report. For how could it be determined whether the code
> is working or not?
The code is working as intended. If you disagree with its behavior, you
should file a bug report like someone already suggested.
The bug tracker is not only used for glaring bugs, for also for feature
requests, etc.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
2013-05-16 14:48 ` Dmitry Gutov
@ 2013-05-16 22:00 ` Xue Fuqiao
0 siblings, 0 replies; 41+ messages in thread
From: Xue Fuqiao @ 2013-05-16 22:00 UTC (permalink / raw)
To: ken; +Cc: help-gnu-emacs, Kevin Rodgers, Dmitry Gutov
On Thu, May 16, 2013 at 10:48 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
> ken <gebser@mousecar.com> writes:
>
>> If this question can't be answered straightforwardly and
>> unambiguously, then there's really no sense in discussing code... or
>> filing a bug report. For how could it be determined whether the code
>> is working or not?
>
> The code is working as intended. If you disagree with its behavior, you
> should file a bug report like someone already suggested.
>
> The bug tracker is not only used for glaring bugs, for also for feature
> requests, etc.
+1 And you can also submit patches to bug-gnu-emacs.
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
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
1 sibling, 1 reply; 41+ messages in thread
From: Kevin Rodgers @ 2013-05-18 13:59 UTC (permalink / raw)
To: help-gnu-emacs
On 5/16/13 8:26 AM, ken wrote:
> On 05/16/2013 09:30 AM Kevin Rodgers wrote:
>> On 5/16/13 5:08 AM, ken wrote:
>>> So given this:
>>>
>>> echo This is not an image file. > list.gif; emacs list.gif &
>>>
>>> which mode should emacs invoke?
>>
>> If you agree with the convention that .gif files are GIF images, then
>> image-mode.
>>
>> If you choose to violate that convention, then I suggest:
>>
>> echo -e "-*- mode: Text;-*-\nThis is not an image file." > list.gif;
>> emacs list.gif
>
> $ echo This is not an image file. > list.gif; file list.gif
> list.gif: ASCII text
The first step in getting emacs to emulate the file command is
(setq auto-mode-alist nil)
Then map /etc/magic into magic-mode-alist and interpreter-mode-alist.
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Essential question [re: Re: "Text is read-only"... except it isn't... or shouldn't be]
2013-05-18 13:59 ` Kevin Rodgers
@ 2013-05-19 12:10 ` ken
0 siblings, 0 replies; 41+ messages in thread
From: ken @ 2013-05-19 12:10 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On 05/18/2013 09:59 AM Kevin Rodgers wrote:
> On 5/16/13 8:26 AM, ken wrote:
>> On 05/16/2013 09:30 AM Kevin Rodgers wrote:
>>> On 5/16/13 5:08 AM, ken wrote:
>>>> So given this:
>>>>
>>>> echo This is not an image file. > list.gif; emacs list.gif &
>>>>
>>>> which mode should emacs invoke?
>>>
>>> If you agree with the convention that .gif files are GIF images, then
>>> image-mode.
>>>
>>> If you choose to violate that convention, then I suggest:
>>>
>>> echo -e "-*- mode: Text;-*-\nThis is not an image file." > list.gif;
>>> emacs list.gif
>>
>> $ echo This is not an image file. > list.gif; file list.gif
>> list.gif: ASCII text
>
> The first step in getting emacs to emulate the file command is
>
> (setq auto-mode-alist nil)
>
> Then map /etc/magic into magic-mode-alist and interpreter-mode-alist.
>
Thanks, Kevin. But there are already way too many projects in front of
me for the foreseeable future (including some emacs development). I
simply can't take on any more. Moreover, this wasn't an issue in all
the previous versions of emacs I've used for at least ten years, so
probably something was changed in this or a recent version which maybe
shouldn't have been. So the regular developers would be in a much
better position to address this issue than I would.
Because it might be useful to those developers, I'll put into the record
here the version used last (in which this issue didn't exist):
$ yum info emacs |grep -i 'version\|release'
Version : 21.4
Release : 24.el5
In the past I've filed a few bug reports/feature requests and for the
most part found the experience unpleasant and not useful. So I don't do
that anymore. However, if anyone else wants to write up a ticket, most
all the information needed is already contained in this thread.
Thanks again.
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2013-05-19 12:10 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).