all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Aaron Zeng" <z@bcc32.com>
To: "Eli Zaretskii" <eliz@gnu.org>,
	"Michael Albinus" <michael.albinus@gmx.de>
Cc: 71424@debbugs.gnu.org
Subject: bug#71424: 29.3; auto-revert-use-notify buggy interaction with indirect buffers
Date: Sat, 08 Jun 2024 13:06:28 -0400	[thread overview]
Message-ID: <718012e2-b09e-40e1-921f-d94c3aadf0d1@app.fastmail.com> (raw)
In-Reply-To: <86zfrvbdsz.fsf@gnu.org>

On Sat, Jun 8, 2024, at 12:27, Eli Zaretskii wrote:
> diff --git a/lisp/autorevert.el b/lisp/autorevert.el
> index a23d536..ab69add 100644
> --- a/lisp/autorevert.el
> +++ b/lisp/autorevert.el
> @@ -378,8 +378,11 @@ auto-revert-debug
>  (defun auto-revert-remove-current-buffer (&optional buffer)
>    "Remove BUFFER from `auto-revert-buffer-list'.
>  BUFFER defaults to `current-buffer'."
> -  (setq auto-revert-buffer-list
> -        (delq (or buffer (current-buffer)) auto-revert-buffer-list)))
> +  (let ((buf (or buffer (current-buffer))))
> +    ;; Don't remove the watch if we are killing an indirect buffer.
> +    (or (buffer-base-buffer buf)
> +        (setq auto-revert-buffer-list
> +              (delq buf auto-revert-buffer-list)))))

(take my reply with a grain of salt---I'm not that familiar with this code).  I think this will leave killed buffers in auto-revert-buffer-list, which seems wrong to me.

>  ;;;###autoload
>  (define-minor-mode auto-revert-mode
> @@ -639,7 +642,9 @@ auto-revert-set-timer
> 
>  (defun auto-revert-notify-rm-watch ()
>    "Disable file notification for current buffer's associated file."
> -  (when-let ((desc auto-revert-notify-watch-descriptor))
> +  (when-let ((desc
> +              (and (buffer-base-buffer)
> +                   auto-revert-notify-watch-descriptor)))
>      (setq auto-revert--buffer-by-watch-descriptor
>            (assoc-delete-all desc auto-revert--buffer-by-watch-descriptor))
>      (ignore-errors

Maybe I'm reading the code wrong, but should this be (not (buffer-base-buffer)) instead?





  parent reply	other threads:[~2024-06-08 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08  4:44 bug#71424: 29.3; auto-revert-use-notify buggy interaction with indirect buffers z
2024-06-08  4:46 ` bug#71424: Aaron Zeng
2024-06-08  7:03 ` bug#71424: 29.3; auto-revert-use-notify buggy interaction with indirect buffers Eli Zaretskii
2024-06-08 15:30   ` Aaron Zeng
2024-06-08 16:27     ` Eli Zaretskii
2024-06-08 16:57       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-08 17:44         ` Eli Zaretskii
2024-06-10 11:15           ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-08 17:06       ` Aaron Zeng [this message]
2024-06-08 17:45         ` Eli Zaretskii

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=718012e2-b09e-40e1-921f-d94c3aadf0d1@app.fastmail.com \
    --to=z@bcc32.com \
    --cc=71424@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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.