From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 08 15:49:40 2024 Received: (at submit) by debbugs.gnu.org; 8 Aug 2024 19:49:40 +0000 Received: from localhost ([127.0.0.1]:37243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sc98m-0004sE-6h for submit@debbugs.gnu.org; Thu, 08 Aug 2024 15:49:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:34350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sc98k-0004s6-9l for submit@debbugs.gnu.org; Thu, 08 Aug 2024 15:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sc98J-0007rJ-0T for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 15:49:11 -0400 Received: from mail-out.m-online.net ([212.18.0.9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sc98G-0005ID-EE for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 15:49:10 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4WfyKW4lDbz1qtqm for ; Thu, 8 Aug 2024 21:49:03 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4WfyKW3jlgz1qqlS for ; Thu, 8 Aug 2024 21:49:03 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id C8yocDoAwL-y for ; Thu, 8 Aug 2024 21:48:50 +0200 (CEST) X-Auth-Info: rQs44ruBZu4GtQibELLzGtIU1V9ZNed7DFk/vmIqgwieHF6oLT9C+3VljT99/ML2 Received: from Whiteflame (aftr-62-216-207-53.dynamic.mnet-online.de [62.216.207.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA for ; Thu, 8 Aug 2024 21:48:50 +0200 (CEST) From: Raffael Stocker To: bug-gnu-emacs@gnu.org Subject: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer Date: Thu, 08 Aug 2024 21:48:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=212.18.0.9; envelope-from=r.stocker@mnet-mail.de; helo=mail-out.m-online.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Hi Emacs, I have been getting "Selecting deleted buffer" errors recently when opening files. This is due to =E2=80=98which-function-mode=E2=80=99 (in my prog-mode-hook) walking through (buffer-list) without checking for live buffers. I have not been able to reproduce with =E2=80=98emacs -Q=E2=80=99, but it s= eems 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=3D/opt/emacs --with-native-compilation=3Daot' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-progmodes-which-func.el-which-function-mode-che.patch >From cd8b170f2c716cf67623c4ffc4ae38dc63c49496 Mon Sep 17 00:00:00 2001 From: Raffael Stocker 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))))) (defvar which-function-imenu-failed nil "Locally t in a buffer if `imenu--make-index-alist' found nothing there.") -- 2.46.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 01:27:43 2024 Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 05:27:43 +0000 Received: from localhost ([127.0.0.1]:37515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scIAB-0003Z6-EA for submit@debbugs.gnu.org; Fri, 09 Aug 2024 01:27:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scIA9-0003Yr-Nh for 72532@debbugs.gnu.org; Fri, 09 Aug 2024 01:27:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scI9c-000576-52; Fri, 09 Aug 2024 01:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=yLfxxfNwXVn9y5Xq5/wwKWLsz8Y9ZLpejUOZhp2eWJw=; b=qyCTI98ppOb3XCB1E/5Q fzrhMqrjoTJ4jf6U5lRIXQhRSUPSKXw4ZwFFWkHU40bj3yUuOv+GglbLqbyNVdvwPSCRnxMicePuw l+y3jSzy7bYeWD04FKPke0nB8hTx23szzKz/YTi/O60YW3NkFenUB1X5eaK0Ily/Wev33XcZFexbu Y0Iaq4Dks9cYtoOm+Et9l1FV+9GptUt4npAJs7H5BpgS1LyfE5yQnFsDEe9/uP876O9zdwe+XamLk VOuS2P/+Hzhw7o075xy4u5FTOsHI+DBkNBLb7lF1JGAYmPy0yvj9JRBdDChl5RM2gqvgUPw3+cRkM 4wNKhsCrQuD8ZQ==; Date: Fri, 09 Aug 2024 08:27:06 +0300 Message-Id: <8634nemfkl.fsf@gnu.org> From: Eli Zaretskii To: Raffael Stocker In-Reply-To: (message from Raffael Stocker on Thu, 08 Aug 2024 21:48:45 +0200) Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72532 Cc: 72532@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Raffael Stocker > Date: Thu, 08 Aug 2024 21:48:45 +0200 > > 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. Thanks, but please show a couple of Lisp backtraces you get for this error. We'd like to be sure we are fixing the problem you report, not some other problem. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 05:47:03 2024 Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 09:47:03 +0000 Received: from localhost ([127.0.0.1]:37698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scMD8-0001sc-Dy for submit@debbugs.gnu.org; Fri, 09 Aug 2024 05:47:02 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:42160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scMD6-0001s9-3I for 72532@debbugs.gnu.org; Fri, 09 Aug 2024 05:47:00 -0400 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135eso2809047a12.0 for <72532@debbugs.gnu.org>; Fri, 09 Aug 2024 02:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723196726; x=1723801526; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=r7neEqE5PZybfRouIpoUZ26RntNAyCZT9w++W87s8CE=; b=HprxQSuU/atw6bZId07rpzcBT4KE1od1YxXXqYSpBK9R1zTT9zb2yOj5ELIMx8BMpH FgkcVzobd3UlP642/Rg8nK59jLnVctE+6c8sQDTBRCtESK3OtifQgANbN1yy3QfMcMQ8 gI9MdsFF9a0B6rNfcjjLLgMac/Ll5lz3ByMN5V1XFTUo7McR4061z8Jdh3fREwBMWvMB ECGo8pdM9ydPEz5tlzJUGpNwmHh5ttvQAYWHl1wQvGeiHrCgPbbDTrSrU4kjhgyIUB0T LJbqejLrSbZ93RgSpgw1FXX/lF2qQ8meiR5Qf5iOtnx06CELt41uN3DWzjqAJ7/GpJIo XPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723196726; x=1723801526; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r7neEqE5PZybfRouIpoUZ26RntNAyCZT9w++W87s8CE=; b=LqDTFi2LVKWsRsdEYbp9xIAG0NugNuHU+w/Mt43pyotuumaysVLrQPvor634hInMmZ HBoZ3CzFDYWdC2oCousHOZMRIjYefTxIl4PEY87oJ5/j9TMm1mibDhJpMT7Tlh9/NyEC qd3NeRK9DJaVN86sMLEt0xhoptiP/LCQggQuppKhY62rNngZUEML3PNNL40VrEiTZgx+ MXiUGFGmE1vsEQFpUB8pU3YukuSsuAO0B3AB30vu8lrQK3bDxpezP8Snzkrd+xCUdA/p zwEOUwxaI26+uc5+Ss2SfSmvW4bCl5yQ63AkAi4F0ZFaV/iAxPV4qSrJe3vGYwd8oOQf i/WA== X-Forwarded-Encrypted: i=1; AJvYcCWsHun9VOX22v4u0IQdAbPO34pzD9F01F99B3JKSDMEMPJCV/QLNZI8bgO9RRS8xgIA3TbhXD5MXDEPuAy+Y2KMbUfDxJk= X-Gm-Message-State: AOJu0Yz40p1TNgGHAqH66gFf32r12RrvO5od0MGGb0vuDqgeMpO9h9wC J6k9j7vf9Ai0/bsZFJab8S7RMXXfl2PCjhROWd1BeafP4r3/ZGRjDOoXl0NrgVMtbAWCeOCQ1vH 4NO/wNOm2Cyk9uoO9d4aU47B+zSc= X-Google-Smtp-Source: AGHT+IEnSKVp6fqBGxN1QyC9AkTCUB2LfCEw5KCv7V3g/Ubw/crrvZPGIPn5WUgHJslpoFeNKGvqt1NOcKV0c8dBPTw= X-Received: by 2002:a05:6402:3585:b0:5a2:bfd1:b892 with SMTP id 4fb4d7f45d1cf-5bbb3c41273mr4332120a12.11.1723196726083; Fri, 09 Aug 2024 02:45:26 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 9 Aug 2024 09:45:25 +0000 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 9 Aug 2024 09:45:25 +0000 Message-ID: Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer To: Raffael Stocker , 72532@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72532 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Raffael Stocker writes: > From cd8b170f2c716cf67623c4ffc4ae38dc63c49496 Mon Sep 17 00:00:00 2001 > From: Raffael Stocker > 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 13:35:57 2024 Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 17:35:57 +0000 Received: from localhost ([127.0.0.1]:38572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scTWu-0008Ip-Hv for submit@debbugs.gnu.org; Fri, 09 Aug 2024 13:35:57 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:42854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scTWr-0008If-DA for 72532@debbugs.gnu.org; Fri, 09 Aug 2024 13:35:54 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4WgWJq6ss8z1qsPQ; Fri, 9 Aug 2024 19:35:23 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4WgWJq56sLz1qqlS; Fri, 9 Aug 2024 19:35:23 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id Y0tJCWk4X7En; Fri, 9 Aug 2024 19:35:13 +0200 (CEST) X-Auth-Info: wMLTPAAtpZfPA6iy1fwiQyc1RVe6y8O22ghJrAiONrHimuhI1xJzQ2iVsETUyoHp Received: from Whiteflame (aftr-62-216-207-33.dynamic.mnet-online.de [62.216.207.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 9 Aug 2024 19:35:13 +0200 (CEST) From: Raffael Stocker To: Eli Zaretskii Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer In-Reply-To: <8634nemfkl.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Aug 2024 08:27:06 +0300") References: <8634nemfkl.fsf@gnu.org> Date: Fri, 09 Aug 2024 19:35:08 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 72532 Cc: 72532@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: > Thanks, but please show a couple of Lisp backtraces you get for this > error. We'd like to be sure we are fixing the problem you report, not > some other problem. See [1] and [2] below. [1]: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Selecting deleted buffer") which-function-mode() debugger-may-continue = t inhibit-redisplay = nil inhibit-debugger = t inhibit-changing-match-data = nil run-hooks(change-major-mode-after-body-hook prog-mode-hook c-ts-base-mode-hook c-ts-mode-hook) apply(run-hooks change-major-mode-after-body-hook (prog-mode-hook c-ts-base-mode-hook c-ts-mode-hook)) run-mode-hooks(c-ts-mode-hook) c-ts-mode() set-auto-mode-0(c-mode nil) set-auto-mode--apply-alist((("\\.[pP][dD][fF]\\'" . #f(compiled-function () #)) ("\\.epub\\'" . nov-mode) ("\\.mac\\'" . maxima-mode) ("\\.ledger$" . ledger-mode) ("\\.\\(plantuml\\|pum\\|plu\\|puml\\)\\'" . plantuml-mode) ("\\.mo\\'" . modelica-mode) ("\\.asy$" . asy-mode) ("\\.hva\\'" . LaTeX-mode) ("\\.tsv\\'" . tsv-mode) ("\\.[Cc][Ss][Vv]\\'" . csv-mode) ("\\.djvu\\'" . djvu-init-mode) ("\\.rkt\\'" . scheme-mode) ("/git/ignore\\'" . gitignore-mode) ("/info/exclude\\'" . gitignore-mode) ("/\\.gitignore\\'" . gitignore-mode) ("/etc/gitconfig\\'" . gitconfig-mode) ("/\\.gitmodules\\'" . gitconfig-mode) ("/git/config\\'" . gitconfig-mode) ("/modules/.*/config\\'" . gitconfig-mode) ("/\\.git/config\\'" . gitconfig-mode) ("/\\.gitconfig\\'" . gitconfig-mode) ("/git/attributes\\'" . gitattributes-mode) ("/info/attributes\\'" . gitattributes-mode) ("/\\.gitattributes\\'" . gitattributes-mode) ("\\.gv\\'" . graphviz-dot-mode) ("\\.dot\\'" . graphviz-dot-mode) ("\\.pro\\'" . idlwave-mode) ("\\.hex\\'" . intel-hex-mode) ("\\.jl\\'" . julia-mode) ("\\.ledger\\'" . ledger-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.mms" . mmix-mode) ("\\.mmo" . mmix-mmo-mode) ("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-mode-maybe) ("\\.\\(?:php\\.inc\\|stub\\)\\'" . php-mode) ("/\\.php_cs\\(?:\\.dist\\)?\\'" . php-mode) ("\\.\\(plantuml\\|pum\\|plu\\)\\'" . plantuml-mode) ("\\.ps[dm]?1\\'" . powershell-mode) ("\\.rs\\'" . rustic-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.rs\\'" . rust-mode) ("\\.grm\\'" . sml-yacc-mode) ("\\.cm\\'" . sml-cm-mode) ("\\.s\\(ml\\|ig\\)\\'" . sml-mode) ("/systemd/[^z-a]+?\\.d/[^/]+?\\.conf\\'" . systemd-mode) ("\\.#\\(?:[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\|override\\.conf\\)[[:xdigit:]]\\{16\\}\\'" . systemd-mode) ("[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\'" . systemd-mode) ("\\.nspawn\\'" . systemd-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ...) nil nil) #() so-long--set-auto-mode(#) so-long--set-auto-mode = t apply(so-long--set-auto-mode # nil) set-auto-mode() normal-mode(t) enable-local-variables = t after-find-file(nil t) find-file-noselect-1(# "~/build/emacs/src/android.c" nil nil "~/build/emacs/src/android.c" (1320625 65027)) find-file-noselect("/home/rst/build/emacs/src/android.c" nil nil nil) find-file("/home/rst/build/emacs/src/android.c") counsel-find-file-action("/home/rst/build/emacs/src/android.c") ivy-call() ivy-read("Find file: " read-file-name-internal :matcher counsel--find-file-matcher :initial-input nil :action counsel-find-file-action :preselect nil :require-match confirm-after-completion :history file-name-history :keymap (keymap (remap keymap (undo . counsel-find-file-undo)) (67108960 lambda (&optional arg) "nil (`nil')" (interactive "p") (if (string= "" ivy-text) (execute-kbd-macro (kbd "M-o b")) (self-insert-command arg))) (96 . counsel-file-jump-from-find) (C-backspace . counsel-up-directory) (67108991 . counsel-up-directory)) :caller counsel-find-file) ivy-recursive-last = nil ivy--display-function = nil counsel--find-file-1("Find file: " nil counsel-find-file-action counsel-find-file) default-directory = "/home/rst/build/emacs/src/" counsel-find-file() default-directory = "/home/rst/build/emacs/src/" tramp-archive-enabled = nil funcall-interactively(counsel-find-file) command-execute(counsel-find-file) current-minibuffer-command = counsel-find-file --8<---------------cut here---------------end--------------->8--- [2]: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Selecting deleted buffer") set-buffer(#) (save-current-buffer (set-buffer buf) (which-func--header-line-remove) (which-func-ff-hook)) (let ((buf (car tail))) (save-current-buffer (set-buffer buf) (which-func--header-line-remove) (which-func-ff-hook)) (setq tail (cdr tail))) (while tail (let ((buf (car tail))) (save-current-buffer (set-buffer buf) (which-func--header-line-remove) (which-func-ff-hook)) (setq tail (cdr tail)))) (let ((tail (buffer-list))) (while tail (let ((buf (car tail))) (save-current-buffer (set-buffer buf) (which-func--header-line-remove) (which-func-ff-hook)) (setq tail (cdr tail))))) (let ((last-message (current-message))) (progn (set-default 'which-function-mode (cond ((eq arg 'toggle) (not (default-value 'which-function-mode))) ((and (numberp arg) (< arg 1)) nil) (t t)))) (if (boundp 'global-minor-modes) (progn (setq global-minor-modes (delq 'which-function-mode global-minor-modes)) (if (default-value 'which-function-mode) (progn (setq global-minor-modes (cons 'which-function-mode global-minor-modes)))))) (if (timerp which-func-update-timer) (progn (cancel-timer which-func-update-timer))) (setq which-func-update-timer nil) (if which-function-mode (progn (setq which-func-update-timer (run-with-idle-timer which-func-update-delay t #'which-func-update)))) (let ((tail (buffer-list))) (while tail (let ((buf (car tail))) (save-current-buffer (set-buffer buf) (which-func--header-line-remove) (which-func-ff-hook)) (setq tail (cdr tail))))) (run-hooks 'which-function-mode-hook (if (default-value 'which-function-mode) 'which-function-mode-on-hook 'which-function-mode-off-hook)) (if (called-interactively-p 'any) (progn (customize-mark-as-set 'which-function-mode) (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local "")) (message "%s %sabled%s" "Which-Function mode" (if (default-value ...) "en" "dis") local)))))) which-function-mode() arg = nil run-hooks(change-major-mode-after-body-hook prog-mode-hook c-ts-base-mode-hook c-ts-mode-hook) apply(run-hooks change-major-mode-after-body-hook (prog-mode-hook c-ts-base-mode-hook c-ts-mode-hook)) run-mode-hooks(c-ts-mode-hook) c-ts-mode() set-auto-mode-0(c-mode nil) set-auto-mode--apply-alist((("\\.[pP][dD][fF]\\'" . #f(compiled-function () #)) ("\\.epub\\'" . nov-mode) ("\\.mac\\'" . maxima-mode) ("\\.ledger$" . ledger-mode) ("\\.\\(plantuml\\|pum\\|plu\\|puml\\)\\'" . plantuml-mode) ("\\.mo\\'" . modelica-mode) ("\\.asy$" . asy-mode) ("\\.hva\\'" . LaTeX-mode) ("\\.tsv\\'" . tsv-mode) ("\\.[Cc][Ss][Vv]\\'" . csv-mode) ("\\.djvu\\'" . djvu-init-mode) ("\\.rkt\\'" . scheme-mode) ("/git/ignore\\'" . gitignore-mode) ("/info/exclude\\'" . gitignore-mode) ("/\\.gitignore\\'" . gitignore-mode) ("/etc/gitconfig\\'" . gitconfig-mode) ("/\\.gitmodules\\'" . gitconfig-mode) ("/git/config\\'" . gitconfig-mode) ("/modules/.*/config\\'" . gitconfig-mode) ("/\\.git/config\\'" . gitconfig-mode) ("/\\.gitconfig\\'" . gitconfig-mode) ("/git/attributes\\'" . gitattributes-mode) ("/info/attributes\\'" . gitattributes-mode) ("/\\.gitattributes\\'" . gitattributes-mode) ("\\.gv\\'" . graphviz-dot-mode) ("\\.dot\\'" . graphviz-dot-mode) ("\\.pro\\'" . idlwave-mode) ("\\.hex\\'" . intel-hex-mode) ("\\.jl\\'" . julia-mode) ("\\.ledger\\'" . ledger-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.mms" . mmix-mode) ("\\.mmo" . mmix-mmo-mode) ("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-mode-maybe) ("\\.\\(?:php\\.inc\\|stub\\)\\'" . php-mode) ("/\\.php_cs\\(?:\\.dist\\)?\\'" . php-mode) ("\\.\\(plantuml\\|pum\\|plu\\)\\'" . plantuml-mode) ("\\.ps[dm]?1\\'" . powershell-mode) ("\\.rs\\'" . rustic-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.rs\\'" . rust-mode) ("\\.grm\\'" . sml-yacc-mode) ("\\.cm\\'" . sml-cm-mode) ("\\.s\\(ml\\|ig\\)\\'" . sml-mode) ("/systemd/[^z-a]+?\\.d/[^/]+?\\.conf\\'" . systemd-mode) ("\\.#\\(?:[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\|override\\.conf\\)[[:xdigit:]]\\{16\\}\\'" . systemd-mode) ("[.0-9@-Z\\_a-z-]+?\\.\\(?:automount\\|busname\\|link\\|mount\\|net\\(?:dev\\|work\\)\\|s\\(?:ervice\\|lice\\|ocket\\|wap\\)\\|t\\(?:arget\\|imer\\)\\)\\'" . systemd-mode) ("\\.nspawn\\'" . systemd-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ...) nil nil) #() so-long--set-auto-mode(#) so-long--set-auto-mode = t apply(so-long--set-auto-mode # nil) set-auto-mode() normal-mode(t) enable-local-variables = t after-find-file(nil nil t nil nil) revert-buffer--default(t nil) inhibit-read-only = t revert-buffer(t) revert-buffer-preserve-modes = nil revert-buffer-in-progress-p = t funcall-interactively(revert-buffer t) command-execute(revert-buffer) current-minibuffer-command = revert-buffer --8<---------------cut here---------------end--------------->8--- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 13:39:41 2024 Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 17:39:42 +0000 Received: from localhost ([127.0.0.1]:38576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scTaX-0008OY-Jq for submit@debbugs.gnu.org; Fri, 09 Aug 2024 13:39:41 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:58834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scTaV-0008OL-WE for 72532@debbugs.gnu.org; Fri, 09 Aug 2024 13:39:40 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4WgWPC1vcdz1qsPQ; Fri, 9 Aug 2024 19:39:11 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4WgWPC1j7yz1qqlS; Fri, 9 Aug 2024 19:39:11 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id Un5P5pgCDtde; Fri, 9 Aug 2024 19:39:01 +0200 (CEST) X-Auth-Info: YzTGvmdNO9fnMPrl0wRYTLsQh1ZEYzfc6gKNvNyTonaLFVN/kaz3FeC00MsL6xTW Received: from Whiteflame (aftr-62-216-207-33.dynamic.mnet-online.de [62.216.207.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 9 Aug 2024 19:39:01 +0200 (CEST) From: Raffael Stocker To: Stefan Kangas Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer In-Reply-To: (Stefan Kangas's message of "Fri, 9 Aug 2024 09:45:25 +0000") References: Date: Fri, 09 Aug 2024 19:39:01 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 72532 Cc: 72532@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Kangas 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 16:00:32 2024 Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 20:00:32 +0000 Received: from localhost ([127.0.0.1]:38645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scVmp-0003gp-PZ for submit@debbugs.gnu.org; Fri, 09 Aug 2024 16:00:32 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:34403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scVmm-0003gd-NN for 72532@debbugs.gnu.org; Fri, 09 Aug 2024 16:00:30 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4WgZWg1Wzjz1qtq7; Fri, 9 Aug 2024 21:59:59 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4WgZWf6y2bz1qqlS; Fri, 9 Aug 2024 21:59:58 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id G0XZQYyNYABM; Fri, 9 Aug 2024 21:59:49 +0200 (CEST) X-Auth-Info: XXIkP0GnRyGndvh3CTS1jQpTJztKcatuuaVhmw0VOm5mNyeUd2EfyJtlaZLNtfnu Received: from Whiteflame (aftr-62-216-207-33.dynamic.mnet-online.de [62.216.207.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 9 Aug 2024 21:59:49 +0200 (CEST) From: Raffael Stocker To: Stefan Kangas Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer In-Reply-To: (Raffael Stocker's message of "Fri, 09 Aug 2024 19:39:01 +0200") References: Date: Fri, 09 Aug 2024 21:59:46 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 72532 Cc: 72532@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Raffael Stocker writes: > Stefan Kangas 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 =E2=80=98which-function-mode=E2= =80=99 into =E2=80=98prog-mode-hook=E2=80=99, which I probably shouldn't have done. Ea= ch 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 =E2=80=98emacs -Q=E2=80=99, I do not kn= ow. Still, not worth a patch it seems, sorry for the noise. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 04:36:49 2024 Received: (at 72532-done) by debbugs.gnu.org; 15 Aug 2024 08:36:49 +0000 Received: from localhost ([127.0.0.1]:48326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seVyS-0005qW-MQ for submit@debbugs.gnu.org; Thu, 15 Aug 2024 04:36:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seVyQ-0005qJ-Gk for 72532-done@debbugs.gnu.org; Thu, 15 Aug 2024 04:36:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seVxk-00065y-ID; Thu, 15 Aug 2024 04:36:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uihXzNMviHbUXWzepNXqE9GpL3IB4GiP2AEkJ/3LyAw=; b=l/mmAn+018m7pwB4SKRi RlVpL8nyh3QeD5WyHhBc1qfCDMfjOeBh2w3zRtglz06Vd+XjrG5sdilBm1SveCa6H1lku+t1E3a8S XGuyjA5ztZX8jyjAIuEZ9Vo+QfT6IXK1qtvaRiDnsWn/CBkmWaSjrxJQb0npCqzAJWjSuwxUMC4rP W0RC2RBQbFiTBpap6kfe4cmlCxJuNjj+QUNGF3yloyN08t4wllBI7yHo27q1QGeRIT/vH3BWPdgiX QCMaRWvBrYeqwR8JciYGViI9OUFYtB9wcOnKyxSMXL4JOICpUJ/Ww+rn3Tup2FAHg8YBVswE7LG+s nowgipzpUUvMIQ==; Date: Thu, 15 Aug 2024 11:36:02 +0300 Message-Id: <86ikw26v4d.fsf@gnu.org> From: Eli Zaretskii To: Raffael Stocker In-Reply-To: (message from Raffael Stocker on Fri, 09 Aug 2024 21:59:46 +0200) Subject: Re: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72532-done Cc: 72532-done@debbugs.gnu.org, stefankangas@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 72532@debbugs.gnu.org > From: Raffael Stocker > Date: Fri, 09 Aug 2024 21:59:46 +0200 > > Raffael Stocker writes: > > > Stefan Kangas 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. From unknown Mon Aug 18 02:37:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Sep 2024 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator