From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Cutoff date for adding ruby-ts-mode? Date: Mon, 02 Jan 2023 20:44:28 +0200 Organization: LINKOV.NET Message-ID: <86edscwzcj.fsf@mail.linkov.net> References: <00b1ed5e-271b-fab7-cace-b6a04ac6fd46@yandex.ru> <83mt7571cu.fsf@gnu.org> <4766f3b1-3c95-fa18-d3c7-7cdc8d15c728@yandex.ru> <83sfgt14m3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7583"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Dmitry Gutov , emacs-devel@gnu.org, pedz@easesoftware.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 02 20:20:07 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pCQLt-0001lR-KU for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Jan 2023 20:20:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCQLU-00076Y-J7; Mon, 02 Jan 2023 14:19:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCQLS-000758-MU for emacs-devel@gnu.org; Mon, 02 Jan 2023 14:19:38 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCQLQ-0002FL-DF; Mon, 02 Jan 2023 14:19:38 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 7F4A1C0008; Mon, 2 Jan 2023 19:19:26 +0000 (UTC) In-Reply-To: <83sfgt14m3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Jan 2023 14:51:48 +0200") Received-SPF: pass client-ip=217.70.183.198; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302198 Archived-At: >> 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.