From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karan Ahlawat Newsgroups: gmane.emacs.help Subject: Setting up indent-on-type in a treesit based major-mode Date: Mon, 21 Oct 2024 00:39:41 +0530 Message-ID: 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="14841"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 20 22:03:00 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1t2c8i-0003jt-5M for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 22:03:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2c8E-00075U-Rj; Sun, 20 Oct 2024 16:02:32 -0400 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 1t2bJI-0003tI-7S for help-gnu-emacs@gnu.org; Sun, 20 Oct 2024 15:09:52 -0400 Original-Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2bJF-000732-OV for help-gnu-emacs@gnu.org; Sun, 20 Oct 2024 15:09:51 -0400 Original-Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2fb3c3d5513so39306981fa.1 for ; Sun, 20 Oct 2024 12:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729451387; x=1730056187; darn=gnu.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=hjpxuG3jweILHFyY0/IuBhVex1AlbLpPticWd+3toV8=; b=SneWCUuKA+ccJjD+HYY1yFOMLX7aNStRM6sjTPjWzASLqXEEJimijQY8Y0ja/6hr9Q pOYZ2++kvdq91dXgcE+vXPkc8FYSVWtvDrHP8DpcDK+4tRXb7K+dwQCEdlNWchEp5H7b XlqYkYBJeW6i66/ArThALSeflDI7J70kQCHaTT0We277CjCK/00iwaduu7OoZCh0sCud tZVABnn3W5lH7HZuyPu5ffe/prnAY0oLRz+2OF2Ue/j7hU+0xVTgHSKmNkhXr/XFGgue H9aDGl0s16XceeLNpDgfu1yFopm1nf2q+8F0aqbypEUdtJiT8nZFyLeuUonhKND3OJ/F Rp9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729451387; x=1730056187; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hjpxuG3jweILHFyY0/IuBhVex1AlbLpPticWd+3toV8=; b=myqRdl7ETGcNNLnJY8AacXVcwq37nIXLWvtNjQAGO0f4Zq3VrpI0igCKDwP8exNzyH pTDcdhGwnw8GvZ0EKddF2AoFfRcnbYB3f67VRi2+kWitnZykQ/OClC8R4T3Fr0tu7+r7 ot/dDi34iw93r6+D1qe9lEGcTaveyopAUsSx5egdxseadS4zwFn52uu93DfEPq4Cbjov aDHLMUcIHPFKCE8f26UpdWLIIT3uwp1cUrhmrBM9t719BIV2ENSY3DIDxVSSsjTYNvOK bh4q06y21qq7e+VW0x6Mn/YO6Ug2NUE2Ey6pFjHG44xaKdrWA64+uGK5t6BjOYneo6FQ aejg== X-Gm-Message-State: AOJu0Yydg5Gxuh0EMOamOEDeQZPoeukXAIwTE1lFAzr4cqI1B/b3mhxL 4TbttWWl+mUZnrdrxT3mLpyDll62c5WNXpz6MUGFOSKID1+oYxv3/vyxA5u5 X-Google-Smtp-Source: AGHT+IFcYOzYwpoocYJ6gep87S2vBqyJUEPNywhLPTvmexqs9+hxCqr31/5pJjJfCXeGnRaHA+Ry5g== X-Received: by 2002:a05:6512:b92:b0:539:f06c:6f1d with SMTP id 2adb3069b0e04-53a1550bbccmr4069560e87.55.1729451386449; Sun, 20 Oct 2024 12:09:46 -0700 (PDT) Original-Received: from [10.16.0.40] ([185.65.135.136]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a2243ee12sm291257e87.285.2024.10.20.12.09.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Oct 2024 12:09:45 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=ahlawatkaran12@gmail.com; helo=mail-lj1-x22b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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-Mailman-Approved-At: Sun, 20 Oct 2024 16:02:21 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148196 Archived-At: Hello, Today I was using ruby-ts-mode and found out that it can indent some keywords as soon as they're typed out fully (example, when inside a case block). I'd love to implement such a feature in scala-ts-mode, so I looked at the source code, but could not see anything special it might be doing besides simple treesit indent setup. So, how does it exactly achieve this indent-on-type behavior (I can see the matcher being called if I set treesit--indent-verbose to t), and how could I reproduce this in my own major-mode? Thanks, Karan