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'