GNU bug report logs - #13261
24.3.50; unclear behavior & msg: "File is read-only on disk. Change buffer mode?"

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 24 Dec 2012 00:07:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13261 in the body.
You can then email your comments to 13261 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13261; Package emacs. (Mon, 24 Dec 2012 00:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 24 Dec 2012 00:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50;
	unclear behavior & msg: "File is read-only on disk. Change buffer
	mode?"
Date: Sun, 23 Dec 2012 16:05:56 -0800
I have some code that first creates a buffer for visiting a file, using
`create-file-buffer', then visits the buffer using `with-current-buffer'
and `insert-file-contents' with non-nil VISIT.  Later the code might use
`find-file' and `revert-buffer', to put the buffer in the right mode
etc.
 
When the file in question is read-only on disk, the user gets queried
with the question in the Subject line.
 
First, the message is unclear: "buffer mode" in Emacs means the major
mode of the buffer.  Is that really what is meant here?  Or does the
message mean changing between read-only and writable "modes"?
 
In my case, the code reverts the buffer, so the major mode does change.
But looking at the Emacs code that issues the query, it seems that it
has only to do with the read-only status and nothing to do with the
major mode (?).  Not clear to me, at least.
 
Second, why is this message issued in the scenario I described?  I am
not claiming that it is incorrect to do so (I don't know).  But it is a
mystery to me how the read-only/writable status is changed here.
 
If I knew what was going on perhaps I could take appropriate action to
inhibit the message.  Looking at the code, it seems that before
reversion the buffer was writable, but after reversion it is read-only,
because of the file status on disk.  Is that right?
 
If so, what is the right way to inhibit this user query?  I do not want
to inhibit read-only mode if the file is read-only.  Do I need to
somehow test the file's disk status and then bind the buffer's
read-only status correspondingly before I call `revert-buffer'?
If so, how?
 
My code does the right thing, at any rate: the buffer after reversion,
which is the first time the user sees it, is read-only.  It is only the
user query that I would like to find some way to suppress.
 
So I am filing this bug report to obtain information, but also
because I think the "buffer mode" part of the message is confusing,
if not misleading.
 
And also because I wonder if there might be an Emacs code bug here.  I
doubt it - this part of the code is no doubt rock solid.  But it's not
yet clear to me what is happening or why.  Thanks in advance for
enlightening me.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-12-18 on MS-W7-DANI
Bzr revision: 111265 eliz <at> gnu.org-20121218190556-x9wmq083vwecgu0f
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -Ic:/emacs/libs/libXpm-3.5.10/include -Ic:/emacs/libs/libXpm-3.5.10/src
 -Ic:/emacs/libs/libpng-dev_1.4.3-1_win32/include
 -Ic:/emacs/libs/zlib-dev_1.2.5-2_win32/include
 -Ic:/emacs/libs/giflib-4.1.4-1-lib/include
 -Ic:/emacs/libs/jpeg-6b-4-lib/include
 -Ic:/emacs/libs/tiff-3.8.2-1-lib/include
 -Ic:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -Ic:/emacs/libs/gnutls-3.0.9-w32-bin/include
 -Ic:/emacs/libs/libiconv-1.9.2-1-lib/include'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13261; Package emacs. (Sun, 09 Feb 2014 02:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 13261 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 13261 <at> debbugs.gnu.org
Subject: Re: bug#13261: 24.3.50;
 unclear behavior & msg: "File is read-only on disk. Change buffer
 mode?"
Date: Sat, 08 Feb 2014 18:45:48 -0800
"Drew Adams" <drew.adams <at> oracle.com> writes:

> First, the message is unclear: "buffer mode" in Emacs means the major
> mode of the buffer.  Is that really what is meant here?  Or does the
> message mean changing between read-only and writable "modes"?

The latter, as far as I can see.  I've now clarified the prompt.

> Second, why is this message issued in the scenario I described?  I am
> not claiming that it is incorrect to do so (I don't know).  But it is a
> mystery to me how the read-only/writable status is changed here.

`find-file-noselect' takes a nowarn parameter...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug marked as fixed in version 24.4, send any further explanations to 13261 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 09 Feb 2014 02:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 09 Mar 2014 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.