From: Yuan Fu <casouri@gmail.com>
To: jostein@kjonigsen.net
Cc: emacs-devel@gnu.org
Subject: Re: tree-sitter: Paths used for loading of language definitions
Date: Mon, 17 Oct 2022 00:29:41 -0700 [thread overview]
Message-ID: <CDA8C32E-C9E1-45E4-8D5A-CEC95CB90989@gmail.com> (raw)
In-Reply-To: <d8648d8a-eb32-5a06-e89b-43a3ec04c66f@secure.kjonigsen.net>
> On Oct 17, 2022, at 12:14 AM, Jostein Kjønigsen <jostein@secure.kjonigsen.net> wrote:
>
>
>
> On 17.10.2022 06:27, Yuan Fu wrote:
>>
>>> That said, I've noticed something when building the feature/tree-sitter branch, and also while testing other things tree-sitter related... If a language-definition SO is missing... treesit.el in Emacs only reports looking for files and folders typically found within $HOME/.emacs.d/ (that is user-owned files).
>>>
>>> Based on that, I'm assuming those are the only locations probed. Is that assumption correct?
>>>
>> It shouldn’t be. Emacs should first look in treesit-extra-load-path, then ~/.emacs.d/tree-sitter, then standard system library locations. The exact locations depend on dlopen. Could you share the error message reported when loading a non-exist language? It should print all the locations it tries (as you observed).
>>
>> Yuan
>>
> textmodes/mhtml-mode.el:29:2: Error: Cannot load language definition: "javascript", ("/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript: cannot open shared object file: No such file or directory" "/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript.so: cannot open shared object file: No such file or directory" "libtree-sitter-javascript: cannot open shared object file: No such file or directory" "libtree-sitter-javascript.so: cannot open shared object file: No such file or directory")
Ah, I guess your system doesn’t explicitly say what path has been checked. The last two messages in the list is where dlopen searches the system paths.
>
> Does that impliy it checks in the standard system library localtion? If so, I guess there's no problem.
>
> In that case, sorry for the "noise", but I just wanted to make sure this was packagable and thought one check too much is better than one check too little :)
Yes, false positives are always better than false negative ;-)
Yuan
next prev parent reply other threads:[~2022-10-17 7:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 13:32 Some issues with the tree-sitter branch Eli Zaretskii
2022-10-16 14:01 ` Eli Zaretskii
2022-10-16 15:10 ` Eli Zaretskii
2022-10-16 19:36 ` tree-sitter: Paths used for loading of language definitions Jostein Kjønigsen
2022-10-16 20:12 ` Daniel Martín
2022-10-17 4:27 ` Yuan Fu
2022-10-17 7:14 ` Jostein Kjønigsen
2022-10-17 7:29 ` Yuan Fu [this message]
2022-10-17 8:02 ` Eli Zaretskii
2022-10-17 9:02 ` Yuan Fu
2022-10-17 9:08 ` Eli Zaretskii
2022-10-17 11:56 ` Stephen Leake
2022-10-17 13:39 ` Eli Zaretskii
2022-10-17 21:15 ` Yuan Fu
2022-10-17 4:53 ` Some issues with the tree-sitter branch Yuan Fu
2022-10-17 5:37 ` Po Lu
2022-10-17 5:48 ` Yuan Fu
2022-10-17 6:48 ` Eli Zaretskii
2022-10-17 9:12 ` Yuan Fu
2022-10-17 10:14 ` Eli Zaretskii
2022-10-18 0:15 ` Yuan Fu
2022-10-18 0:14 ` Yuan Fu
2022-10-18 16:11 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CDA8C32E-C9E1-45E4-8D5A-CEC95CB90989@gmail.com \
--to=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jostein@kjonigsen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).