emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 4234033a47 3/5: ; * lisp/treesit.el: Add some comments.


From: Yuan Fu
Subject: emacs-29 4234033a47 3/5: ; * lisp/treesit.el: Add some comments.
Date: Sun, 25 Dec 2022 04:11:59 -0500 (EST)

branch: emacs-29
commit 4234033a47ae06d6aa7db41d36dbc3dcbfcf897e
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; * lisp/treesit.el: Add some comments.
---
 lisp/treesit.el | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index e8e93d09de..24fb316fab 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1583,6 +1583,34 @@ BACKWARD and ALL are the same as in 
`treesit-search-forward'."
     node))
 
 ;;; Navigation, defun, things
+;;
+;; Emacs lets you define "things" by a regexp that matches the type of
+;; a node, and here are some functions that lets you find the "things"
+;; at/around point, navigate backward/forward a "thing", etc.
+;;
+;; The most obvious "thing" is a defun, and there are thin wrappers
+;; around thing functions for defun for convenience.
+;;
+;; We have more command-like functions like:
+;; - treesit-beginning-of-thing/defun
+;; - treesit-end-of-thing/defun
+;; - treesit-thing/defun-at-point
+;;
+;; And more generic functions like:
+;; - treesit--things-around
+;; - treesit--top-level-thing
+;; - treesit--navigate-thing
+;;
+;; There are also some defun-specific functions, like
+;; treesit-defun-name, treesit-add-log-current-defun.
+;;
+;; TODO: I'm not entirely sure how would this go, so I only documented
+;; the "defun" functions and didn't document any "thing" functions.
+;; We should also document `treesit-block-type-regexp' and support it
+;; in major modes if we can meaningfully intergrate hideshow: I tried
+;; and failed, we need SomeOne that understands hideshow to look at
+;; it.  (BTW, hideshow should use its own
+;; `treesit-hideshow-block-type-regexp'.)
 
 (defvar-local treesit-defun-type-regexp nil
   "A regexp that matches the node type of defun nodes.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]