emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#19449: closed (25.0.50; `auto-revert-tail-mode' tr


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19449: closed (25.0.50; `auto-revert-tail-mode' tries to revert remote files even if `auto-revert-remote-files' is nil)
Date: Mon, 29 Dec 2014 15:37:02 +0000

Your message dated Mon, 29 Dec 2014 18:36:12 +0300
with message-id <address@hidden>
and subject line Re: bug#19449: 25.0.50; `auto-revert-tail-mode' tries to 
revert remote files even if `auto-revert-remote-files' is nil
has caused the debbugs.gnu.org bug report #19449,
regarding 25.0.50; `auto-revert-tail-mode' tries to revert remote files even if 
`auto-revert-remote-files' is nil
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
19449: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19449
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.0.50; `auto-revert-tail-mode' tries to revert remote files even if `auto-revert-remote-files' is nil Date: Fri, 26 Dec 2014 23:24:43 +0300
Below is the suggested patch.

Analysis:

When the `auto-revert-tail-mode' is called it temporarily enables
auto-revert-mode:

      (or auto-revert-mode
          (let ((auto-revert-tail-mode t))
            (auto-revert-mode 1)))

`auto-revert-mode' then calls `auto-revert-buffers' which in turn calls
`auto-revert-handler' (fixed by the patch).

Then, this code yielded t:

+             (and (or auto-revert-mode
+                      global-auto-revert-non-file-buffers)

which resulted as `revert' set to t.

In the end, `(auto-revert-tail-handler size)' was evaluted with nil
size.

This produces error:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  auto-revert-tail-handler(nil)


Fix:

In `revert' value calculation, `or' is changed to `if'.  The "then"
clause applies to file-visiting buffers, this is where the result of
`file-remote-p' is analyzed.  The "else" clause case applies to non-file
buffers.

Ok to apply?

Filipp

diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index f1074e2..514dc2b 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -589,8 +589,8 @@ This is an internal function used by Auto-Revert Mode."
           ;; the values.
           (remote-file-name-inhibit-cache t)
           (revert
-           (or (and buffer-file-name
-                    (or auto-revert-remote-files
+           (if buffer-file-name
+               (and (or auto-revert-remote-files
                         (not (file-remote-p buffer-file-name)))
                     (or (not auto-revert-use-notify)
                         auto-revert-notify-modified-p)
@@ -603,11 +603,11 @@ This is an internal function used by Auto-Revert Mode."
                       (funcall (or buffer-stale-function
                                     #'buffer-stale--default-function)
                                 t)))
-               (and (or auto-revert-mode
-                        global-auto-revert-non-file-buffers)
-                    (funcall (or buffer-stale-function
-                                  #'buffer-stale--default-function)
-                              t))))
+             (and (or auto-revert-mode
+                      global-auto-revert-non-file-buffers)
+                  (funcall (or buffer-stale-function
+                               #'buffer-stale--default-function)
+                           t))))
           eob eoblist)
       (setq auto-revert-notify-modified-p nil)
       (when revert



--- End Message ---
--- Begin Message --- Subject: Re: bug#19449: 25.0.50; `auto-revert-tail-mode' tries to revert remote files even if `auto-revert-remote-files' is nil Date: Mon, 29 Dec 2014 18:36:12 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin)
On 28/12/2014 13:34 +0100, Michael Albinus wrote:

> Filipp Gunbin <address@hidden> writes:
>
>> Fix:
>>
>> In `revert' value calculation, `or' is changed to `if'.  The "then"
>> clause applies to file-visiting buffers, this is where the result of
>> `file-remote-p' is analyzed.  The "else" clause case applies to non-file
>> buffers.
>>
>> Ok to apply?
>
> Looks good to me. Please apply, preferred to the emacs-24 branch.

Applied to emacs-24, thanks.

Sorry for excessive duplication in the commit message.

Filipp


--- End Message ---

reply via email to

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