]> git.eshelyaron.com Git - emacs.git/commit
Tree-sitter support for outline-minor-mode (bug#68824)
authorJuri Linkov <juri@linkov.net>
Mon, 12 Feb 2024 18:16:35 +0000 (20:16 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 13 Feb 2024 13:11:10 +0000 (14:11 +0100)
commitb0b30cc0d927f63d3cc70bd7b7c46d7b35b3990e
treea865638ea9d750571a2d15882ee4ef7e43a44966
parenta6cac7e8e47f1d369efbb0e560abb8b5d365a47b
Tree-sitter support for outline-minor-mode (bug#68824)

* doc/emacs/text.texi (Outline Format): Add 'outline-search-function'.

* doc/lispref/elisp.texi (Top): Add new menu item "Outline Minor Mode"
after "Imenu".

* doc/lispref/modes.texi (Modes): Add new menu item "Outline Minor Mode"
after "Imenu".
(Major Mode Conventions): Mention "Outline Minor Mode" with @pxref.
(Outline Minor Mode): New node.

* doc/lispref/parsing.texi (Tree-sitter Major Modes): Mention
'treesit-outline-predicate' with @pxref.

* lisp/treesit.el (treesit-outline-predicate): New buffer-local variable.
(treesit-outline-predicate--from-imenu): New internal function.
(treesit-outline-search, treesit-outline-level): New functions.
(treesit-major-mode-setup): Set up treesit-outline-predicate,
outline-search-function and outline-level.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--outline-predicate):
New internal function.
(c-ts-base-mode): Set 'treesit-outline-predicate' to
'c-ts-mode--outline-predicate'.

* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove 'outline-regexp'.
Suggested by john muhl <jm@pub.pink>.

* lisp/textmodes/html-ts-mode.el (html-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.

(cherry picked from commit 3b90e5052ce1eea47430c85c0c35741e25269ce2)
doc/emacs/text.texi
doc/lispref/elisp.texi
doc/lispref/modes.texi
doc/lispref/parsing.texi
etc/NEWS
lisp/progmodes/c-ts-mode.el
lisp/progmodes/heex-ts-mode.el
lisp/progmodes/lua-ts-mode.el
lisp/textmodes/html-ts-mode.el
lisp/treesit.el