all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
@ 2024-08-08 19:48 Raffael Stocker
  2024-08-09  5:27 ` Eli Zaretskii
  2024-08-09  9:45 ` Stefan Kangas
  0 siblings, 2 replies; 7+ messages in thread
From: Raffael Stocker @ 2024-08-08 19:48 UTC (permalink / raw)
  To: 72532

[-- Attachment #1: Type: text/plain, Size: 945 bytes --]

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-progmodes-which-func.el-which-function-mode-che.patch --]
[-- Type: text/patch, Size: 1125 bytes --]

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-08-09  5:27 UTC (permalink / raw)
  To: Raffael Stocker; +Cc: 72532

> From: Raffael Stocker <r.stocker@mnet-mail.de>
> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  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  9:45 ` Stefan Kangas
  2024-08-09 17:39   ` Raffael Stocker
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2024-08-09  9:45 UTC (permalink / raw)
  To: Raffael Stocker, 72532

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  2024-08-09  5:27 ` Eli Zaretskii
@ 2024-08-09 17:35   ` Raffael Stocker
  0 siblings, 0 replies; 7+ messages in thread
From: Raffael Stocker @ 2024-08-09 17:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 72532

Eli Zaretskii <eliz@gnu.org> 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 () #<bytecode 0x51b1ee9548b3>))
                              ("\\.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)
  #<subr set-auto-mode>()
  so-long--set-auto-mode(#<subr set-auto-mode>)
    so-long--set-auto-mode = t
  apply(so-long--set-auto-mode #<subr set-auto-mode> nil)
  set-auto-mode()
  normal-mode(t)
    enable-local-variables = t
  after-find-file(nil t)
  find-file-noselect-1(#<buffer android.c> "~/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(#<killed 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 () #<bytecode 0x51b1ee9548b3>))
                              ("\\.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)
  #<subr set-auto-mode>()
  so-long--set-auto-mode(#<subr set-auto-mode>)
    so-long--set-auto-mode = t
  apply(so-long--set-auto-mode #<subr 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---






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  2024-08-09  9:45 ` Stefan Kangas
@ 2024-08-09 17:39   ` Raffael Stocker
  2024-08-09 19:59     ` Raffael Stocker
  0 siblings, 1 reply; 7+ messages in thread
From: Raffael Stocker @ 2024-08-09 17:39 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 72532

Stefan Kangas <stefankangas@gmail.com> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  2024-08-09 17:39   ` Raffael Stocker
@ 2024-08-09 19:59     ` Raffael Stocker
  2024-08-15  8:36       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Raffael Stocker @ 2024-08-09 19:59 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 72532

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

> Stefan Kangas <stefankangas@gmail.com> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#72532: [PATCH] ; lisp/progmodes/which-func.el (which-function-mode): check buffer
  2024-08-09 19:59     ` Raffael Stocker
@ 2024-08-15  8:36       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-08-15  8:36 UTC (permalink / raw)
  To: Raffael Stocker; +Cc: 72532-done, stefankangas

> Cc: 72532@debbugs.gnu.org
> From: Raffael Stocker <r.stocker@mnet-mail.de>
> Date: Fri, 09 Aug 2024 21:59:46 +0200
> 
> Raffael Stocker <r.stocker@mnet-mail.de> writes:
> 
> > Stefan Kangas <stefankangas@gmail.com> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-15  8:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-08-09 17:39   ` Raffael Stocker
2024-08-09 19:59     ` Raffael Stocker
2024-08-15  8:36       ` Eli Zaretskii

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.