GNU bug report logs - #19449
25.0.50; `auto-revert-tail-mode' tries to revert remote files even if `auto-revert-remote-files' is nil

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Fri, 26 Dec 2014 20:25:02 UTC

Severity: normal

Found in version 25.0.50

Done: Filipp Gunbin <fgunbin <at> fastmail.fm>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19449 in the body.
You can then email your comments to 19449 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19449; Package emacs. (Fri, 26 Dec 2014 20:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Dec 2014 20:25:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19449; Package emacs. (Sun, 28 Dec 2014 12:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 19449 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 19449 <at> debbugs.gnu.org
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: Sun, 28 Dec 2014 13:34:49 +0100
Filipp Gunbin <fgunbin <at> fastmail.fm> 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.

> Filipp

Best regards, Michael.




Reply sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
You have taken responsibility. (Mon, 29 Dec 2014 15:37:02 GMT) Full text and rfc822 format available.

Notification sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
bug acknowledged by developer. (Mon, 29 Dec 2014 15:37:03 GMT) Full text and rfc822 format available.

Message #13 received at 19449-done <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19449-done <at> debbugs.gnu.org
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
On 28/12/2014 13:34 +0100, Michael Albinus wrote:

> Filipp Gunbin <fgunbin <at> fastmail.fm> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19449; Package emacs. (Mon, 29 Dec 2014 15:59:02 GMT) Full text and rfc822 format available.

Message #16 received at 19449 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 19449 <at> debbugs.gnu.org
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 16:58:17 +0100
Filipp Gunbin <fgunbin <at> fastmail.fm> writes:

> Applied to emacs-24, thanks.

Thanks!

> Filipp

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Jan 2015 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 149 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.