all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Rahul Martim Juliato <rahuljuliato@gmail.com>
Cc: "Eli Zaretskii" <eliz@gnu.org>,
	"Jostein Kjønigsen" <jostein@secure.kjonigsen.net>,
	"Yuan Fu" <casouri@gmail.com>,
	"Ergus via Emacs development discussions." <emacs-devel@gnu.org>
Subject: Re: [PATCH] feat: add markdown-ts-mode
Date: Sat, 27 Apr 2024 10:18:37 +0000	[thread overview]
Message-ID: <87frv7qfb6.fsf@posteo.net> (raw)
In-Reply-To: <87plugzxgx.fsf@gmail.com> (Rahul Martim Juliato's message of "Mon, 22 Apr 2024 22:20:14 -0300")

Rahul Martim Juliato <rahuljuliato@gmail.com> writes:

>> So if I understand correctly, there is no keymap or any convenience
>> features that markdown-mode provides, because this is just the
>> beginning, right?  A large part of major modes for me is not just the
>> syntax highlighting and integration into Emacs systems, but also
>> bindings that in the case of Markdown would insert links or add/remove
>> emphasis.  I think it would be nice, if we could add these features in
>> the future, and re-use bindings from a package like AucTeX to build on
>> existing intuition (org-mode would be an alternative, but I am not a fan
>> or their choice of bindings).  Some commands to "compile" and preview a
>> document would also be nice.
>
>
> Hello there again!
>
> Please find attached the current version of this patch.
>
> It now works with the "official" tree-sitter grammar for markdown:
> https://github.com/tree-sitter-grammars/tree-sitter-markdown
>
> Please note (as explained above) the `main branch' is not the default
> anymore, but `split_parser' is.
>
> They splitted the parser into two, one for the body of the document and
> another to inline.
>
> So, in order to test this patch, configure it with:
>
> (use-package markdown-ts-mode
>     :ensure nil
>     :defer t  
>     :mode ("\\.md\\'" . markdown-ts-mode)
>     :config
>     (add-to-list 'treesit-language-source-alist '(markdown
> "https://github.com/tree-sitter-grammars/tree-sitter-markdown"
> "split_parser" "tree-sitter-markdown/src"))
>     (add-to-list 'treesit-language-source-alist '(markdown-inline
> "https://github.com/tree-sitter-grammars/tree-sitter-markdown"
> "split_parser" "tree-sitter-markdown-inline/src")))

I have said this before, and will say it again,
`treesit-language-source-alist' shouldn't clone moving git repositories
but download tarballs (which basically every git host provides as a
feature, since git archive is built-in) and use those to build the
library.  These tarballs should be pinned in the -ts-mode.el files
themselves to make using these major modes more reliable.

> If you visit a markdown file treesit issues an error, as always, asking
> for the grammars.
>
> Then, install BOTH grammars:
>
> M-x treesit-install-language-grammar RET markdown RET
> M-x treesit-install-language-grammar RET markdown-inline RET
>
> Reload the `markdown-ts-mode'.
>
> And everything should be working fine :)
>
>
> @Philip, thanks for bringing that up! I completely agree with you;
> aiming for a fully-featured mode is our long-term objective.
>
> The idea here is to establish a foundation for supporting markdown files
> within Emacs, without relying on external packages.

That sounds good.

> From there, we can delve into discussions about editing and exporting
> features. For instance, we could consider mimicking bindings and prompts
> from org-mode, as well as exploring integrations if users opt to also
> utilize third-party markdown-mode.

I would be interested in helping out or at the very least to comment on
the development going on, since I had started writing the same mode
myself a while back, but never got around to it since because I don't
understand how `treesit-font-lock-rules' works.

> However, simply having the mode built-in reduces friction significantly
> for new ideas and collaborations :)

And makes it easier for external packages to rely on the code.  Usually
I'd also say that it makes Emacs more usable in offline environments,
but the fact that the tree-sitter grammars have to for now be downloaded
stands in the way of that :/

-- 
	Philip Kaludercic on peregrine



      reply	other threads:[~2024-04-27 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20  3:23 [PATCH] feat: add markdown-ts-mode Rahul Martim Juliato
2024-04-20  6:44 ` Eli Zaretskii
2024-04-20 17:45   ` Jostein Kjønigsen
2024-04-21  5:50     ` Rahul Martim Juliato
2024-04-22  7:02       ` Philip Kaludercic
2024-04-23  1:20         ` Rahul Martim Juliato
2024-04-27 10:18           ` Philip Kaludercic [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87frv7qfb6.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jostein@secure.kjonigsen.net \
    --cc=rahuljuliato@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.