all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Raffael Stocker <r.stocker@mnet-mail.de>, 72532@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	[thread overview]
Message-ID: <CADwFkmksa4DRv0=HLHUv27xHBdnc-T+ZN1XOLb-VrqPreGd-Gg@mail.gmail.com> (raw)
In-Reply-To: <yplmseveg5ia.fsf@mnet-mail.de>

Raffael Stocker <r.stocker@mnet-mail.de> writes:

> From cd8b170f2c716cf67623c4ffc4ae38dc63c49496 Mon Sep 17 00:00:00 2001
> From: Raffael Stocker <r.stocker@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





  parent reply	other threads:[~2024-08-09  9:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 19:48 bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer Raffael Stocker
2024-08-09  5:27 ` Eli Zaretskii
2024-08-09 17:35   ` Raffael Stocker
2024-08-09  9:45 ` Stefan Kangas [this message]
2024-08-09 17:39   ` Raffael Stocker
2024-08-09 19:59     ` Raffael Stocker
2024-08-15  8:36       ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmksa4DRv0=HLHUv27xHBdnc-T+ZN1XOLb-VrqPreGd-Gg@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=72532@debbugs.gnu.org \
    --cc=r.stocker@mnet-mail.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.