Subject: 28.2; global-display-line-numbers-mode with debbugs package cause Lisp nesting exceeds ‘max-lisp-eval-depth’

From: Mats Lidell <[email-masked]>
Date: Mon, 26 Aug 2024 00:19:16 +0200

Hi,

With Emacs 27.2 and 28.2 using global-display-line-numbers-mode after fetching a bug with debbugs leads to Lisp nesting exceeds ‘max-lisp-eval-depth’. With Emacs 29.4 or Emacs 30 there is no error.

The recipe used is this:

    (setq debug-on-error t)
    (require 'package)
    (package-refresh-contents)
    (package-install 'debbugs)
    (debbugs-gnu-bugs 100)
    (global-display-line-numbers-mode)

Tested by putting the recipe in a file "dot-emacs" in the current folder and running with docker for the different Emacs versions: (Example for 28.2)

    > docker run -v $(pwd):/emacs -it silex/emacs:28.2 emacs -Q -l /emacs/dot-emacs

The backtrace:

Debugger entered--Lisp error: (error "Lisp nesting exceeds ‘max-lisp-eval-depth’")
  window-normalize-window(#<window 1 on *Bugs*> t)
  set-window-buffer-start-and-point(#<window 1 on *Bugs*> #<buffer *scratch*> #<marker at 1 in *scratch*> #<marker at 1 in *scratch*>)
  switch-to-prev-buffer(#<window 1 on *Bugs*> kill)
  replace-buffer-in-windows(#<buffer *Bugs*>)
  kill-buffer("*Bugs*")
  debbugs-gnu-show-reports()
  debbugs-gnu-rescan()
  run-hooks(tabulated-list-revert-hook)
  tabulated-list-revert()
  run-hooks(display-line-numbers-mode-hook display-line-numbers-mode-on-hook)
  display-line-numbers-mode()
  display-line-numbers--turn-on()
  global-display-line-numbers-mode-enable-in-buffers()
  run-hooks(after-change-major-mode-hook)
  run-mode-hooks(debbugs-gnu-mode-hook)
  debbugs-gnu-mode()
  debbugs-gnu-show-reports()
  debbugs-gnu-rescan()
  run-hooks(tabulated-list-revert-hook)
  tabulated-list-revert()
  run-hooks(display-line-numbers-mode-hook display-line-numbers-mode-on-hook)
  display-line-numbers-mode()
  display-line-numbers--turn-on()
  global-display-line-numbers-mode-enable-in-buffers()
  run-hooks(after-change-major-mode-hook)
  run-mode-hooks(debbugs-gnu-mode-hook)
  debbugs-gnu-mode()
  debbugs-gnu-show-reports()

  [...repeating lines deleted...]

  debbugs-gnu-rescan()
  run-hooks(tabulated-list-revert-hook)
  tabulated-list-revert()
  run-hooks(display-line-numbers-mode-hook display-line-numbers-mode-on-hook)
  display-line-numbers-mode()
  display-line-numbers--turn-on()
  global-display-line-numbers-mode()
  eval-buffer(#<buffer  *load*> nil "/emacs/dot-emacs" nil t)  ; Reading at buffer position 155
  load-with-code-conversion("/emacs/dot-emacs" "/emacs/dot-emacs" nil t)
  load("/emacs/dot-emacs" nil t)
  command-line-1(("-l" "/emacs/dot-emacs"))
  command-line()
  normal-top-level()

Yours
-- 
%% Mats