From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Dmitry Gutov <dgutov@yandex.ru>,
emacs-devel@gnu.org, pedz@easesoftware.com
Subject: Re: Cutoff date for adding ruby-ts-mode?
Date: Mon, 02 Jan 2023 20:44:28 +0200 [thread overview]
Message-ID: <86edscwzcj.fsf@mail.linkov.net> (raw)
In-Reply-To: <83sfgt14m3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Jan 2023 14:51:48 +0200")
>> Sorry for the delay, ruby-ts-mode is now in emacs-29.
>
> Thanks.
>
>> Some rough edges around indentation remain (to be addressed in the
>> coming weeks), but the mode should be useful enough now.
>
> Good plan.
I confirm that everything in ruby-ts-mode works great.
Thanks Perry and Dmitry. One question is how to share
configuration between ruby-mode and ruby-ts-mode.
I guess since only one of modes makes sense within the
same session then the same hook could be run only
for one of these modes, selecting one on them
with `treesit-available-p' (note that `treesit-ready-p'
can't be used until treesit is loaded):
(add-hook (if (treesit-available-p) 'ruby-ts-mode-hook 'ruby-mode-hook)
(lambda ()
(when (treesit-available-p)
;; Copied from `ruby-mode' for `ruby-ts-mode':
(setq-local outline-regexp (concat "^\\s *"
(regexp-opt '("class" "module" "def"))
"\\_>"))
(setq-local outline-level (lambda () (1+ (/ (current-indentation)
ruby-indent-level))))
(add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local))
;; Other common settings
;; ...
))
Also the problem is that the default settings seen above
are not shared between modes.
next prev parent reply other threads:[~2023-01-02 18:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-29 21:39 Cutoff date for adding ruby-ts-mode? Dmitry Gutov
2022-12-30 8:16 ` Eli Zaretskii
2022-12-30 15:32 ` Dmitry Gutov
2022-12-30 16:59 ` Eli Zaretskii
2022-12-30 21:42 ` Dmitry Gutov
2022-12-31 6:31 ` Eli Zaretskii
2022-12-31 11:24 ` Stefan Kangas
2023-01-02 1:35 ` Dmitry Gutov
2023-01-02 12:51 ` Eli Zaretskii
2023-01-02 18:44 ` Juri Linkov [this message]
2023-01-03 1:22 ` Dmitry Gutov
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=86edscwzcj.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=dgutov@yandex.ru \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=pedz@easesoftware.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 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).