[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71424: 29.3; auto-revert-use-notify buggy interaction with indirect
From: |
Eli Zaretskii |
Subject: |
bug#71424: 29.3; auto-revert-use-notify buggy interaction with indirect buffers |
Date: |
Sat, 08 Jun 2024 20:45:41 +0300 |
> Date: Sat, 08 Jun 2024 13:06:28 -0400
> From: "Aaron Zeng" <z@bcc32.com>
> Cc: 71424@debbugs.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.
Fixed.
> > ;;;###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?
Also fixed.
I'm therefore closing this bug.