all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* global-autorevert-mode does not preserve read-only status
@ 2004-08-31 10:31 Jari Aalto
  2004-09-01  4:57 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Jari Aalto @ 2004-08-31 10:31 UTC (permalink / raw)



Test suite:

    1. C-x C-f /var/log/syslog (or any other growing log file)
    2. That buffer shoudl not be edited, so we want C-x C-q
    3. M-x global-autorevert-mode (start following all logs)

... after a while the log buffer is reverted, but unfortunately the
read only status that the user activated for the buffer is not
preserved after auto reverted has reloaded the buffer.

I think the state should be preserved as user had set it.

Jari

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

* Re: global-autorevert-mode does not preserve read-only status
  2004-08-31 10:31 global-autorevert-mode does not preserve read-only status Jari Aalto
@ 2004-09-01  4:57 ` Richard Stallman
  2004-09-01 14:32   ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2004-09-01  4:57 UTC (permalink / raw)
  Cc: emacs-devel

	1. C-x C-f /var/log/syslog (or any other growing log file)
	2. That buffer shoudl not be edited, so we want C-x C-q
	3. M-x global-autorevert-mode (start following all logs)

    ... after a while the log buffer is reverted, but unfortunately the
    read only status that the user activated for the buffer is not
    preserved after auto reverted has reloaded the buffer.

    I think the state should be preserved as user had set it.

For Autorevert mode, I agree.
Manual revert should recalculate the read-only status based
on the file, as it does now.

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

* Re: global-autorevert-mode does not preserve read-only status
  2004-09-01  4:57 ` Richard Stallman
@ 2004-09-01 14:32   ` Stefan Monnier
  2004-09-01 17:52     ` Luc Teirlinck
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2004-09-01 14:32 UTC (permalink / raw)
  Cc: Jari Aalto, emacs-devel

>     I think the state should be preserved as user had set it.

> For Autorevert mode, I agree.

Isn't that already the case in CVS?
I seem to remeber changing auto-revert-mode so as to pass the
`preserve-modes' argument to revert-buffer, specifically to fix
this problem.


        Stefan

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

* Re: global-autorevert-mode does not preserve read-only status
  2004-09-01 14:32   ` Stefan Monnier
@ 2004-09-01 17:52     ` Luc Teirlinck
  0 siblings, 0 replies; 4+ messages in thread
From: Luc Teirlinck @ 2004-09-01 17:52 UTC (permalink / raw)
  Cc: rms, jari.aalto, emacs-devel

Stefan Monnier wrote:

   >     I think the state should be preserved as user had set it.

   > For Autorevert mode, I agree.

   Isn't that already the case in CVS?

No.  (But it is true for`auto-revert-tail-mode'.)

   I seem to remeber changing auto-revert-mode so as to pass the
   `preserve-modes' argument to revert-buffer, specifically to fix
   this problem.

`after-find-file' resets buffer-read-only regardless of its NOMODES
argument.

The following trivial patch makes autorevert preserve read-onlyness.
I could install if there are no objections.

===File ~/autorevert-diff===================================
*** autorevert.el	24 Jul 2004 10:28:56 -0500	1.37
--- autorevert.el	01 Sep 2004 12:14:17 -0500	
***************
*** 421,427 ****
  	   'no-mini t))
  	(if auto-revert-tail-mode
  	    (auto-revert-tail-handler)
! 	  (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
  	(when buffer-file-name
  	  (when eob (goto-char (point-max)))
  	  (dolist (window eoblist)
--- 421,428 ----
  	   'no-mini t))
  	(if auto-revert-tail-mode
  	    (auto-revert-tail-handler)
! 	  (let ((buffer-read-only buffer-read-only))
! 	    (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))
  	(when buffer-file-name
  	  (when eob (goto-char (point-max)))
  	  (dolist (window eoblist)
============================================================

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

end of thread, other threads:[~2004-09-01 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 10:31 global-autorevert-mode does not preserve read-only status Jari Aalto
2004-09-01  4:57 ` Richard Stallman
2004-09-01 14:32   ` Stefan Monnier
2004-09-01 17:52     ` Luc Teirlinck

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.