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: Stefan Kangas <stefankangas <at> gmail.com>
To: Raffael Stocker <r.stocker <at> mnet-mail.de>, 72532 <at> debbugs.gnu.org
Subject: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
Date: Fri, 9 Aug 2024 09:45:25 +0000
Raffael Stocker <r.stocker <at> mnet-mail.de> writes:

> From cd8b170f2c716cf67623c4ffc4ae38dc63c49496 Mon Sep 17 00:00:00 2001
> From: Raffael Stocker <r.stocker <at> mnet-mail.de>
> Date: Thu, 8 Aug 2024 21:38:14 +0200
> Subject: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check
>  buffer
>
> Ensure we are not selecting a deleted buffer.
> ---
>  lisp/progmodes/which-func.el | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
> index 28aacd335ba..5326be5e877 100644
> --- a/lisp/progmodes/which-func.el
> +++ b/lisp/progmodes/which-func.el
> @@ -309,9 +309,10 @@ which-function-mode
>      (setq which-func-update-timer
>            (run-with-idle-timer which-func-update-delay t #'which-func-update)))
>    (dolist (buf (buffer-list))
> -    (with-current-buffer buf
> -      (which-func--header-line-remove)
> -      (which-func-ff-hook))))
> +    (when (buffer-live-p buf)
> +      (with-current-buffer buf
> +        (which-func--header-line-remove)
> +        (which-func-ff-hook)))))

`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?

>
>  (defvar which-function-imenu-failed nil
>    "Locally t in a buffer if `imenu--make-index-alist' found nothing there.")
> --
> 2.46.0




This bug report was last modified 340 days ago.

Previous Next


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