* bug#13261: 24.3.50; unclear behavior & msg: "File is read-only on disk. Change buffer mode?"
@ 2012-12-24 0:05 Drew Adams
2014-02-09 2:45 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2012-12-24 0:05 UTC (permalink / raw)
To: 13261
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@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'
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#13261: 24.3.50; unclear behavior & msg: "File is read-only on disk. Change buffer mode?"
2012-12-24 0:05 bug#13261: 24.3.50; unclear behavior & msg: "File is read-only on disk. Change buffer mode?" Drew Adams
@ 2014-02-09 2:45 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-09 2:45 UTC (permalink / raw)
To: Drew Adams; +Cc: 13261
"Drew Adams" <drew.adams@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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-09 2:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-24 0:05 bug#13261: 24.3.50; unclear behavior & msg: "File is read-only on disk. Change buffer mode?" Drew Adams
2014-02-09 2:45 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.