> This seems to be a new conflict with Emacs 31, and
potentially a problem with treesit-outline
.
> Can you please file an Emacs bug report and link it here?
Date: Mon, 18 Nov 2024 10:59:00 +0800
From: Taka Obsid <liaotx2@gmail.com>
Hi, I'm using `java-ts-mode' and https://github.com/jdtsmith/outli.
While I tried to `revert-buffer' in a java file, it reports
`outline-map-region: Wrong type argument: number-or-marker-p, nil'.
The backtrace is:
```bt
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
#f(compiled-function () #<bytecode -0x1964e0de811a96ab>)()
outline-map-region(#f(compiled-function () #<bytecode
-0x1964e0de811a96ab>) 1 31382)
outline--hidden-headings-paths()
outline-revert-buffer-restore-visibility()
#f(compiled-function (f) #<bytecode
0x6badcbe8273644b>)(outline-revert-buffer-restore-visibility)
run-hook-wrapped(#f(compiled-function (f) #<bytecode 0x6badcbe8273644b>)
outline-revert-buffer-restore-visibility)
revert-buffer(t)
funcall-interactively(revert-buffer t)
call-interactively(revert-buffer record nil)
command-execute(revert-buffer record)
execute-extended-command(nil "revert-buffer" "rev")
funcall-interactively(execute-extended-command nil "revert-buffer" "rev")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
```
To repreduce it:
1. start Emacs with `java-ts-mode' and `outli' installed;
2. go to a java file;
3. `M-x outli-mode';
4. `M-x revert-buffer'.
The `outline-search-function' is `#'treesit-outline-search' and while I
set it to `nil', I can successfully revert the buffer.
```
emacs -q --eval "(progn
(add-to-list 'load-path \"/path/to/java-ts-mode/\")
(add-to-list 'load-path \"/path/to/outli/\")
(require 'java-ts-mode)
(require 'outli))"
```
Thanks, this seems to be a problem in the outli package? Because the
error is signaled by one of its functions (a hook it places on
revert-buffer-function, I guess?).
Did you report this to the developer of outli? If not, I suggest to
report it there first.