unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* inhibit-read-only
@ 2006-02-14 10:37 martin rudalics
  2006-02-14 22:18 ` inhibit-read-only Richard M. Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2006-02-14 10:37 UTC (permalink / raw)


The following makes everything writable:

(let ((debug-on-error t)
       (inhibit-read-only t))
   (error "?"))

It's somehow worrying.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inhibit-read-only
  2006-02-14 10:37 inhibit-read-only martin rudalics
@ 2006-02-14 22:18 ` Richard M. Stallman
  2006-02-15 10:10   ` inhibit-read-only martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Richard M. Stallman @ 2006-02-14 22:18 UTC (permalink / raw)
  Cc: emacs-devel

    The following makes everything writable:

    (let ((debug-on-error t)
	   (inhibit-read-only t))
       (error "?"))

Could you be more precise than "makes everything writable"?  Do you
mean that everything is writable while you are in the debugger?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inhibit-read-only
  2006-02-14 22:18 ` inhibit-read-only Richard M. Stallman
@ 2006-02-15 10:10   ` martin rudalics
  2006-02-16  4:40     ` inhibit-read-only Richard M. Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2006-02-15 10:10 UTC (permalink / raw)
  Cc: emacs-devel

 >     The following makes everything writable:
 >
 >     (let ((debug-on-error t)
 > 	   (inhibit-read-only t))
 >        (error "?"))
 >
 > Could you be more precise than "makes everything writable"?  Do you
 > mean that everything is writable while you are in the debugger?

Yes.  The problem is that `inhibit-read-only' is not buffer-local like
`buffer-read-only'.  Hence, entering the debugger has a rather global
side-effect.  I'm afraid there's nothing that could be done here.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inhibit-read-only
  2006-02-15 10:10   ` inhibit-read-only martin rudalics
@ 2006-02-16  4:40     ` Richard M. Stallman
  2006-02-16 10:23       ` inhibit-read-only martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Richard M. Stallman @ 2006-02-16  4:40 UTC (permalink / raw)
  Cc: emacs-devel

    Yes.  The problem is that `inhibit-read-only' is not buffer-local like
    `buffer-read-only'.  Hence, entering the debugger has a rather global
    side-effect.  I'm afraid there's nothing that could be done here.

We can make the buffer bind inhibit-read-only to nil, saving the
outside value.  It does that for other variables.

Does this change do it?


*** debug.el	07 Feb 2006 18:16:18 -0500	1.98
--- debug.el	15 Feb 2006 22:22:38 -0500	
***************
*** 88,93 ****
--- 88,94 ----
  (defvar debugger-outer-standard-output)
  (defvar debugger-outer-inhibit-redisplay)
  (defvar debugger-outer-cursor-in-echo-area)
+ (defvar debugger-outer-inhibit-read-only)
  (defvar debugger-will-be-back nil
    "Non-nil if we expect to get back in the debugger soon.")
  
***************
*** 151,156 ****
--- 152,158 ----
  	  (debugger-outer-standard-output standard-output)
  	  (debugger-outer-inhibit-redisplay inhibit-redisplay)
  	  (debugger-outer-cursor-in-echo-area cursor-in-echo-area)
+ 	  (debugger-outer-inhibit-read-only inhibit-read-only)
  	  (debugger-with-timeout-suspend (with-timeout-suspend)))
        ;; Set this instead of binding it, so that `q'
        ;; will not restore it.
***************
*** 171,177 ****
  	     (or enable-recursive-minibuffers (> (minibuffer-depth) 0)))
  	    (standard-input t) (standard-output t)
  	    inhibit-redisplay
! 	    (cursor-in-echo-area nil))
  	(unwind-protect
  	    (save-excursion
  	      (save-window-excursion
--- 173,180 ----
  	     (or enable-recursive-minibuffers (> (minibuffer-depth) 0)))
  	    (standard-input t) (standard-output t)
  	    inhibit-redisplay
! 	    (cursor-in-echo-area nil)
! 	    (inhibit-read-only nil))
  	(unwind-protect
  	    (save-excursion
  	      (save-window-excursion
***************
*** 260,265 ****
--- 263,269 ----
        (setq standard-output debugger-outer-standard-output)
        (setq inhibit-redisplay debugger-outer-inhibit-redisplay)
        (setq cursor-in-echo-area debugger-outer-cursor-in-echo-area)
+       (setq inhibit-read-only debugger-outer-inhibit-read-only)
        (setq debug-on-next-call debugger-step-after-exit)
        debugger-value)))
  \f
***************
*** 541,547 ****
            (standard-input debugger-outer-standard-input)
            (standard-output debugger-outer-standard-output)
            (inhibit-redisplay debugger-outer-inhibit-redisplay)
!           (cursor-in-echo-area debugger-outer-cursor-in-echo-area))
        (set-match-data debugger-outer-match-data)
        (prog1
  	  (let ((save-ucc (with-no-warnings unread-command-char)))
--- 545,552 ----
            (standard-input debugger-outer-standard-input)
            (standard-output debugger-outer-standard-output)
            (inhibit-redisplay debugger-outer-inhibit-redisplay)
!           (cursor-in-echo-area debugger-outer-cursor-in-echo-area)
! 	  (inhibit-read-only debugger-outer-inhibit-read-only))
        (set-match-data debugger-outer-match-data)
        (prog1
  	  (let ((save-ucc (with-no-warnings unread-command-char)))
***************
*** 573,578 ****
--- 578,584 ----
          (setq debugger-outer-standard-output standard-output)
          (setq debugger-outer-inhibit-redisplay inhibit-redisplay)
          (setq debugger-outer-cursor-in-echo-area cursor-in-echo-area)
+ 	(setq debugger-outer-inhibit-read-only inhibit-read-only)
          ))))
  
  (defun debugger-eval-expression (exp)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inhibit-read-only
  2006-02-16  4:40     ` inhibit-read-only Richard M. Stallman
@ 2006-02-16 10:23       ` martin rudalics
  0 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2006-02-16 10:23 UTC (permalink / raw)
  Cc: emacs-devel

 > We can make the buffer bind inhibit-read-only to nil, saving the
 > outside value.  It does that for other variables.
 >
 > Does this change do it?

It does and I'd very much like it.  Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-16 10:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-14 10:37 inhibit-read-only martin rudalics
2006-02-14 22:18 ` inhibit-read-only Richard M. Stallman
2006-02-15 10:10   ` inhibit-read-only martin rudalics
2006-02-16  4:40     ` inhibit-read-only Richard M. Stallman
2006-02-16 10:23       ` inhibit-read-only martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).