From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Dale Sedivec <dale@codefu.org>
Cc: 34847@debbugs.gnu.org
Subject: bug#34847: 27.0.50; auto-revert-buffers occasionally selects a killed buffer
Date: Sat, 06 Apr 2019 02:55:05 +0100 [thread overview]
Message-ID: <87ftqvlwxy.fsf@tcd.ie> (raw)
In-Reply-To: <CAEj9N4L=hji4UCgrvLpXYcpwuUhuL-HY6J-YjunbWj7nfkjeUw@mail.gmail.com> (Dale Sedivec's message of "Wed, 13 Mar 2019 13:03:35 -0500")
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
Dale Sedivec <dale@codefu.org> writes:
> Lately, while in the process of using Magit, I've frequently gotten
> "Selecting deleting buffer" errors.
Same here.
> I have global-auto-revert-mode on. I *suspect* this happens because
> *something* kills a buffer between when auto-revert-buffers collects
> the list of buffers with (buffer-list) and when auto-revert-buffers
> starts its final traversal of buffers in bufs (which starts out as
> (buffer-list) in global-auto-revert-mode).
My case is slightly different. I enable auto-revert-mode neither
locally nor globally, so Magit automatically enables
magit-auto-revert-mode instead.
This means that the killed buffers causing the auto-revert-buffers timer
to choke are present in auto-revert-buffer-list, rather than
(buffer-list).
Normally, killed buffers are removed from auto-revert-buffer-list thanks
to the local kill-buffer-hook function
auto-revert-remove-current-buffer.
But instrumenting get-buffer-create and kill-buffer revealed that
kill-buffer-hook wasn't run sometimes, specifically when an
uninitialised inhibit_buffer_hooks happened to be non-zero.
Eli, is the following TRT?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-leave-inhibit_buffer_hooks-uninitialized.patch --]
[-- Type: text/x-diff, Size: 849 bytes --]
From 3c519bd52911db44bb3f92dcc722812d8d69a2c6 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Sat, 6 Apr 2019 02:41:16 +0100
Subject: [PATCH] Don't leave inhibit_buffer_hooks uninitialized
* src/buffer.c (Fget_buffer_create): Explicitly initialize
inhibit_buffer_hooks. (bug#34847)
---
src/buffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/buffer.c b/src/buffer.c
index c0f7521c9e..c5d8ee2629 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -588,6 +588,8 @@ even if it is dead. The return value is never nil. */)
&& strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
SBYTES (Vcode_conversion_workbuf_name)) == 0)
b->inhibit_buffer_hooks = true;
+ else
+ b->inhibit_buffer_hooks = false;
bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
--
2.20.1
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
Between Michael's patch[1] for autorevert.el and this, I think the issue
should be solved.
[1]: https://debbugs.gnu.org/34847#8
Thanks,
--
Basil
next prev parent reply other threads:[~2019-04-06 1:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 18:03 bug#34847: 27.0.50; auto-revert-buffers occasionally selects a killed buffer Dale Sedivec
2019-03-24 14:31 ` Michael Albinus
2019-04-05 14:03 ` Tassilo Horn
2019-04-06 9:07 ` Michael Albinus
2019-04-06 2:02 ` Basil L. Contovounesios
2019-04-06 9:37 ` Michael Albinus
2019-04-06 13:42 ` Basil L. Contovounesios
2019-04-06 1:55 ` Basil L. Contovounesios [this message]
2019-04-06 6:39 ` Eli Zaretskii
2019-04-06 13:39 ` Basil L. Contovounesios
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ftqvlwxy.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=34847@debbugs.gnu.org \
--cc=dale@codefu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).