all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
@ 2024-11-18  2:59 Taka Obsid
  2024-11-18 12:29 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Taka Obsid @ 2024-11-18  2:59 UTC (permalink / raw)
  To: 74412

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))"
```


In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.1.0, NS
appkit-2575.20 Version 15.1 (Build 24B83), git sha1 0756b1f2f54) of
2024-11-11 built on Leyline
Windowing system distributor 'Apple', version 10.3.2575
System Description: macOS 15.1

Configured using:
'configure --without-native-compilation --without-dbus --with-xwidgets
--with-tree-sitter --with-modules --with-pgtk
'CPPFLAGS=-I/opt/local/include
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath
/opt/local/lib/gcc14
-Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-arch arm64''

Configured features:
ACL GIF GMP GNUTLS JPEG LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM XWIDGETS ZLIB

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Java

Minor modes in effect:
eglot-java-mode: t
outli-mode: t
indent-bars--ts-mode: t
indent-bars-mode: t
copilot-mode: t
electric-pair-mode: t
projectile-mode: t
global-dict-line-mode: t
dict-line-mode: t
popper-echo-mode: t
popper-mode: t
adaptive-wrap-prefix-mode: t
visual-fill-column-mode: t
global-auto-revert-mode: t
save-place-mode: t
default-text-scale-mode: t
window-numbering-mode: t
auto-dim-other-buffers-mode: t
global-page-break-lines-mode: t
minions-mode: t
doom-modeline-mode: t
dogears-mode: t
recentf-mode: t
company-quickhelp-mode: t
company-quickhelp-local-mode: t
company-box-mode: t
global-company-mode: t
company-mode: t
vertico-mode: t
dirvish-override-dired-mode: t
dape-breakpoint-global-mode: t
eglot-inlay-hints-mode: t
eglot--managed-mode: t
flymake-mode: t
hexl-follow-ascii: t
emt-mode: t
mpvi-emms-integrated-mode: t
puni-global-mode: t
puni-mode: t
auto-compile-on-load-mode: t
auto-compile-on-save-mode: t
keyfreq-autosave-mode: t
keyfreq-mode: t
sis-global-inline-mode: t
sis-inline-mode: t
sis-global-context-mode: t
sis-context-mode: t
sis-global-respect-mode: t
sis-global-cursor-color-mode: t
sis-auto-refresh-mode: t
savehist-mode: t
consult-org-roam-mode: t
org-roam-db-autosync-mode: t
outline-minor-mode: t
marginalia-mode: t
global-blamer-mode: t
blamer-mode: t
global-diff-hl-mode: t
diff-hl-mode: t
yas-global-mode: t
yas-minor-mode: t
meow-global-mode: t
meow-mode: t
meow-normal-mode: t
meow-esc-mode: t
good-scroll-mode: t
focus-autosave-mode: t
override-global-mode: t
straight-use-package-mode: t
straight-package-neutering-mode: t
global-hl-line-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tab-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
window-divider-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
/Users/takaobsid/.emacs.d/straight/build/web-mode/web-mode hides 
/Users/takaobsid/.emacs.d/elpa/web-mode-17.3.20/web-mode
/Users/takaobsid/.emacs.d/straight/build/web-mode/web-mode-autoloads 
hides /Users/takaobsid/.emacs.d/elpa/web-mode-17.3.20/web-mode-autoloads
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig hides 
/Applications/Emacs.app/Contents/Resources/lisp/editorconfig
/Users/takaobsid/.emacs.d/straight/build/external-completion/external-completion 
hides /Applications/Emacs.app/Contents/Resources/lisp/external-completion
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig-core 
hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-core
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig-conf-mode 
hides 
/Applications/Emacs.app/Contents/Resources/lisp/editorconfig-conf-mode
/Users/takaobsid/.emacs.d/straight/build/jsonrpc/jsonrpc hides 
/Applications/Emacs.app/Contents/Resources/lisp/jsonrpc
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig-tools 
hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-tools
/Users/takaobsid/.emacs.d/straight/build/transient/transient hides 
/Applications/Emacs.app/Contents/Resources/lisp/transient
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig-core-handle 
hides 
/Applications/Emacs.app/Contents/Resources/lisp/editorconfig-core-handle
/Users/takaobsid/.emacs.d/straight/build/editorconfig/editorconfig-fnmatch 
hides /Applications/Emacs.app/Contents/Resources/lisp/editorconfig-fnmatch
/Users/takaobsid/.emacs.d/straight/build/xref/xref hides 
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/xref
/Users/takaobsid/.emacs.d/straight/build/project/project hides 
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/project
/Users/takaobsid/.emacs.d/straight/build/eglot/eglot hides 
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/eglot
/Users/takaobsid/.emacs.d/straight/build/flymake/flymake hides 
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/flymake
/Users/takaobsid/.emacs.d/straight/build/org/ob-exp hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-exp
/Users/takaobsid/.emacs.d/straight/build/org/ob-emacs-lisp hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-emacs-lisp
/Users/takaobsid/.emacs.d/straight/build/org/oc hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc
/Users/takaobsid/.emacs.d/straight/build/org/ob-css hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-css
/Users/takaobsid/.emacs.d/straight/build/org/ob-lob hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lob
/Users/takaobsid/.emacs.d/straight/build/org/ol-irc hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-irc
/Users/takaobsid/.emacs.d/straight/build/org/ob-forth hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-forth
/Users/takaobsid/.emacs.d/straight/build/org/org-macs hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-macs
/Users/takaobsid/.emacs.d/straight/build/org/ob hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob
/Users/takaobsid/.emacs.d/straight/build/org/org-version hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-version
/Users/takaobsid/.emacs.d/straight/build/org/ob-scheme hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-scheme
/Users/takaobsid/.emacs.d/straight/build/org/ox hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox
/Users/takaobsid/.emacs.d/straight/build/org/ob-C hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-C
/Users/takaobsid/.emacs.d/straight/build/org/org-capture hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-capture
/Users/takaobsid/.emacs.d/straight/build/org/ob-ref hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ref
/Users/takaobsid/.emacs.d/straight/build/org/ob-clojure hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-clojure
/Users/takaobsid/.emacs.d/straight/build/org/org-mouse hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-mouse
/Users/takaobsid/.emacs.d/straight/build/org/org-persist hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-persist
/Users/takaobsid/.emacs.d/straight/build/org/org-ctags hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-ctags
/Users/takaobsid/.emacs.d/straight/build/org/org-entities hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-entities
/Users/takaobsid/.emacs.d/straight/build/org/org-archive hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-archive
/Users/takaobsid/.emacs.d/straight/build/org/ob-screen hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-screen
/Users/takaobsid/.emacs.d/straight/build/org/ol-bibtex hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-bibtex
/Users/takaobsid/.emacs.d/straight/build/org/ob-haskell hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-haskell
/Users/takaobsid/.emacs.d/straight/build/org/org-loaddefs hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-loaddefs
/Users/takaobsid/.emacs.d/straight/build/org/org-table hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-table
/Users/takaobsid/.emacs.d/straight/build/org/ol-eww hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-eww
/Users/takaobsid/.emacs.d/straight/build/org/ol-man hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-man
/Users/takaobsid/.emacs.d/straight/build/org/ox-org hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-org
/Users/takaobsid/.emacs.d/straight/build/org/org-num hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-num
/Users/takaobsid/.emacs.d/straight/build/org/org-plot hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-plot
/Users/takaobsid/.emacs.d/straight/build/org/ol-rmail hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-rmail
/Users/takaobsid/.emacs.d/straight/build/org/ob-awk hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-awk
/Users/takaobsid/.emacs.d/straight/build/org/ob-groovy hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-groovy
/Users/takaobsid/.emacs.d/straight/build/org/ob-octave hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-octave
/Users/takaobsid/.emacs.d/straight/build/org/org-faces hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-faces
/Users/takaobsid/.emacs.d/straight/build/org/oc-biblatex hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc-biblatex
/Users/takaobsid/.emacs.d/straight/build/org/org-colview hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-colview
/Users/takaobsid/.emacs.d/straight/build/org/ob-R hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-R
/Users/takaobsid/.emacs.d/straight/build/org/org-refile hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-refile
/Users/takaobsid/.emacs.d/straight/build/org/org-timer hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-timer
/Users/takaobsid/.emacs.d/straight/build/org/org-mobile hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-mobile
/Users/takaobsid/.emacs.d/straight/build/org/ob-fortran hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-fortran
/Users/takaobsid/.emacs.d/straight/build/org/ob-shell hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-shell
/Users/takaobsid/.emacs.d/straight/build/org/ob-perl hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-perl
/Users/takaobsid/.emacs.d/straight/build/org/ob-sqlite hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sqlite
/Users/takaobsid/.emacs.d/straight/build/org/oc-basic hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc-basic
/Users/takaobsid/.emacs.d/straight/build/org/ob-sed hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sed
/Users/takaobsid/.emacs.d/straight/build/org/org-list hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-list
/Users/takaobsid/.emacs.d/straight/build/org/ob-ruby hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ruby
/Users/takaobsid/.emacs.d/straight/build/org/ob-eval hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-eval
/Users/takaobsid/.emacs.d/straight/build/org/org-habit hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-habit
/Users/takaobsid/.emacs.d/straight/build/org/org-clock hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-clock
/Users/takaobsid/.emacs.d/straight/build/org/org-goto hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-goto
/Users/takaobsid/.emacs.d/straight/build/org/ox-html hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-html
/Users/takaobsid/.emacs.d/straight/build/org/org-src hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-src
/Users/takaobsid/.emacs.d/straight/build/org/ob-lisp hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lisp
/Users/takaobsid/.emacs.d/straight/build/org/ol-eshell hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-eshell
/Users/takaobsid/.emacs.d/straight/build/org/ob-ditaa hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ditaa
/Users/takaobsid/.emacs.d/straight/build/org/org-pcomplete hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-pcomplete
/Users/takaobsid/.emacs.d/straight/build/org/org-lint hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-lint
/Users/takaobsid/.emacs.d/straight/build/org/ox-latex hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-latex
/Users/takaobsid/.emacs.d/straight/build/org/ob-sass hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sass
/Users/takaobsid/.emacs.d/straight/build/org/ob-tangle hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-tangle
/Users/takaobsid/.emacs.d/straight/build/org/ob-calc hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-calc
/Users/takaobsid/.emacs.d/straight/build/org/ob-java hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-java
/Users/takaobsid/.emacs.d/straight/build/org/ox-icalendar hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-icalendar
/Users/takaobsid/.emacs.d/straight/build/org/ol-mhe hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-mhe
/Users/takaobsid/.emacs.d/straight/build/org/org-attach-git hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-attach-git
/Users/takaobsid/.emacs.d/straight/build/org/ox-md hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-md
/Users/takaobsid/.emacs.d/straight/build/org/ox-beamer hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-beamer
/Users/takaobsid/.emacs.d/straight/build/org/org-element hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-element
/Users/takaobsid/.emacs.d/straight/build/org/oc-natbib hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc-natbib
/Users/takaobsid/.emacs.d/straight/build/org/org-protocol hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-protocol
/Users/takaobsid/.emacs.d/straight/build/org/ob-gnuplot hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-gnuplot
/Users/takaobsid/.emacs.d/straight/build/org/org-tempo hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-tempo
/Users/takaobsid/.emacs.d/straight/build/org/ob-latex hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-latex
/Users/takaobsid/.emacs.d/straight/build/org/ol-w3m hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-w3m
/Users/takaobsid/.emacs.d/straight/build/org/org-id hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-id
/Users/takaobsid/.emacs.d/straight/build/org/ox-man hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-man
/Users/takaobsid/.emacs.d/straight/build/org/ol-doi hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-doi
/Users/takaobsid/.emacs.d/straight/build/org/org-feed hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-feed
/Users/takaobsid/.emacs.d/straight/build/org/org-fold-core hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-fold-core
/Users/takaobsid/.emacs.d/straight/build/org/ob-julia hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-julia
/Users/takaobsid/.emacs.d/straight/build/org/ob-lua hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lua
/Users/takaobsid/.emacs.d/straight/build/org/ob-table hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-table
/Users/takaobsid/.emacs.d/straight/build/org/ob-ocaml hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ocaml
/Users/takaobsid/.emacs.d/straight/build/org/oc-csl hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc-csl
/Users/takaobsid/.emacs.d/straight/build/org/ol-gnus hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-gnus
/Users/takaobsid/.emacs.d/straight/build/org/org-indent hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-indent
/Users/takaobsid/.emacs.d/straight/build/org/ob-lilypond hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lilypond
/Users/takaobsid/.emacs.d/straight/build/org/ob-matlab hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-matlab
/Users/takaobsid/.emacs.d/straight/build/org/org-datetree hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-datetree
/Users/takaobsid/.emacs.d/straight/build/org/ol-docview hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-docview
/Users/takaobsid/.emacs.d/straight/build/org/oc-bibtex hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/oc-bibtex
/Users/takaobsid/.emacs.d/straight/build/org/ob-python hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-python
/Users/takaobsid/.emacs.d/straight/build/org/ob-makefile hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-makefile
/Users/takaobsid/.emacs.d/straight/build/org/org-duration hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-duration
/Users/takaobsid/.emacs.d/straight/build/org/org-agenda hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-agenda
/Users/takaobsid/.emacs.d/straight/build/org/ob-dot hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-dot
/Users/takaobsid/.emacs.d/straight/build/org/ob-js hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-js
/Users/takaobsid/.emacs.d/straight/build/org/ox-publish hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-publish
/Users/takaobsid/.emacs.d/straight/build/org/org-inlinetask hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-inlinetask
/Users/takaobsid/.emacs.d/straight/build/org/ob-org hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-org
/Users/takaobsid/.emacs.d/straight/build/org/org-keys hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-keys
/Users/takaobsid/.emacs.d/straight/build/org/ob-core hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-core
/Users/takaobsid/.emacs.d/straight/build/org/org-compat hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-compat
/Users/takaobsid/.emacs.d/straight/build/org/ol hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol
/Users/takaobsid/.emacs.d/straight/build/org/ox-odt hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-odt
/Users/takaobsid/.emacs.d/straight/build/org/ol-info hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-info
/Users/takaobsid/.emacs.d/straight/build/org/ob-plantuml hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-plantuml
/Users/takaobsid/.emacs.d/straight/build/org/ob-eshell hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-eshell
/Users/takaobsid/.emacs.d/straight/build/org/ox-ascii hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-ascii
/Users/takaobsid/.emacs.d/straight/build/org/ox-koma-letter hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-koma-letter
/Users/takaobsid/.emacs.d/straight/build/org/ob-maxima hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-maxima
/Users/takaobsid/.emacs.d/straight/build/org/org hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org
/Users/takaobsid/.emacs.d/straight/build/org/ol-bbdb hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ol-bbdb
/Users/takaobsid/.emacs.d/straight/build/org/org-macro hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-macro
/Users/takaobsid/.emacs.d/straight/build/org/org-fold hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-fold
/Users/takaobsid/.emacs.d/straight/build/org/ob-sql hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sql
/Users/takaobsid/.emacs.d/straight/build/org/org-attach hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-attach
/Users/takaobsid/.emacs.d/straight/build/org/org-cycle hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-cycle
/Users/takaobsid/.emacs.d/straight/build/org/ob-processing hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-processing
/Users/takaobsid/.emacs.d/straight/build/org/ox-texinfo hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ox-texinfo
/Users/takaobsid/.emacs.d/straight/build/org/org-crypt hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-crypt
/Users/takaobsid/.emacs.d/straight/build/org/org-footnote hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-footnote
/Users/takaobsid/.emacs.d/straight/build/org/org-element-ast hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/org-element-ast
/Users/takaobsid/.emacs.d/straight/build/org/ob-comint hides 
/Applications/Emacs.app/Contents/Resources/lisp/org/ob-comint
/Users/takaobsid/.emacs.d/straight/build/compat/compat hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/compat
/Users/takaobsid/.emacs.d/straight/build/track-changes/track-changes 
hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/track-changes
/Users/takaobsid/.emacs.d/straight/build/seq/seq hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/seq
/Users/takaobsid/.emacs.d/straight/build/let-alist/let-alist hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/let-alist
/Users/takaobsid/.emacs.d/straight/build/map/map hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/map
/Users/takaobsid/.emacs.d/straight/build/eldoc/eldoc hides 
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/eldoc

Features:
(puni disp-table shadow sort mail-extr emacsbug help-fns radix-tree
cl-print vertico-directory eglot-java outli indent-bars-ts indent-bars
cus-edit cus-start cus-load copilot copilot-balancer editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch
elec-pair java-ts-mode c-ts-common orderless projectile lisp-mnt grep
ibuf-ext all-the-icons-ibuffer-autoloads ibuffer ibuffer-loaddefs
vertico-repeat dict-line gnutls popper-echo popper network-stream
url-http url-gw nsm url-cache url-auth adaptive-wrap visual-fill-column
time autorevert saveplace tramp-cache time-stamp tramp-sh
default-text-scale window-numbering auto-dim-other-buffers
page-break-lines minions doom-modeline doom-modeline-segments
doom-modeline-env doom-modeline-core shrink-path f s dogears which-func
welcome-dashboard nerd-icons nerd-icons-faces nerd-icons-data
nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon
nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon
nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon recentf
company-quickhelp pos-tip company-box company-box-doc frame-local
company-box-icons all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons company-oddmuse company-keywords company-etags etags
fileloop company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company vertico dirvish transient dape
eglot external-completion xref flymake seq-25 diff ert debug backtrace
filenotify imenu jsonrpc warnings hexl gdb-mi bindat gud tree-widget
wid-edit repeat pulse jka-compr emt init-keybinding init-secrets
init-dictionary dict-line-autoloads init-translate
emacs-immersive-translate-autoloads init-ai copilot-chat-autoloads
chatgpt-shell-autoloads shell-maker-autoloads aider-autoloads
gptel-autoloads init-fileinfo file-info-autoloads
browse-at-remote-autoloads init-tokenizer emt-autoloads init-emms
mpvi-autoloads mpvi mpvi-ps emms-player-mpv emms-playing-time emms-info
emms-later-do emms-player-simple emms emms-compat ffap emms-autoloads
init-esup esup-autoloads init-cloud emacs-dropbox-autoloads init-typst
typst-ts-mode-autoloads init-wolfram init-web grip-mode-autoloads
search-web-autoloads init-ejc-sql ejc-sql-autoloads clomacs-autoloads
auto-complete-autoloads popup-autoloads init-clojure
clj-refactor-autoloads inflections-autoloads multiple-cursors-autoloads
paredit-autoloads cider-autoloads sesman-autoloads queue-autoloads
parseedn-autoloads parseclj-autoloads inf-clojure-autoloads
clojure-mode-autoloads init-languages geiser-mit-autoloads
geiser-autoloads json-mode-autoloads json-snatcher-autoloads
yaml-mode-autoloads mvn-el-autoloads dape-autoloads devdocs-autoloads
protobuf-mode-autoloads ein-autoloads polymode-autoloads
anaphora-autoloads puni-autoloads quickrun-autoloads conda-autoloads
pythonic-autoloads init-telega telega-autoloads
rainbow-identifiers-autoloads init-gpg init-autocompile auto-compile
auto-compile-autoloads init-keyfreq keyfreq keyfreq-autoloads
init-treemacs treemacs-tab-bar-autoloads treemacs-persp-autoloads
persp-mode-autoloads treemacs-magit-autoloads
treemacs-icons-dired-autoloads treemacs-projectile-autoloads
treemacs-autoloads cfrs-autoloads hydra-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads init-projectile init-rg rg-autoloads
wgrep-autoloads init-terminal-here terminal-here-autoloads init-vterm
eat-autoloads init-rime sis sis-autoloads phi-search-autoloads
init-pdftools pdf-tools-autoloads tablist-autoloads init-treesitter
treesitter-context-autoloads posframe-plus-autoloads
nix-ts-mode-autoloads nix-mode-autoloads init-dirvish dirvish-autoloads
init-blink blink-search-autoloads init-vertico deadgrep-autoloads
savehist consult-dir-autoloads consult-org-roam consult-org-roam-buffer
consult bookmark pp emacsql-sqlite-builtin sqlite org-roam-migrate
org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node
org-roam-db org-roam-utils org-roam-compat org-roam org-capture
org-element org-persist avl-tree generator org-attach org-id org-refile
org-element-ast inline ob-scheme ob-rust ob-latex ob-shell ob-python
python project ob-js ob-java ob-C cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit
executable ob-comint org-pcomplete org-list org-footnote org-faces
org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol org-fold org-fold-core org-keys oc org-loaddefs thingatpt
find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs
emacsql-sqlite emacsql-sqlite-common emacsql emacsql-compiler
magit-section cursor-sensor dash consult-org-roam-autoloads
embark-consult-autoloads embark-autoloads marginalia
marginalia-autoloads orderless-autoloads vertico-autoloads init-magit
blamer async vc-git posframe tramp rx trampver tramp-integration files-x
tramp-message tramp-compat xdg parse-time iso8601 format-spec
tramp-loaddefs blamer-autoloads diff-hl log-view log-edit message
sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr mailabbrev mail-utils gmm-utils mailheader add-log pcvs-util
vc-dir ewoc vc vc-dispatcher diff-mode track-changes diff-hl-autoloads
forge-autoloads yaml-autoloads ghub-autoloads treepy-autoloads
let-alist-autoloads closql-autoloads magit-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
init-lspmode lsp-ui-autoloads lsp-mode-autoloads lv-autoloads
markdown-mode-autoloads spinner-autoloads ht-autoloads init-completion
lsp-copilot-autoloads copilot-autoloads editorconfig-autoloads
use-package-ensure company-box-autoloads frame-local-autoloads
company-quickhelp-autoloads pos-tip-autoloads company-autoloads
cape-keyword cape-char cape compat cape-autoloads
nerd-icons-corfu-autoloads consult-eglot-autoloads consult-autoloads
eglot-booster-autoloads eglot-java-autoloads eglot-autoloads
track-changes-autoloads jsonrpc-autoloads external-completion-autoloads
flymake-autoloads eldoc-autoloads init-yasnippet yasnippet
yasnippet-autoloads init-dashboard welcome-dashboard-autoloads
init-ibuffer ibuffer-projectile-autoloads projectile-autoloads
init-dogears dogears-autoloads map-autoloads init-meow meow meow-tutor
meow-cheatsheet meow-cheatsheet-layout meow-core meow-shims delsel
meow-esc meow-command array meow-beacon meow-thing meow-visual
meow-keypad meow-helpers meow-util meow-keymap meow-face meow-var
meow-autoloads init-themes transwin-autoloads beacon-autoloads
svg-tag-mode svg-lib svg dom xml svg-tag-mode-autoloads
svg-lib-autoloads flycheck-autoloads minions-autoloads
hide-mode-line-autoloads doom-modeline-autoloads shrink-path-autoloads
f-autoloads nerd-icons-autoloads page-break-lines-autoloads
mixed-pitch-autoloads iscroll-autoloads use-package-diminish
doom-themes-ext-org doom-themes-ext-visual-bell face-remap
doom-nord-light-theme pcase doom-themes doom-themes-base
doom-themes-autoloads indent-bars-autoloads all-the-icons-autoloads
init-fonts unicad-autoloads color init-popper popper-autoloads
init-window transpose-frame-autoloads auto-dim-other-buffers-autoloads
window-numbering-autoloads init-pixel-scroll good-scroll
good-scroll-linear good-scroll-bezier good-scroll-autoloads
init-gui-frames default-text-scale-autoloads init-osx-keys
osx-location-autoloads init-org org-popup-posframe-autoloads
posframe-autoloads org-noter-autoloads nov-autoloads esxml-autoloads
kv-autoloads djvu-autoloads org-download-autoloads async-autoloads
xeft-autoloads htmlize-autoloads org-tidy-autoloads
org-visual-outline-autoloads zotxt-autoloads deferred-autoloads
request-autoloads org-xlatex-autoloads org-roam-ui-autoloads
websocket-autoloads simple-httpd-autoloads finder-inf org-roam-autoloads
magit-section-autoloads emacsql-autoloads dash-autoloads s-autoloads
valign-autoloads org-modern-autoloads compat-autoloads seq-autoloads
org-appear-autoloads org-remoteimg-autoloads tex-mode compile
text-property-search shell pcomplete comint ansi-osc ansi-color ring
org-autoloads ob-rust-autoloads adaptive-wrap-autoloads
visual-fill-column-autoloads init-latex cdlatex-autoloads
auctex-autoloads tex-site info init-outli edmacro kmacro outli-autoloads
use-package-bind-key init-autosave focus-autosave-mode
focus-autosave-mode-autoloads bind-key easy-mmode init-exec-path
use-package-core project-autoloads xref-autoloads init-straight
straight-autoloads cl-extra help-mode straight init-site-lisp init-basic
hl-line init-const init-utils emacs-git-version
clangd-inactive-regions-autoloads web-mode-autoloads package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal kqueue cocoa
ns multi-tty make-network-process emacs)

Memory information:
((conses 16 632317 328409) (symbols 48 45976 0)
(strings 32 207152 14405) (string-bytes 1 7619467) (vectors 16 82361)
(vector-slots 8 1183471 97559) (floats 16 1382 9124)
(intervals 56 6455 117) (buffers 992 25))







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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-18  2:59 bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31 Taka Obsid
@ 2024-11-18 12:29 ` Eli Zaretskii
  2024-11-19  1:47   ` Taka Obsid
  2024-11-19 18:09 ` Juri Linkov
  2024-11-20 17:06 ` Daan Ro
  2 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-18 12:29 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412

> 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.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-18 12:29 ` Eli Zaretskii
@ 2024-11-19  1:47   ` Taka Obsid
  2024-11-19 15:37     ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Taka Obsid @ 2024-11-19  1:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74412

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

Yes, I have reported it in https://github.com/jdtsmith/outli/issues/17 
and the developer
recommended me to file this bug report. This is what he said:

 > 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?

在 2024/11/18 20:29, Eli Zaretskii 写道:
>> Date: Mon, 18 Nov 2024 10:59:00 +0800
>> From: Taka Obsid<liaotx2@gmail.com>
>>
>> Hi, I'm using `java-ts-mode' andhttps://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.

[-- Attachment #2: Type: text/html, Size: 3041 bytes --]

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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-19  1:47   ` Taka Obsid
@ 2024-11-19 15:37     ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-19 15:37 UTC (permalink / raw)
  To: Taka Obsid, Yuan Fu; +Cc: 74412

> Date: Tue, 19 Nov 2024 09:47:34 +0800
> Cc: 74412@debbugs.gnu.org
> From: Taka Obsid <liaotx2@gmail.com>
> 
> Yes, I have reported it in https://github.com/jdtsmith/outli/issues/17 and the developer
> recommended me to file this bug report. This is what he said:
> 
> > 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?

Yuan, could you please take a look?

> 在 2024/11/18 20:29, Eli Zaretskii 写道:
> 
>  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.






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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-18  2:59 bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31 Taka Obsid
  2024-11-18 12:29 ` Eli Zaretskii
@ 2024-11-19 18:09 ` Juri Linkov
  2024-11-20  3:34   ` Taka Obsid
  2024-11-20 17:06 ` Daan Ro
  2 siblings, 1 reply; 22+ messages in thread
From: Juri Linkov @ 2024-11-19 18:09 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412

> 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)

I suspect this depends on your java file since I tried some java files
existing in the emacs repo, and all they work fine.  Could you try
to find a minimal java file to reproduce the problem?





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-19 18:09 ` Juri Linkov
@ 2024-11-20  3:34   ` Taka Obsid
  2024-11-20  7:15     ` Juri Linkov
  0 siblings, 1 reply; 22+ messages in thread
From: Taka Obsid @ 2024-11-20  3:34 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 74412

I'm using `straight' so I start the emacs as

```sh

/Applications/Emacs.app/Contents/MacOS/Emacs -q --eval "(progn
           (add-to-list 'load-path 
\"~/.emacs.d/straight/build/java-ts-mode\")
           (add-to-list 'load-path \"~/.emacs.d/straight/build/outli\")
           (require 'java-ts-mode)
           (require 'outli))"

```

The file I tried is

```java

public class Test {
     public static void main(String[] args) {

     }
}

```

You might need to enable the outli-mode in the java file manually. It 
seems this bug only appears in gui emacs. The `revert-buffer' works fine 
in tui.

在 2024/11/20 02:09, Juri Linkov 写道:
>> 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)
> I suspect this depends on your java file since I tried some java files
> existing in the emacs repo, and all they work fine.  Could you try
> to find a minimal java file to reproduce the problem?





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20  3:34   ` Taka Obsid
@ 2024-11-20  7:15     ` Juri Linkov
  2024-11-20 14:06       ` Taka Obsid
  0 siblings, 1 reply; 22+ messages in thread
From: Juri Linkov @ 2024-11-20  7:15 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412

> I'm using `straight' so I start the emacs as
>
> ```sh
>
> /Applications/Emacs.app/Contents/MacOS/Emacs -q --eval "(progn
>           (add-to-list 'load-path
> \"~/.emacs.d/straight/build/java-ts-mode\")

Where do you get straight's version of java-ts-mode?

Does it differ from lisp/progmodes/java-ts-mode.el
provided by Emacs core?

Do you use treesit.el from `straight' too?

>           (add-to-list 'load-path \"~/.emacs.d/straight/build/outli\")
>           (require 'java-ts-mode)
>           (require 'outli))"
>
> ```
>
> The file I tried is
>
> ```java
>
> public class Test {
>     public static void main(String[] args) {
>
>     }
> }
>
> ```
>
> You might need to enable the outli-mode in the java file manually.

I tried this with lisp/progmodes/java-ts-mode.el,
and can't reproduce the bug.

> It seems this bug only appears in gui emacs. The `revert-buffer' works
> fine in tui.

Very strange, there should be no difference between gui and tui.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20  7:15     ` Juri Linkov
@ 2024-11-20 14:06       ` Taka Obsid
  2024-11-20 17:21         ` Juri Linkov
  2024-11-20 18:23         ` Juri Linkov
  0 siblings, 2 replies; 22+ messages in thread
From: Taka Obsid @ 2024-11-20 14:06 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 74412

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

OK I just find the java-ts-mode and treesit.el is not from `straight'... 
So the start script now only load `outli'.


I tried clone `outli' into `~/src/outli', and it works fine, while the 
straight build version is not.


I diffed the `~/.emacs.d/straight/build/outli/outli.el' with 
`~/src/outli/outli.el' and found that they are same. But there is a

file `outli-autoloads.el' in `~/.emacs.d/straight/build/outli', which be 
generated by `straight'. This file contains:

```elisp

(autoload 'outli-mode "outli" "\ Simple outline mode interaction based 
on comment-headings. This is a minor mode. If called interactively, 
toggle the `Outli mode' mode. If the prefix argument is positive, enable 
the mode, and if it is zero or negative, disable the mode. If called 
from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is 
nil, omitted, or is a positive number. Disable the mode if ARG is a 
negative number. To check whether the minor mode is enabled in the 
current buffer, evaluate the variable `outli-mode'. The mode's hook is 
called both when the mode is enabled and when it is disabled. 
\\{outli-mode-map} (fn &optional ARG)" t) (register-definition-prefixes 
"outli" '("outli-"))

```

I commented the line `(register-definition-prefixes "outli" 
'("outli-"))', and load `~/.emacs.d/straight/build/outli/outli.el',

and the `revert-buffer' works.

在 2024/11/20 15:15, Juri Linkov 写道:
>> I'm using `straight' so I start the emacs as
>>
>> ```sh
>>
>> /Applications/Emacs.app/Contents/MacOS/Emacs -q --eval "(progn
>>            (add-to-list 'load-path
>> \"~/.emacs.d/straight/build/java-ts-mode\")
> Where do you get straight's version of java-ts-mode?
>
> Does it differ from lisp/progmodes/java-ts-mode.el
> provided by Emacs core?
>
> Do you use treesit.el from `straight' too?
>
>>            (add-to-list 'load-path \"~/.emacs.d/straight/build/outli\")
>>            (require 'java-ts-mode)
>>            (require 'outli))"
>>
>> ```
>>
>> The file I tried is
>>
>> ```java
>>
>> public class Test {
>>      public static void main(String[] args) {
>>
>>      }
>> }
>>
>> ```
>>
>> You might need to enable the outli-mode in the java file manually.
> I tried this with lisp/progmodes/java-ts-mode.el,
> and can't reproduce the bug.
>
>> It seems this bug only appears in gui emacs. The `revert-buffer' works
>> fine in tui.
> Very strange, there should be no difference between gui and tui.

[-- Attachment #2: Type: text/html, Size: 3647 bytes --]

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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-18  2:59 bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31 Taka Obsid
  2024-11-18 12:29 ` Eli Zaretskii
  2024-11-19 18:09 ` Juri Linkov
@ 2024-11-20 17:06 ` Daan Ro
  2024-11-20 17:18   ` Juri Linkov
  2024-11-20 18:50   ` Eli Zaretskii
  2 siblings, 2 replies; 22+ messages in thread
From: Daan Ro @ 2024-11-20 17:06 UTC (permalink / raw)
  To: liaotx2@gmail.com; +Cc: 74412@debbugs.gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 224 bytes --]

Personally I also find treesit's decision to set outline variables
somewhat intrusive. I have to advice `treesit-major-mode-setup` to
disable that. If only there is an easier way to do it like the
attached patch.

Daanturo


[-- Attachment #1.2: Type: text/html, Size: 889 bytes --]

[-- Attachment #2: 0001-Add-custom-option-treesit-enable-outline-settings.patch --]
[-- Type: application/octet-stream, Size: 1324 bytes --]

From a6aa6420640922c748b173cfeb1cf20ee1baade8 Mon Sep 17 00:00:00 2001
From: Daanturo <daanturo@gmail.com>
Date: Wed, 20 Nov 2024 14:33:02 +0000
Subject: [PATCH] Add custom option treesit-enable-outline-settings

* lisp/treesit.el: Define the variable and use it in
treesit-major-mode-setup.
---
 lisp/treesit.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 2518204ce93..45720325f73 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -943,6 +943,11 @@ treesit-font-lock-level
   :set #'treesit--font-lock-level-setter
   :version "29.1")
 
+(defcustom treesit-enable-outline-settings t
+  "Non-nil means Tree sitter-based outline settings are enabled."
+  :type 'boolean
+  :version "31.1")
+
 (defvar-local treesit--font-lock-query-expand-range (cons 0 0)
   "The amount to expand the start and end of the region when fontifying.
 This should be a cons cell (START . END).  When fontifying a
@@ -3155,6 +3160,7 @@ treesit-major-mode-setup
 
   ;; Outline minor mode.
   (when (and (or treesit-outline-predicate treesit-simple-imenu-settings)
+             treesit-enable-outline-settings
              (not (seq-some #'local-variable-p
                             '(outline-search-function
                               outline-regexp outline-level))))
-- 
2.47.0


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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 17:06 ` Daan Ro
@ 2024-11-20 17:18   ` Juri Linkov
  2024-11-20 17:51     ` Daan Ro
  2024-11-20 18:53     ` Eli Zaretskii
  2024-11-20 18:50   ` Eli Zaretskii
  1 sibling, 2 replies; 22+ messages in thread
From: Juri Linkov @ 2024-11-20 17:18 UTC (permalink / raw)
  To: Daan Ro; +Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com

> Personally I also find treesit's decision to set outline variables
> somewhat intrusive. I have to advice `treesit-major-mode-setup` to
> disable that. If only there is an easier way to do it like the
> attached patch.
>
> +(defcustom treesit-enable-outline-settings t
> +  "Non-nil means Tree sitter-based outline settings are enabled."
> +  :type 'boolean
> +  :version "31.1")

Should such an option be more general and allow
disabling some other features too?

There is already 'treesit-font-lock-recompute-features'.
So a new option could have a similar name, e.g.
'treesit-disable-features' that the users could set to e.g.

  (setopt treesit-disable-features '(outline imenu))





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 14:06       ` Taka Obsid
@ 2024-11-20 17:21         ` Juri Linkov
  2024-11-20 18:23         ` Juri Linkov
  1 sibling, 0 replies; 22+ messages in thread
From: Juri Linkov @ 2024-11-20 17:21 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412

> I commented the line `(register-definition-prefixes "outli" '("outli-"))',
> and load `~/.emacs.d/straight/build/outli/outli.el',
>
> and the `revert-buffer' works. 

This is a very weird effect.  Maybe it's caused by file versions mismatch?





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 17:18   ` Juri Linkov
@ 2024-11-20 17:51     ` Daan Ro
  2024-11-20 18:25       ` Juri Linkov
  2024-11-20 18:53     ` Eli Zaretskii
  1 sibling, 1 reply; 22+ messages in thread
From: Daan Ro @ 2024-11-20 17:51 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com

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

> So a new option could have a similar name, e.g.
> 'treesit-disable-features' that the users could set to e.g.
>
> (setopt treesit-disable-features '(outline imenu))

That's much better, indeed.
Daanturo

On Nov 21 2024, at 12:18 am, Juri Linkov <juri@linkov.net> wrote:
> > Personally I also find treesit's decision to set outline variables
> > somewhat intrusive. I have to advice `treesit-major-mode-setup` to
> > disable that. If only there is an easier way to do it like the
> > attached patch.
> >
> > +(defcustom treesit-enable-outline-settings t
> > + "Non-nil means Tree sitter-based outline settings are enabled."
> > + :type 'boolean
> > + :version "31.1")
>
> Should such an option be more general and allow
> disabling some other features too?
>
> There is already 'treesit-font-lock-recompute-features'.
> So a new option could have a similar name, e.g.
> 'treesit-disable-features' that the users could set to e.g.
>
> (setopt treesit-disable-features '(outline imenu))

[-- Attachment #2: Type: text/html, Size: 2730 bytes --]

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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 14:06       ` Taka Obsid
  2024-11-20 17:21         ` Juri Linkov
@ 2024-11-20 18:23         ` Juri Linkov
  2024-11-21  1:48           ` Taka Obsid
  1 sibling, 1 reply; 22+ messages in thread
From: Juri Linkov @ 2024-11-20 18:23 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412

> I commented the line `(register-definition-prefixes "outli" '("outli-"))',
> and load `~/.emacs.d/straight/build/outli/outli.el',
> and the `revert-buffer' works. 

Ok, I looked more at the package outli, and now can reproduce the issue,
I get the same backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  #f(compiled-function () #<bytecode -0x19404f988c6a0bab>)()
  outline-map-region(#f(compiled-function () #<bytecode -0x19404f988c6a0bab>) 1 75)
  outline--hidden-headings-paths()
  outline-revert-buffer-restore-visibility()
  #f(compiled-function (f) #<bytecode 0x1cc541c8fdc4ae5e>)(outline-revert-buffer-restore-visibility)
  revert-buffer(t t)
  revert-buffer-quick(nil)
  funcall-interactively(revert-buffer-quick nil)
  command-execute(revert-buffer-quick)

This error comes after I removed the line

  outline-search-function nil

from `outli-mode'.  Please note that this line was added
quite recently in this commit:

https://github.com/jdtsmith/outli/commit/1366c230421aa834a9f4c986e31e63aa54e1c70b

So I'm 100% sure that you are using an old straight version from
(add-to-list 'load-path \"~/.emacs.d/straight/build/outli\")

Please upgrade the outli straight package to resolve the problem.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 17:51     ` Daan Ro
@ 2024-11-20 18:25       ` Juri Linkov
  0 siblings, 0 replies; 22+ messages in thread
From: Juri Linkov @ 2024-11-20 18:25 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com, Daan Ro

Yuan, what do you think about adding a new option
that will allow disabling some features?

>>> Personally I also find treesit's decision to set outline variables
>>> somewhat intrusive. I have to advice `treesit-major-mode-setup` to
>>> disable that. If only there is an easier way to do it like the
>>> attached patch.
>>>
>>> +(defcustom treesit-enable-outline-settings t
>>> + "Non-nil means Tree sitter-based outline settings are enabled."
>>> + :type 'boolean
>>> + :version "31.1")
>> 
>> Should such an option be more general and allow
>> disabling some other features too?
>> 
>> There is already 'treesit-font-lock-recompute-features'.
>> So a new option could have a similar name, e.g.
>> 'treesit-disable-features' that the users could set to e.g.
>>
>> (setopt treesit-disable-features '(outline imenu))

>> So a new option could have a similar name, e.g.
>> 'treesit-disable-features' that the users could set to e.g.
>> 
>> (setopt treesit-disable-features '(outline imenu))
>
> That's much better, indeed.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 17:06 ` Daan Ro
  2024-11-20 17:18   ` Juri Linkov
@ 2024-11-20 18:50   ` Eli Zaretskii
  2024-11-21  8:16     ` Daan Ro
  1 sibling, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-20 18:50 UTC (permalink / raw)
  To: Daan Ro; +Cc: 74412, liaotx2

> Cc: "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
> Date: Thu, 21 Nov 2024 00:06:41 +0700
> From: Daan Ro <daanturo@gmail.com>
> 
> Personally I also find treesit's decision to set outline variables
> somewhat intrusive.

I don't understand why.  These variables are meant to be set by modes,
so treesit.el uses them exactly as intended.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 17:18   ` Juri Linkov
  2024-11-20 17:51     ` Daan Ro
@ 2024-11-20 18:53     ` Eli Zaretskii
  1 sibling, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-20 18:53 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 74412, liaotx2, daanturo

> Cc: "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>,
>  "liaotx2@gmail.com" <liaotx2@gmail.com>
> From: Juri Linkov <juri@linkov.net>
> Date: Wed, 20 Nov 2024 19:18:41 +0200
> 
> > Personally I also find treesit's decision to set outline variables
> > somewhat intrusive. I have to advice `treesit-major-mode-setup` to
> > disable that. If only there is an easier way to do it like the
> > attached patch.
> >
> > +(defcustom treesit-enable-outline-settings t
> > +  "Non-nil means Tree sitter-based outline settings are enabled."
> > +  :type 'boolean
> > +  :version "31.1")
> 
> Should such an option be more general and allow
> disabling some other features too?

I don't see a need for an option at all.  All tree-sitter based modes
use these search functions, so treesit.el simply acts on their behalf
here.  It makes no sense to let users control how a major mode
customizes outline-minor-mode, because the major mode is supposed to
know how to adapt outlines with its main syntax, and what a heading
means in the context of that mode.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 18:23         ` Juri Linkov
@ 2024-11-21  1:48           ` Taka Obsid
  2024-11-21  6:51             ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Taka Obsid @ 2024-11-21  1:48 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 74412

You'r right, I repull and rebuild `outli' then it works. Thanks!

在 2024/11/21 02:23, Juri Linkov 写道:
>> I commented the line `(register-definition-prefixes "outli" '("outli-"))',
>> and load `~/.emacs.d/straight/build/outli/outli.el',
>> and the `revert-buffer' works.
> Ok, I looked more at the package outli, and now can reproduce the issue,
> I get the same backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>    #f(compiled-function () #<bytecode -0x19404f988c6a0bab>)()
>    outline-map-region(#f(compiled-function () #<bytecode -0x19404f988c6a0bab>) 1 75)
>    outline--hidden-headings-paths()
>    outline-revert-buffer-restore-visibility()
>    #f(compiled-function (f) #<bytecode 0x1cc541c8fdc4ae5e>)(outline-revert-buffer-restore-visibility)
>    revert-buffer(t t)
>    revert-buffer-quick(nil)
>    funcall-interactively(revert-buffer-quick nil)
>    command-execute(revert-buffer-quick)
>
> This error comes after I removed the line
>
>    outline-search-function nil
>
> from `outli-mode'.  Please note that this line was added
> quite recently in this commit:
>
> https://github.com/jdtsmith/outli/commit/1366c230421aa834a9f4c986e31e63aa54e1c70b
>
> So I'm 100% sure that you are using an old straight version from
> (add-to-list 'load-path \"~/.emacs.d/straight/build/outli\")
>
> Please upgrade the outli straight package to resolve the problem.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-21  1:48           ` Taka Obsid
@ 2024-11-21  6:51             ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-21  6:51 UTC (permalink / raw)
  To: Taka Obsid; +Cc: 74412-done, juri

> Cc: 74412@debbugs.gnu.org
> Date: Thu, 21 Nov 2024 09:48:59 +0800
> From: Taka Obsid <liaotx2@gmail.com>
> 
> You'r right, I repull and rebuild `outli' then it works. Thanks!

Thanks to both of you for investigating.  I'm therefore closing this
bug.





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-20 18:50   ` Eli Zaretskii
@ 2024-11-21  8:16     ` Daan Ro
  2024-11-21  9:07       ` Eli Zaretskii
  2024-11-21 17:58       ` Juri Linkov
  0 siblings, 2 replies; 22+ messages in thread
From: Daan Ro @ 2024-11-21  8:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com

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

Before treesit.el went to set those variables, there have been already a
bunch of packages based on outline-minor-mode for partitioning code into
sections using comments only by highlighting headers and providing
navigation, folding, etc. inspired by emacs-lisp-mode's outline-regexp
settings.

Such ones enable a feel of "literate" programming by bringing
outline-mode features to code section delimited by headings (special
comments like ";;;", ";; *") using just comments regardless of code
semantic.

The above is my use of outline-minor-mode, maybe other people have
different use cases. treesit.el makes the configuration harder by the
additional variable setting. I wish there's a hook like
treesit-after-major-mode-setup-hook to let people fine-tune or even undo
settings, but of course treesit-disable-features to prevent any
execution from the start is still better.

Daanturo

On Nov 21 2024, at 1:50 am, Eli Zaretskii <eliz@gnu.org> wrote:
> > Cc: "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
> > Date: Thu, 21 Nov 2024 00:06:41 +0700
> > From: Daan Ro <daanturo@gmail.com>
> >
> > Personally I also find treesit's decision to set outline variables
> > somewhat intrusive.
>
> I don't understand why. These variables are meant to be set by modes,
> so treesit.el uses them exactly as intended.
>


[-- Attachment #2: Type: text/html, Size: 2259 bytes --]

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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-21  8:16     ` Daan Ro
@ 2024-11-21  9:07       ` Eli Zaretskii
  2024-11-23 20:46         ` Yuan Fu
  2024-11-21 17:58       ` Juri Linkov
  1 sibling, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2024-11-21  9:07 UTC (permalink / raw)
  To: Daan Ro; +Cc: 74412, liaotx2

> Date: Thu, 21 Nov 2024 15:16:14 +0700
> From: Daan Ro <daanturo@gmail.com>
> Cc: "liaotx2@gmail.com" <liaotx2@gmail.com>, 
>  "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
> 
> Before treesit.el went to set those variables, there have been already a
> bunch of packages based on outline-minor-mode for partitioning code into
> sections using comments only by highlighting headers and providing
> navigation, folding, etc. inspired by emacs-lisp-mode's outline-regexp
> settings.
> 
> Such ones enable a feel of "literate" programming by bringing
> outline-mode features to code section delimited by headings (special
> comments like ";;;", ";; *") using just comments regardless of code
> semantic.
> 
> The above is my use of outline-minor-mode, maybe other people have
> different use cases. treesit.el makes the configuration harder by the
> additional variable setting. I wish there's a hook like
> treesit-after-major-mode-setup-hook to let people fine-tune or even undo
> settings, but of course treesit-disable-features to prevent any
> execution from the start is still better.

There's a mode hook run by every mode based on treesit.el, so if the
settings by treesit.el are inappropriate, and the major mode itself
somehow decided to use them anyway, and the user doesn't like that,
the user should be able to countermand the treesit.el settings in that
mode hook.

In addition, packages that use outline-minor-mode in ways that are
incompatible with what treesit.el does should be able to reset these
variables to nil or to some other function, as they need.

The purpose of treesit.el doing this is to make it easier for
treesit-based modes to set up their support for outline-minor-mode, so
that we won't need to perform the same settings in every major mode
based on tree-sitter.  I don't see anything wrong here.  Modes and
packages which for some reason don't like that should override these
values, and that is easy enough to do without adding any user options.
Let's keep in mind that every new user option makes Emacs more complex
to use for users, which need to learn about the option and modify
their init files.  Instead, modes and packages should DTRT by default
without requiring users to get their (mode's) act together.






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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-21  8:16     ` Daan Ro
  2024-11-21  9:07       ` Eli Zaretskii
@ 2024-11-21 17:58       ` Juri Linkov
  1 sibling, 0 replies; 22+ messages in thread
From: Juri Linkov @ 2024-11-21 17:58 UTC (permalink / raw)
  To: Daan Ro; +Cc: 74412@debbugs.gnu.org, Eli Zaretskii, liaotx2@gmail.com

> The above is my use of outline-minor-mode, maybe other people have
> different use cases. treesit.el makes the configuration harder by the
> additional variable setting. I wish there's a hook like
> treesit-after-major-mode-setup-hook to let people fine-tune or even undo
> settings, but of course treesit-disable-features to prevent any
> execution from the start is still better.

If a ts-mode doesn't allow using a hook to override
mode's default settings, this would be a serious limitation.
But does such a limitation really exist?
It seems there is no need to add treesit-after-major-mode-setup-hook,
since I see no problem with using the existing hooks.
For example, such customization correctly overrides outline settings
for both non-ts and ts-modes:

  ;; non-ts
  (add-hook 'ruby-base-mode-hook
            (lambda ()
              ;; Add more Rails spec keywords
              (setq-local outline-regexp
                          (concat "^\\s *"
                                  (regexp-opt '("module" "class" "def" "private"
                                                "describe" "feature" "context" "before" "after"
                                                "it" "fit" "xit"))
                                  "\\_>"))))
  ;; same for ts-mode
  (add-hook 'ruby-ts-mode-hook
            (lambda ()
              ;; Add more Rails spec keywords
              (setq-local
               treesit-outline-predicate
               (lambda (node)
                 (or (string-match-p
                      (rx bos (or "module"
                                  "class"
                                  "singleton_class"
                                  "method"
                                  "singleton_method"
                                  "alias")
                          eos)
                      (treesit-node-type node))
                     (and (equal (treesit-node-type node) "call")
                          (if-let ((method (treesit-node-child-by-field-name
                                            node "method")))
                              (string-match-p
                               (rx bos (or "describe"
                                           "feature"
                                           "context"
                                           "before"
                                           "after"
                                           "it"
                                           "fit"
                                           "test")
                                   eos)
                               (treesit-node-text method)))))))))





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

* bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
  2024-11-21  9:07       ` Eli Zaretskii
@ 2024-11-23 20:46         ` Yuan Fu
  0 siblings, 0 replies; 22+ messages in thread
From: Yuan Fu @ 2024-11-23 20:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74412, liaotx2, Daan Ro



> On Nov 21, 2024, at 1:07 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Thu, 21 Nov 2024 15:16:14 +0700
>> From: Daan Ro <daanturo@gmail.com>
>> Cc: "liaotx2@gmail.com" <liaotx2@gmail.com>, 
>> "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
>> 
>> Before treesit.el went to set those variables, there have been already a
>> bunch of packages based on outline-minor-mode for partitioning code into
>> sections using comments only by highlighting headers and providing
>> navigation, folding, etc. inspired by emacs-lisp-mode's outline-regexp
>> settings.
>> 
>> Such ones enable a feel of "literate" programming by bringing
>> outline-mode features to code section delimited by headings (special
>> comments like ";;;", ";; *") using just comments regardless of code
>> semantic.
>> 
>> The above is my use of outline-minor-mode, maybe other people have
>> different use cases. treesit.el makes the configuration harder by the
>> additional variable setting. I wish there's a hook like
>> treesit-after-major-mode-setup-hook to let people fine-tune or even undo
>> settings, but of course treesit-disable-features to prevent any
>> execution from the start is still better.
> 
> There's a mode hook run by every mode based on treesit.el, so if the
> settings by treesit.el are inappropriate, and the major mode itself
> somehow decided to use them anyway, and the user doesn't like that,
> the user should be able to countermand the treesit.el settings in that
> mode hook.
> 
> In addition, packages that use outline-minor-mode in ways that are
> incompatible with what treesit.el does should be able to reset these
> variables to nil or to some other function, as they need.
> 
> The purpose of treesit.el doing this is to make it easier for
> treesit-based modes to set up their support for outline-minor-mode, so
> that we won't need to perform the same settings in every major mode
> based on tree-sitter.  I don't see anything wrong here.  Modes and
> packages which for some reason don't like that should override these
> values, and that is easy enough to do without adding any user options.
> Let's keep in mind that every new user option makes Emacs more complex
> to use for users, which need to learn about the option and modify
> their init files.  Instead, modes and packages should DTRT by default
> without requiring users to get their (mode's) act together.


The issue is usually that tree-sitter automatically sets outline-search-function, and the package that uses outline-minor-mode only sets outline-regexp and doesn’t set outline-search-function to nil. Since outline prioritizes outline-search-function over outline-regex, it appears that tree-sitter’s outline setting overrides that of the package.

Most outline-related packages don’t set outline-search-function to nil since it’s usually nil by default. So tree-sitter’s behavior will surely break these packages. But since tree-sitter’s setup runs before minor modes, we can’t really tell if the user will later enable a minor mode that tree-sitter’s setup might break.

TRT here is probably for the packages to explicitly set outline-search-function to nil.

Yuan




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

end of thread, other threads:[~2024-11-23 20:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18  2:59 bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31 Taka Obsid
2024-11-18 12:29 ` Eli Zaretskii
2024-11-19  1:47   ` Taka Obsid
2024-11-19 15:37     ` Eli Zaretskii
2024-11-19 18:09 ` Juri Linkov
2024-11-20  3:34   ` Taka Obsid
2024-11-20  7:15     ` Juri Linkov
2024-11-20 14:06       ` Taka Obsid
2024-11-20 17:21         ` Juri Linkov
2024-11-20 18:23         ` Juri Linkov
2024-11-21  1:48           ` Taka Obsid
2024-11-21  6:51             ` Eli Zaretskii
2024-11-20 17:06 ` Daan Ro
2024-11-20 17:18   ` Juri Linkov
2024-11-20 17:51     ` Daan Ro
2024-11-20 18:25       ` Juri Linkov
2024-11-20 18:53     ` Eli Zaretskii
2024-11-20 18:50   ` Eli Zaretskii
2024-11-21  8:16     ` Daan Ro
2024-11-21  9:07       ` Eli Zaretskii
2024-11-23 20:46         ` Yuan Fu
2024-11-21 17:58       ` Juri Linkov

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.