This is a very strange issue and its cause is hard to determine. I often leave Emacs open for days, or even weeks at a time. My current emacs-uptime
is 9 and a half days. That's pretty normal and sometimes it can be twice as long or longer.
However, sometimes when I run Emacs for this long and I happen to push Emacs particularly hard (running lots of processes, opening big files, using strange settings, etc.) something weird happens after some days. Emacs randomly blinks all of a sudden, like it's doing redisplay
or something. This lasts for about a second or less. Thereafter, read-only text is not read-only anymore. I mean that any read-only text anywhere in Emacs is no longer read-only. REPL prompts, info buffers, help buffers, eshell prompts, buffers set to view-mode
, any buffer in read-only-mode
, anything else you can think of.
Basically, all read-only text becomes writable. At all, anywhere. I can accidentally clobber documentation by pressing a key that would normally do nothing or I can accidentally delete a REPL prompt which can screw up all kinds of things when developing. The only way around this issue (that I know of) is to restart Emacs. This is not always a viable solution. As you can see, this is a very annoying and often serious problem. But I cannot find anyone else online who has had this same issue.
So how can I determine what is causing this issue? And more importantly, how can I fix it?
Here is my emacs-version
:
GNU Emacs 26.1 (build 5, x86_64-apple-darwin17.6.0, Carbon Version 158 AppKit 1561.4)
of 2018-07-17
I.e., I'm on the Emacs Mac Port (by Yamamoto Mitsuharu) version 26.1. Also, my OS is macOS 10.13.6. I am happy to give more information about my setup as it becomes necessary.
M-x report-emacs-bug
. In either case, you probably will need to provide more info, preferably a recipe to repro the problem (which I realize would likely be hard to come up with).buffer-read-only
ist
andinhibit-read-only
isnil
? Is it true for text that has non-nil
propertyread-only
?inhibit-read-only
was set tot
. After I reset this variable tonil
using(setq inhibit-read-only nil)
, the problem seems to have gone away completely. I was not aware of this variable so I did not check it. If you make this an answer, I'll gladly accept it. Thank you!inhibit-read-only
is intended to be dynamically-bound in order to temporarily allow modification of read-only text (where appropriate). In order for it to end up set 'permanently', I would speculate that some badly-behaved code is neither setting it in a temporary scope nor usingcondition-case
to ensure it gets restored, and it got left that way after an error occurred? Someone might be able to suggest a valid reason for it, but it certainly sounds like a bug to me.