From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Jacobowitz Newsgroups: gmane.emacs.bugs Subject: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled Date: Sat, 7 Oct 2023 14:48:24 -0400 Message-ID: References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ed6f85060724cd1c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20556"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66381@debbugs.gnu.org, michael.albinus@gmx.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 21:21:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpCrd-0005Ao-8A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 21:21:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpCrI-0003aT-NX; Sat, 07 Oct 2023 15:21:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpCqy-0003Yv-TA for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 15:20:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpCqx-0003cg-IY for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 15:20:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpCrH-0003aF-37 for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 15:21:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Jacobowitz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 19:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66381 X-GNU-PR-Package: emacs Original-Received: via spool by 66381-submit@debbugs.gnu.org id=B66381.169670641213427 (code B ref 66381); Sat, 07 Oct 2023 19:21:03 +0000 Original-Received: (at 66381) by debbugs.gnu.org; 7 Oct 2023 19:20:12 +0000 Original-Received: from localhost ([127.0.0.1]:55950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCqR-0003UO-Pj for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:20:12 -0400 Original-Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:56725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpCMG-0002Rs-Tg for 66381@debbugs.gnu.org; Sat, 07 Oct 2023 14:49:01 -0400 Original-Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so5631292a12.1 for <66381@debbugs.gnu.org>; Sat, 07 Oct 2023 11:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696704515; x=1697309315; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tMB1+AMOTk10esGd9/WxGyYSHcfDTtNEvdJIsEfkfSM=; b=GZ76NhQKgd7g829HoLgl5lRWCmrTFHIqMaUYh4v9KwR6r1WyR+we6MBx/QJ6gbB6SF lmGX62CsRo4s/JLHVb+hbbI7fyYgPhEcr8YQC4jmvt2znlZhC1xRqupVlBZ43FEKbIGe KZOW7KLgoLLb25uT5NqJ97wwx2MYKofIAYxVjaPIe+Ga4pCZYBNjjYc0t8Qilr7jaQxY ftsJ8LhHo93V/9GQTEiR5ZMUaal8sJzEC3xbIW4uOLVnjZvCZpzjPcffvt98vkoNA6zT Uvj0gFv95qOA369ZlzQViWTiYxGVqJS/DOz94jIyODIKPFYPnhpM32Vyb9InvYqgY6iK GXlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696704515; x=1697309315; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tMB1+AMOTk10esGd9/WxGyYSHcfDTtNEvdJIsEfkfSM=; b=oQuu/nge8ylTHXSsjYuwgwcJPwXW4mcdNCeiF6Jf2Ihmw/2OGZ6TpJd3ILYRatlTxd 0r1fV+mTQ9hoSa5vIYctaHm1TPR6+rQzWf1XVmgZqRL+DZcz11+Jnz6bfA4ui/XVSTlc 55YGtNHxUXNBpvvqVcSUbzk/8QXHdM4VX4p8WkrmIKtYAoD1K9BkG31UL9Vb/9QMXpw/ 7AGkEWMLv4UvoBQf3pDkLYcYyLPLji2VUGo1tfDbufHXZZSe0vXHL1EIWjhJmwsjCt9r eKtaB1Gzfo7RIWjfwx/Qh/eJOaf8WfLRkkKzdBg4y/exZGsxt5P2TWmIA0I2tgJgaAEm 781A== X-Gm-Message-State: AOJu0YyLfAcI/ISaFF7+LgJG+ET135FeqiH388qHYi0DV5OVNvlvN4Ed IM54DfNQ+eZXoxIm7VRII4BiYBu6u/xsBmTlb6Q= X-Google-Smtp-Source: AGHT+IGm2H81WmpesZ5E+X9dFENq8PLOco0PyI0EPFlo6tiYgSWahiWhYtob1ocEaHDtbsgTQM9NOed+gLkBJcy9+Ds= X-Received: by 2002:aa7:c998:0:b0:527:ab3f:4350 with SMTP id c24-20020aa7c998000000b00527ab3f4350mr9728352edt.38.1696704515369; Sat, 07 Oct 2023 11:48:35 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Sat, 07 Oct 2023 15:20:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272042 Archived-At: --000000000000ed6f85060724cd1c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I definitely got that last bit about buffer-stale-function, but I think my point still stands - the file isn't checked. On Sat, Oct 7, 2023, 2:41 PM Daniel Jacobowitz wrote: > Isn't it? > > In auto-revert-handler: > https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779 > > (if buffer-file-name > (and (or auto-revert-remote-files > (not (file-remote-p buffer-file-name))) > (or (not auto-revert-notify-watch-descriptor) > auto-revert-notify-modified-p) > (if auto-revert-tail-mode > (and (file-readable-p buffer-file-name) > (/=3D auto-revert-tail-pos > (setq size > (file-attribute-size > (file-attributes > buffer-file-name))))) > (funcall (or buffer-stale-function > #'buffer-stale--default-function) > t))) > > When buffer-file-name, revert is true iff: > > 1. auto-revert-remote-files or the file is not remote > AND 2. there is no watch descriptor or a notification was received > AND 3. some details about auto-revert-tail-mode OR t > > If auto-revert-notify-watch-descriptor and not > auto-revert-notify-modified-p, then the file won't be reverted. > auto-revert-handler does get called by the polling timer, but it > doesn't revert. > > > On Sat, Oct 7, 2023 at 2:28=E2=80=AFPM Eli Zaretskii wrote= : > > > > > From: Daniel Jacobowitz > > > Date: Sat, 7 Oct 2023 14:14:45 -0400 > > > Cc: 66381@debbugs.gnu.org, Eli Zaretskii > > > > > > Coming back to my original suggestion: the documentation says that > polling is used even if > > > notifications are enabled. The implementation does not poll if there'= s > a notification registered. > > > > That last sentence is not true. > > > > -- > Thanks, > Daniel > --000000000000ed6f85060724cd1c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I definitely got that last bit about buffer-stale-functio= n, but I think my point still stands - the file isn't checked.
On Sat, O= ct 7, 2023, 2:41 PM Daniel Jacobowitz <daniel.jacobowitz@gmail.com> wrote:
Isn't it?

In auto-revert-handler:
https://git.savan= nah.gnu.org/cgit/emacs.git/tree/lisp/autorevert.el#n779

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if buffer-file-name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (or auto-revert-remot= e-files
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(not (file-remote-p buffer-file-name)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (n= ot auto-revert-notify-watch-descriptor)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0auto-revert-notify-modified-p)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if au= to-revert-tail-mode
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(and (file-readable-p buffer-file-name)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (/=3D auto-revert-tail-pos
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq size
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-attribute= -size
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-att= ributes buffer-file-name)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(funcall (or buffer-stale-function
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'buffer-stale--default-f= unction)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 t)))

When buffer-file-name, revert is true iff:

1. auto-revert-remote-files or the file is not remote
AND 2. there is no watch descriptor or a notification was received
AND 3. some details about auto-revert-tail-mode OR t

If auto-revert-notify-watch-descriptor and not
auto-revert-notify-modified-p, then the file won't be reverted.
auto-revert-handler does get called by the polling timer, but it
doesn't revert.


On Sat, Oct 7, 2023 at 2:28=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wro= te:
>
> > From: Daniel Jacobowitz <daniel.jacobowitz@gmail.com<= /a>>
> > Date: Sat, 7 Oct 2023 14:14:45 -0400
> > Cc:
66381@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>= ;
> >
> > Coming back to my original suggestion: the documentation says tha= t polling is used even if
> > notifications are enabled. The implementation does not poll if th= ere's a notification registered.
>
> That last sentence is not true.



--
Thanks,
Daniel
--000000000000ed6f85060724cd1c--