From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Cutoff date for adding ruby-ts-mode? Date: Tue, 3 Jan 2023 03:22:14 +0200 Message-ID: <95e27f0a-958b-0a39-b459-3d995a6ad28d@yandex.ru> References: <00b1ed5e-271b-fab7-cace-b6a04ac6fd46@yandex.ru> <83mt7571cu.fsf@gnu.org> <4766f3b1-3c95-fa18-d3c7-7cdc8d15c728@yandex.ru> <83sfgt14m3.fsf@gnu.org> <86edscwzcj.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: emacs-devel@gnu.org, pedz@easesoftware.com To: Juri Linkov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 03 02:23:11 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 1pCW1G-0000io-Ux for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Jan 2023 02:23:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCW0a-0004M1-0M; Mon, 02 Jan 2023 20:22:28 -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 1pCW0X-0004LD-B5 for emacs-devel@gnu.org; Mon, 02 Jan 2023 20:22:25 -0500 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCW0R-0005sY-3P; Mon, 02 Jan 2023 20:22:21 -0500 Original-Received: by mail-ed1-x534.google.com with SMTP id u28so37086782edd.10; Mon, 02 Jan 2023 17:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=0xoTgP97mbJlXkmo5rAtBJIhI3u1PQ17JudfhuFcg+k=; b=V/501ERnny72Y+UiHgrg6UMldVCyH4Qgr80yq1upVm1x4yxlDUDNee8653FEM8XYzM nL4CM+ZLpjrWTRluQ2ve9E703tp9+D6VBToRfT28SJFlleWvPjwVyLOxu27Ajsq423LV pWCr9FxC8Li2DER+cR/JnPhjJyXTCpF1S3ZIH/RSy06Uilk1ozkAAR8Ys7EK2FIbmPiw s1M/NbY2Q5sTpLtDFWA/6TiIbOdggrTWtAPiE1Hb/HlbIN6IpYxPF8sCBYvfxzzPtzND wnjBDrXgXRjbQkEv9TGl/VH/Tw+c5nQhZ5opa23+wOr40/ldxHbt5BYrO7bUQE63ZKvg fE1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0xoTgP97mbJlXkmo5rAtBJIhI3u1PQ17JudfhuFcg+k=; b=1L8Djro5d68XaUeb2pCY9YJNKU4HIvTENB4Tb+9B8E5iiU10Y2wxz9S1J52lB3cMlG tQx5g1EAIF75v9Js2Wkvhg63KZVx6EvSv5qRYTIFmY9ddHAHdDQFlPoNbZbusTz8xOSV Ku2UK2YuWWI0JW6LCb5lo2CPepWhqoQuJfvIS5WN3W1LhviqFchIxLQMFmo+x1/WGKOJ dKxuwVQrHlrVShPgevodSf9quYCD2rvf8sipCVRZ5LRuZZtnm+KPgQRLGmTDuTkhowjH YURAmIrzaVQ01IFaDza4CdZuEmmRny2uasVhsUkhqRj8IZmoxTjzNcz7yQ8rk1ynidgg sBtQ== X-Gm-Message-State: AFqh2kr4bU9Gw/NuGgNiUHnn05jOFf9kHBFrDJPYXY8JaK7FJsFXrg4b AtWOtZjCfruiGgut+5tFKl0= X-Google-Smtp-Source: AMrXdXu9mQaJqbidUafBOukGEAr2CLPi9whgfOn4JwFQZTgnlj43hr5MVlSkKlSncaAhLTfLWS6x4g== X-Received: by 2002:a50:eac6:0:b0:45a:7d2:9b35 with SMTP id u6-20020a50eac6000000b0045a07d29b35mr37344969edp.0.1672708936356; Mon, 02 Jan 2023 17:22:16 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id u22-20020aa7d996000000b0047021294426sm13149276eds.90.2023.01.02.17.22.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Jan 2023 17:22:15 -0800 (PST) Content-Language: en-US In-Reply-To: <86edscwzcj.fsf@mail.linkov.net> Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=raaahh@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-3.142, RCVD_IN_DNSWL_NONE=-0.0001, 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:302202 Archived-At: On 02/01/2023 20:44, Juri Linkov wrote: >>> 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. Good question, thanks. I've pushed a change in 6dd3e352f44 that moves the common code to a common base mode to derive from. Those include the settings you quote above, as well as the setup for electric-indent-functions and prettify-symbols-alist. And to answer the question itself, I guess you can use ruby-base-mode-hook now.