Subject: Re: bug#26947: Preserve read-only when debugger with let-bound inhibit-read-only t.

From: Stefan Monnier <[email-masked]>
Date: Wed, 17 May 2017 09:34:15 -0400

> Entering the debugger when inhibit-read-only is let-bound to `t` causes all
> buffers to be read/write even though they may have `buffer-read-only` set to
> `t`.
[...]
> (when inhibit-read-only
>   (setq inhibit-read-only nil))

Actually, the better option is probably to

    (let ((inhibit-read-only nil))

around debug, like we already do with various other variables.

Of course, this is a general problem with dynamic scoping.

Maybe a better solution would be for `debug` to use another thread, so
it's not affected by those dynamic bindings of the debugged code.

        Stefan