[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: global-autorevert-mode does not preserve read-only status

From: Luc Teirlinck
Subject: Re: global-autorevert-mode does not preserve read-only status
Date: Wed, 1 Sep 2004 12:52:24 -0500 (CDT)

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

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
!         (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
!         (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]