GNU bug report logs - #72532
[PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer

Previous Next

Package: emacs;

Reported by: Raffael Stocker <r.stocker <at> mnet-mail.de>

Date: Thu, 8 Aug 2024 19:50:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Raffael Stocker <r.stocker <at> mnet-mail.de>
Subject: bug#72532: closed (Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el
 (which-function-mode): check buffer)
Date: Thu, 15 Aug 2024 08:37:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 72532 <at> debbugs.gnu.org.

-- 
72532: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72532
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Raffael Stocker <r.stocker <at> mnet-mail.de>
Cc: 72532-done <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#72532: [PATCH] ;
 lisp/progmodes/which-func.el (which-function-mode): check buffer
Date: Thu, 15 Aug 2024 11:36:02 +0300
> Cc: 72532 <at> debbugs.gnu.org
> From: Raffael Stocker <r.stocker <at> mnet-mail.de>
> Date: Fri, 09 Aug 2024 21:59:46 +0200
> 
> Raffael Stocker <r.stocker <at> mnet-mail.de> writes:
> 
> > Stefan Kangas <stefankangas <at> gmail.com> writes:
> >
> >> `buffer-list' is documented to return a list of all live buffers, so it
> >> would be good to understand why buffers are getting killed in this loop.
> >>
> >> In other words, are we sure that your patch is not just covering up some
> >> problem elsewhere?
> >
> > I guess it is.  I just did some trying out and found that I can reliably
> > make the problem appear and disappear by enabling/disabling eglot.
> >
> > I will spend some more time with this and see what more I can find out.
> 
> It seems the problem comes from me putting ‘which-function-mode’ into
> ‘prog-mode-hook’, which I probably shouldn't have done.  Each time I
> load a file in some prog-mode while eglot is active managing at least
> one buffer, which-function-mode seems to get re-enabled and cause my
> problems.  If I just globally enable it (as I probably should do), this
> doesn't happen.
> 
> In short, seems to be a pilot error.
> Why I still can't reproduce it with ‘emacs -Q’, I do not know.
> Still, not worth a patch it seems, sorry for the noise.

Thanks, I'm therefore closing this bug.

[Message part 3 (message/rfc822, inline)]
From: Raffael Stocker <r.stocker <at> mnet-mail.de>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check
 buffer
Date: Thu, 08 Aug 2024 21:48:45 +0200
[Message part 4 (text/plain, inline)]
Tags: patch

Hi Emacs,

I have been getting "Selecting deleted buffer" errors recently when
opening files.  This is due to ‘which-function-mode’ (in my
prog-mode-hook) walking through (buffer-list) without checking for live
buffers.

I have not been able to reproduce with ‘emacs -Q’, but it seems to be
connected to eglot, as I see the problem only with eglot enabled.

Nevertheless, I would like to suggest the attached patch, if only to
make which-function-mode more robust.

Regards,
Raffael


In GNU Emacs 30.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2024-08-06 built on Whiteflame
Repository revision: fb642d9cf546f52a11cdfef479447ce2e8fa3ec8
Repository branch: emacs-30
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: Arch Linux

Configured using:
 'configure --prefix=/opt/emacs --with-native-compilation=aot'

[0001-lisp-progmodes-which-func.el-which-function-mode-che.patch (text/patch, attachment)]

This bug report was last modified 339 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.