Bug#1036359: crashes with (wrong-type-argument consp nil)
Package: elpa-markdown-toc
Version: 0.1.5-2
Severity: grave
In Debian bookworm, markdown-toc is currently unusable.
Given the following markdown buffer:
```
# Background
## Why migrate?
## Gitolite and GitWeb inventory
# Proposal
```
markdown-toc-generate-toc crashes with:
Debugger entered--Lisp error: (wrong-type-argument consp nil)
markdown-imenu-create-nested-index()
funcall(markdown-imenu-create-nested-index)
(markdown-toc--compute-toc-structure (funcall imenu-create-index-function))
(funcall markdown-toc-user-toc-structure-manipulation-fn (markdown-toc--compute-toc-structure (funcall imenu-create-index-function)))
(markdown-toc--generate-toc (funcall markdown-toc-user-toc-structure-manipulation-fn (markdown-toc--compute-toc-structure (funcall imenu-create-index-function))))
(insert (markdown-toc--generate-toc (funcall markdown-toc-user-toc-structure-manipulation-fn (markdown-toc--compute-toc-structure (funcall imenu-create-index-function)))))
(save-excursion (if (markdown-toc--toc-already-present-p) (progn (markdown-toc--delete-toc t))) (insert (markdown-toc--generate-toc (funcall markdown-toc-user-toc-structure-manipulation-fn (markdown-toc--compute-toc-structure (funcall imenu-create-index-function))))))
markdown-toc-generate-toc(nil)
funcall-interactively(markdown-toc-generate-toc nil)
command-execute(markdown-toc-generate-toc record)
execute-extended-command(nil "markdown-toc-generate-toc" nil)
funcall-interactively(execute-extended-command nil "markdown-toc-generate-toc" nil)
command-execute(execute-extended-command)
-- System Information:
Debian Release: 12.0
APT prefers testing-security
APT policy: (500, 'testing-security'), (500, 'testing-debug'), (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-9-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages elpa-markdown-toc depends on:
ii dh-elpa-helper 2.0.16
ii elpa-dash 2.19.1+git20220608.1.0ac1ecf+dfsg-1
ii elpa-markdown-mode 2.5-1
ii elpa-s 1.12.0-5
ii emacsen-common 3.0.5
Versions of packages elpa-markdown-toc recommends:
ii emacs 1:28.2+1-14
ii emacs-gtk [emacs] 1:28.2+1-14
elpa-markdown-toc suggests no packages.
-- no debconf information
Reply to: