From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Raffael Stocker Newsgroups: gmane.emacs.bugs Subject: bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer Date: Fri, 09 Aug 2024 19:35:08 +0200 Message-ID: References: <8634nemfkl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="743"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72532@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 09 19:36:06 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1scTX3-000AZg-C4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Aug 2024 19:36:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scTWa-0002Pw-RX; Fri, 09 Aug 2024 13:35:36 -0400 Original-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 1scTWZ-0002Po-84 for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 13:35:35 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1scTWY-0002hr-Lc for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 13:35:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=gJMFcr3u5omgHsFNZItWDnINSEgAcLGSPpG+wimS/D4=; b=tQCpz2hkNPAZgHUvFrzkXJ5M0ZfKu5i63i5OCjADvEGNDOt6CF9Uk8yCr8hDfKkJkk8MPunI2BUoY37Dqbrqg1LqHOAXx7d6DI3lFviTEJssnAPgY/Fdirw3IkJwPOc1+6oermEFwcobxphTHpNQquz9SF3RdyvQtx4fVmKIGTV6mN28ZZS5KAuXmhRLIrb4R2uLJ7Y3v0lgPFi7kOoxZexVfynSroPrnh0sLTo+di8qhTk383S4oxquVxPcKgGRYzQ7QnDRRZ0nxxI+0mBNy4+YHywR+0Ji4J4Srjxrx7KwJ2F31B3OhXT7yJ67J1RGJla+JDIoWXgI4zbcbMtGYg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1scTX0-0008J9-H8 for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 13:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Raffael Stocker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Aug 2024 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72532-submit@debbugs.gnu.org id=B72532.172322495731923 (code B ref 72532); Fri, 09 Aug 2024 17:36:02 +0000 Original-Received: (at 72532) by debbugs.gnu.org; 9 Aug 2024 17:35:57 +0000 Original-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 Original-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 Original-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) Original-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 Original-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 Original-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) In-Reply-To: <8634nemfkl.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Aug 2024 08:27:06 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289972 Archived-At: 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---