emacs-devel
[Top][All Lists]
Advanced

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

Re: new tail-mode


From: Luc Teirlinck
Subject: Re: new tail-mode
Date: Thu, 15 Jul 2004 19:30:15 -0500 (CDT)

The Commentary of autorevert.el now contains:

;; Go to the appropriate buffer and press either of:
;;   M-x auto-revert-mode RET
;;   M-x auto-revert-tail-mode RET

without any prior mention of `auto-revert-tail-mode'.  This is
confusing.  What about the patch below?  I can install it if it looks
OK.

In as far as the proposed code change is concerned, I do not
understand what the `auto-revert-tail-mode' which the patch removes is
doing at that place.  At this stage we know that the buffer is not
visiting a file, so `auto-revert-tail-mode' should be nil.  The only
situation in which it could be t is if the user first enables
`auto-revert-tail-mode' and then explicitly makes the buffer visit no
file, a strange thing to do.  If this situation would be worth
worrying about at all, which is not obvious, then the thing to do
would seem to disable `auto-revert-tail-mode' and print a message to
that effect.  The patch below does not do that.

===File ~/auto-revert-diff==================================
*** autorevert.el       14 Jul 2004 16:36:00 -0500      1.35
--- autorevert.el       15 Jul 2004 16:59:47 -0500      
***************
*** 34,40 ****
  ;;
  ;; This package contains two minor modes: Global Auto-Revert Mode and
  ;; Auto-Revert Mode.  Both modes automatically revert buffers
! ;; whenever the corresponding files have been changed on disk.
  ;;
  ;; Auto-Revert Mode can be activated for individual buffers.  Global
  ;; Auto-Revert Mode applies to all file buffers. (If the user option
--- 34,41 ----
  ;;
  ;; This package contains two minor modes: Global Auto-Revert Mode and
  ;; Auto-Revert Mode.  Both modes automatically revert buffers
! ;; whenever the corresponding files have been changed on disk and the
! ;; buffer contains no unsaved changes.
  ;;
  ;; Auto-Revert Mode can be activated for individual buffers.  Global
  ;; Auto-Revert Mode applies to all file buffers. (If the user option
***************
*** 59,64 ****
--- 60,72 ----
  ;; Just put point at the end of the buffer and it will stay there.
  ;; These rules apply to file buffers. For non-file buffers, the
  ;; behavior may be mode dependent.
+ ;; 
+ ;; While you can use Auto Revert Mode to tail a file, this file
+ ;; contains a third minor mode, Auto Revert Tail Mode, which does so
+ ;; more efficiently, as long as you are sure that the file will only
+ ;; change by growing at the end.  It only appends the new output,
+ ;; instead of reverting the entire buffer.  It does so even if the
+ ;; buffer contains unsaved changes.  (Because they will not be lost.)
  
  ;; Usage:
  ;;
***************
*** 389,395 ****
                     (not (file-remote-p buffer-file-name))
                     (file-readable-p buffer-file-name)
                     (not (verify-visited-file-modtime buffer)))
!               (and (or auto-revert-mode auto-revert-tail-mode
                         global-auto-revert-non-file-buffers)
                     revert-buffer-function
                     (boundp 'buffer-stale-function)
--- 397,403 ----
                     (not (file-remote-p buffer-file-name))
                     (file-readable-p buffer-file-name)
                     (not (verify-visited-file-modtime buffer)))
!               (and (or auto-revert-mode
                         global-auto-revert-non-file-buffers)
                     revert-buffer-function
                     (boundp 'buffer-stale-function)
============================================================




reply via email to

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