emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 247743bd1e9: ; * lisp/treesit.el (treesit-language-at-point-fun


From: Eli Zaretskii
Subject: emacs-29 247743bd1e9: ; * lisp/treesit.el (treesit-language-at-point-function): Fix doc.
Date: Sat, 7 Oct 2023 05:04:25 -0400 (EDT)

branch: emacs-29
commit 247743bd1e99821e111a838ca5070c5ba057ac1c
Author: Yuan Fu <casouri@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; * lisp/treesit.el (treesit-language-at-point-function): Fix doc.
    
    (cherry picked from commit 07ede5e92a58ac3739a0e5b0c9025bee2f75c5ba)
    (Bug#66183)
---
 lisp/treesit.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index c24ea90bba0..98eac7f6d63 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -132,7 +132,14 @@ Return the root node of the syntax tree."
 This is used by `treesit-language-at', which is used by various
 functions to determine which parser to use at point.
 
-The function is called with one argument, the position of point.")
+The function is called with one argument, the position of point.
+
+In general, this function should call `treesit-node-at' with an
+explicit language (usually the host language), and determine the
+language at point using the type of the returned node.
+
+DO NOT derive the language at point from parser ranges.  It's
+cumbersome and can't deal with some edge cases.")
 
 (defun treesit-language-at (position)
   "Return the language at POSITION.



reply via email to

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