all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: autorevert.el
Date: Thu, 4 Mar 2004 22:25:42 -0600 (CST)	[thread overview]
Message-ID: <200403050425.i254PgP21754@raven.dms.auburn.edu> (raw)
In-Reply-To: <jwvsmgoic0l.fsf-monnier+emacs/devel@asado.iro.umontreal.ca> (message from Stefan Monnier on 04 Mar 2004 15:43:40 -0500)

While looking at autorevert.el I noticed another problem.

The docstring of `auto-revert-interval' is wrong.  It says that
setting the variable will apply to buffers put in auto-revert mode
afterwards, but not to buffers already in auto-revert mode.  That
would be bad enough if it were true, but the actual behavior is worse.
The new value does not apply to _any_ buffers until Auto Revert mode
calls `auto-revert-set-timer' for internal reasons, after which it
applies to _all_ buffers.  This is hyper-confusing and makes no sense.
If I remember well, then back in December or so, when this first came
up, you remarked that the behavior, rather than the docstring should
be changed, but apparently the opposite was done.  I did not realize
at the time how bad the actual behavior really was, nor that the new
docstring was wrong.

Below is a patch mending the situation.  Are there any objections
against me applying this patch?

While trying out my patch, I noticed another problem, however.  The
new value will take effect immediately when set through Custom, but
not when set via `set-variable' (unless the user does 
`M-x auto-revert-set-timer' afterwards).  Yet back in November we
reached pretty much a consensus on the following conclusion (quoting
Richard):

    So I guess we have to keep set-variable separate.  However,
    when it operates on a variable that is customizable, and when
    the binding it sets is a global binding, then it could work
    through the Custom mechanism.

This does not seem to have been implemented.  Is anybody currently
working or planning to work on this?

===File ~/autorevert-timer-diff=============================
diff -c /home/teirllm/autorevert-pretimer.el /home/teirllm/emacscvsdir/emacs/lisp/autorevert.el
*** /home/teirllm/autorevert-pretimer.el	Thu Mar  4 17:21:53 2004
--- /home/teirllm/emacscvsdir/emacs/lisp/autorevert.el	Thu Mar  4 20:38:13 2004
***************
*** 103,115 ****
  Never set this variable directly, use the command `auto-revert-mode' instead.")
  (put 'auto-revert-mode 'permanent-local t)
  
  (defcustom auto-revert-interval 5
    "Time, in seconds, between Auto-Revert Mode file checks.
! Setting this variable has no effect on buffers that are already in
! auto-revert-mode; it only affects buffers that are put into
! auto-revert-mode afterwards."
!   :group 'auto-revert
!   :type 'integer)
  
  (defcustom auto-revert-stop-on-user-input t
    "When non-nil Auto-Revert Mode stops checking files on user input."
--- 103,129 ----
  Never set this variable directly, use the command `auto-revert-mode' instead.")
  (put 'auto-revert-mode 'permanent-local t)
  
+ (defvar auto-revert-timer nil
+   "Timer used by Auto-Revert Mode.")
+ 
  (defcustom auto-revert-interval 5
    "Time, in seconds, between Auto-Revert Mode file checks.
! The value may be an integer or floating point number.
! 
! If a timer is already active, there are two ways to make sure
! that the new value will take effect immediately.  You can set
! this variable through Custom or you can call the command
! `auto-revert-set-timer' after setting the variable.  Otherwise,
! the new value will take effect the first time Auto Revert Mode
! calls `auto-revert-set-timer' for internal reasons or in your
! next editing session."
!   :group 'auto-revert
!   :type 'number
!   :set (lambda (variable value)
! 	 (set-default variable value)
! 	 (and (boundp 'auto-revert-timer)
! 	      auto-revert-timer
! 	      (auto-revert-set-timer))))
  
  (defcustom auto-revert-stop-on-user-input t
    "When non-nil Auto-Revert Mode stops checking files on user input."
***************
*** 205,213 ****
  The timer function `auto-revert-buffers' is responsible for purging
  the list of old buffers.")
  
- (defvar auto-revert-timer nil
-   "Timer used by Auto-Revert Mode.")
- 
  (defvar auto-revert-remaining-buffers '()
    "Buffers not checked when user input stopped execution.")
  
--- 219,224 ----
***************
*** 256,261 ****
--- 267,273 ----
  
  (defun auto-revert-set-timer ()
    "Restart or cancel the timer."
+   (interactive)
    (if (timerp auto-revert-timer)
        (cancel-timer auto-revert-timer))
    (setq auto-revert-timer

Diff finished.  Thu Mar  4 21:14:43 2004
============================================================

  parent reply	other threads:[~2004-03-05  4:25 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-02 23:19 autorevert.el Luc Teirlinck
2004-03-03 13:24 ` autorevert.el Stefan Monnier
2004-03-04  5:08   ` autorevert.el Luc Teirlinck
2004-03-04 20:43     ` autorevert.el Stefan Monnier
2004-03-05  4:00       ` autorevert.el Luc Teirlinck
2004-03-13  3:10         ` autorevert.el Luc Teirlinck
2004-03-13 11:29           ` autorevert.el Kai Grossjohann
2004-03-14 23:15           ` autorevert.el Stefan Monnier
2004-03-15  0:08             ` autorevert.el Luc Teirlinck
2004-03-15  2:58               ` autorevert.el Stefan Monnier
2004-03-15  7:04               ` autorevert.el Eli Zaretskii
2004-03-16  4:56                 ` autorevert.el Luc Teirlinck
2004-03-16 19:40                   ` autorevert.el Eli Zaretskii
2004-03-19  4:48                     ` autorevert.el Luc Teirlinck
2004-03-19  6:06                       ` autorevert.el Stefan Monnier
2004-03-21  2:42                         ` autorevert.el Luc Teirlinck
2004-03-23 15:26                           ` autorevert.el Stefan Monnier
2004-03-24  4:20                             ` autorevert.el Luc Teirlinck
2004-03-24  4:25                               ` autorevert.el Luc Teirlinck
2004-03-21  4:19                         ` autorevert.el Luc Teirlinck
2004-03-19 10:19                     ` autorevert.el Kim F. Storm
2004-03-19 14:46                       ` autorevert.el Eli Zaretskii
2004-03-21  3:26                         ` autorevert.el Luc Teirlinck
2004-03-21  6:46                           ` autorevert.el Eli Zaretskii
2004-03-22  2:44                             ` autorevert.el Luc Teirlinck
2004-03-22  6:51                               ` autorevert.el Eli Zaretskii
2004-03-22 19:39                                 ` autorevert.el Luc Teirlinck
2004-03-23 19:40                                   ` autorevert.el Eli Zaretskii
2004-03-23 20:09                                     ` autorevert.el Stefan Monnier
2004-03-24  4:10                                     ` autorevert.el Luc Teirlinck
2004-03-24  6:58                                       ` autorevert.el Eli Zaretskii
2004-03-24 18:03                                         ` autorevert.el Stefan Monnier
2004-03-25  6:56                                           ` autorevert.el Eli Zaretskii
2004-03-25 17:01                                             ` autorevert.el Stefan Monnier
2004-03-24 18:56                                         ` autorevert.el Luc Teirlinck
2004-03-25  6:20                                         ` autorevert.el Luc Teirlinck
2004-03-25  6:49                                           ` autorevert.el Luc Teirlinck
2004-03-25  7:21                                           ` autorevert.el Eli Zaretskii
2004-03-22 19:47                                 ` autorevert.el Luc Teirlinck
2004-03-22 16:23                               ` autorevert.el Stefan Monnier
2004-03-23  4:24                                 ` autorevert.el Eli Zaretskii
2004-03-21 19:22                           ` autorevert.el Richard Stallman
2004-03-16  5:06                 ` autorevert.el Luc Teirlinck
2004-03-05  4:25       ` Luc Teirlinck [this message]
2004-03-05  5:55       ` autorevert.el Luc Teirlinck
2004-03-04  5:34   ` autorevert.el Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403050425.i254PgP21754@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.