From: Eli Zaretskii <eliz@gnu.org>
To: Madhu <enometh@meer.net>
Cc: emacs-devel@gnu.org
Subject: Re: Treesit says grammar is unavailable when it
Date: Fri, 15 Dec 2023 11:00:03 +0200 [thread overview]
Message-ID: <831qbnq1rg.fsf@gnu.org> (raw)
In-Reply-To: <m3edfochj1.fsf@leonis4.robolove.meer.net> (message from Madhu on Fri, 15 Dec 2023 08:13:14 +0530)
> From: Madhu <enometh@meer.net>
> Date: Fri, 15 Dec 2023 08:13:14 +0530
>
> I still think writing a lisp interface to dlopen and dlclose would iron
> out a lot of things in the details and make it useful for treesitter
> related stuff. Or is the locking down the ffi interface done for FSF
> reasons?
First, this particular aspect of Emacs is unrelated to the issue at
hand, so I suggest a new thread with a different Subject.
And second, we indeed don't want to allow loading arbitrary shared
libraries into Emacs, except via the emacs-modules interfaces. It
mostly will make no sense anyway, since you will not be able to use
the loaded library without some glue code. The grammar libraries are
a rare exception, because the tree-sitter library handles the glue.
I also object to having a direct dlopen interface exposed to Lisp on
the grounds that Emacs (unlike Guile, perhaps) is not a library for
interfacing the OS via Lisp bindings. Emacs is a text-editing and
text-processing environment, and therefore should hide the OS features
behind suitable higher-level APIs. Like emacs-modules do, by
extending 'load' and similar. That makes these features more
portable, and allows writing Lisp programs that work on systems where
dlopen per se is not available.
> On another note, I also went through the same process with yaml-ts-mode,
> A pointer to where the treesitter plugin is available is missing from
> the docs. Then one has to turn to third parties for this information
> and to find the providers and toolchain providers and do the dance to
> their tunes.
This is a job for downstream distros. I explained in the past several
times why I object to making this our job.
> But most disappointing thing was that the modes come with absolutely no
> navigation functions. These are structured files, and emacs has provides
> way to navigate the structures. This is a general quality defect from
> to "prog" abstractions. (when the facililties are provided they are
> inadequate and a dedicated mode would have taken the diligence to do it
> right)
We have some navigation capabilities, like movement by defuns.
However, any reasonable extensions and improvements in this area will
surely be welcome, but I think we need a more detailed feature
requests for that.
Thanks.
next prev parent reply other threads:[~2023-12-15 9:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 12:43 Treesit says grammar is unavailable when it Gernot Kieseritzky
2023-12-13 3:33 ` Yuan Fu
2023-12-13 12:00 ` Eli Zaretskii
2023-12-14 8:14 ` Yuan Fu
2023-12-14 8:27 ` Eli Zaretskii
2023-12-15 2:43 ` Madhu
2023-12-15 9:00 ` Eli Zaretskii [this message]
2023-12-17 6:31 ` Yuan Fu
2023-12-17 8:32 ` Eli Zaretskii
2023-12-27 6:41 ` Yuan Fu
-- strict thread matches above, loose matches on Subject: below --
2023-03-10 9:24 mprodrigues
2023-03-10 12:32 ` 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=831qbnq1rg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=enometh@meer.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).