GNU bug report logs -
#34847
27.0.50; auto-revert-buffers occasionally selects a killed buffer
Previous Next
Reported by: Dale Sedivec <dale <at> codefu.org>
Date: Wed, 13 Mar 2019 18:09:01 UTC
Severity: normal
Tags: fixed, patch
Merged with 35755
Found in version 27.0.50
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
Hi Basil,
>> ! (defun auto-revert-remove-current-buffer (&optional buffer)
>> "Remove dead buffer from `auto-revert-buffer-list'."
>
> Can you please update the docstring? E.g.
>
> "Remove BUFFER from `auto-revert-buffer-list'.
> BUFFER defaults to `current-buffer'."
Done.
>> --- 772,783 ----
>> (setq bufs (delq nil
>> (mapcar
>> (lambda (buf)
>> ! (and (buffer-live-p buf)
>> ! (with-current-buffer buf
>> ! (and
>> ! (or (not (file-remote-p default-directory))
>> ! (file-remote-p default-directory nil t))
>> ! buf))))
>> bufs)))
>> ;; Partition `bufs' into two halves depending on whether or not
>> ;; the buffers are in `auto-revert-remaining-buffers'. The
>> two
>
> Indentation seems a bit off here. Note that you can use 'when' instead
> of 'and' to fit more easily within 80 columns, if you prefer.
I'd like to keep it, for simpler diffs when time comes. There's no
problem with the 80 columns width.
> Otherwise LGTM. Can you please also make the following change while
> you're at it?
>
> diff --git a/lisp/autorevert.el b/lisp/autorevert.el
> index bc7c616ecb..d736f0d31c 100644
> --- a/lisp/autorevert.el
> +++ b/lisp/autorevert.el
> @@ -509,7 +509,7 @@ auto-revert-notify-rm-watch
> (ignore-errors
> (file-notify-rm-watch auto-revert-notify-watch-descriptor)))))
> auto-revert-notify-watch-descriptor-hash-list)
> - (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch))
> + (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t))
> (setq auto-revert-notify-watch-descriptor nil
> auto-revert-notify-modified-p nil))
Good catch! I've applied it.
> Works for me; I hope to see it land soon. See also my other message for
> a related but more subtle problem: https://debbugs.gnu.org/34847#16
Eli has already confirmed your approach, so you might commit it (and
close the bug then).
> Thanks,
Best regards, Michael.
This bug report was last modified 6 years and 3 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.