[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autorevert doesn't change mode-line-modified anymore
From: |
Luc Teirlinck |
Subject: |
Re: autorevert doesn't change mode-line-modified anymore |
Date: |
Tue, 19 Oct 2004 22:33:10 -0500 (CDT) |
I believe that the following docstring for
`auto-revert-preserve-read-only' is better than the one I sent earlier.
I do not know whether it would be worth while to admit a third value,
say 'file, which would only restore the old behavior for file visiting
buffers. That would be easy to implement, if desirable.
===File ~/arv-newdiff=======================================
*** autorevert.el 19 Oct 2004 15:26:46 -0500 1.39
--- autorevert.el 19 Oct 2004 22:09:20 -0500
***************
*** 243,248 ****
--- 243,266 ----
:type 'boolean
:version "21.4")
+ (defcustom auto-revert-preserve-read-only t
+ "If non-nil Auto Revert Mode preserves the read-only status.
+ If nil, auto-reverting a file visiting buffer will update the read-only
+ status of the buffer based on whether the visited file is writable.
+ In non file visiting buffers, auto-reverting while this option is
+ nil behaves like a regular revert in as far as the read only status
+ is concerned. What this concretely means depends on the type of buffer.
+
+ A non-nil value prevents auto-reverting from overriding you if
+ you change the read-only status using \\[toggle-read-only].
+ However, it may not yield the desired behavior when the read-only
+ status of the buffer is determined by the visited file's modes
+ and those modes change. If the latter situation occurs more
+ often in your usage than the former, you can set this option to nil."
+ :group 'auto-revert
+ :type 'boolean
+ :version "21.4")
+
(defvar global-auto-revert-ignore-buffer nil
"*When non-nil, Global Auto-Revert Mode will not revert this buffer.
***************
*** 419,431 ****
(= (window-point window) (point-max))
(push window eoblist)))
'no-mini t))
! (if auto-revert-tail-mode
! (auto-revert-tail-handler)
! ;; Bind buffer-read-only in case user has done C-x C-q,
! ;; so as not to forget that. This gives undesirable results
! ;; when the file's mode changes, but that is less common.
! (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)
--- 437,447 ----
(= (window-point window) (point-max))
(push window eoblist)))
'no-mini t))
! (cond (auto-revert-tail-mode (auto-revert-tail-handler))
! (auto-revert-preserve-read-only
! (let ((buffer-read-only buffer-read-only))
! (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))
! (t (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))
(when buffer-file-name
(when eob (goto-char (point-max)))
(dolist (window eoblist)
============================================================
- Re: autorevert doesn't change mode-line-modified anymore, (continued)
- Re: autorevert doesn't change mode-line-modified anymore, Luc Teirlinck, 2004/10/18
- Re: autorevert doesn't change mode-line-modified anymore, Luc Teirlinck, 2004/10/18
- Re: autorevert doesn't change mode-line-modified anymore, Luc Teirlinck, 2004/10/18
- Re: autorevert doesn't change mode-line-modified anymore, Richard Stallman, 2004/10/19
- Re: autorevert doesn't change mode-line-modified anymore,
Luc Teirlinck <=
- Re: autorevert doesn't change mode-line-modified anymore, Richard Stallman, 2004/10/20
- Re: autorevert doesn't change mode-line-modified anymore, Klaus Zeitler, 2004/10/21
- Re: autorevert doesn't change mode-line-modified anymore, Kim F. Storm, 2004/10/21
- Re: autorevert doesn't change mode-line-modified anymore, Richard Stallman, 2004/10/22