From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman Newsgroups: gmane.emacs.help Subject: Re: perl-ts-mode available? Date: Thu, 05 Oct 2023 22:40:41 -0400 Message-ID: <87zg0wxybg.fsf@dfreeman.email> References: <055ea3e2663d33081622632beaca87166a93f0e4.camel@adminart.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31209"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: hw Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 06 04:47:42 2023 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 1qoasP-0007w0-TC for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 06 Oct 2023 04:47:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoara-0006PQ-Qe; Thu, 05 Oct 2023 22:46:50 -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 1qoarY-0006PI-VX for help-gnu-emacs@gnu.org; Thu, 05 Oct 2023 22:46:48 -0400 Original-Received: from out-200.mta0.migadu.com ([2001:41d0:1004:224b::c8]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoarQ-00077N-Fz for help-gnu-emacs@gnu.org; Thu, 05 Oct 2023 22:46:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1696560394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sPRYebvqSiDg8Kq6b+HR9M6ouOa3CUrCRRNc71IZzrY=; b=DpxM7Q8q1tfVJl8mvYmxWzAUs5DOnGrRNk8f60iLHFD7MQLJiUOjdeY0oRsR0jfCldP+dj y4uf9DaHpsvSORV40JIPpWBsbjFnG6VgvHc4lPeqle0JlZipkYV8HO3k0O5hURc29icDMF 6U1Zr4nZpOaCEnEilr1AjCcK3aWwvZc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <055ea3e2663d33081622632beaca87166a93f0e4.camel@adminart.net> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::c8; envelope-from=danny@dfreeman.email; helo=out-200.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:145213 Archived-At: hw writes: > Hi, > > is a treesitter mode for perl available (somewhere)? Or is one about > to be created? I don't think so. > I'd venture to write one, but looking at [1] tells me that I don't > have a clue how to even begin such an endeavor. > > > [1]: /usr/local/share/emacs/30.0.50/lisp/progmodes/c-ts-mode.el.gz If you are interested in learning how, you could take a look at this article, which walks you through creating a simple html-ts-mode: https://www.masteringemacs.org/article/lets-write-a-treesitter-major-mode Many of the things written there will carry over to writing a perl-ts-mode. The only other thing you need to get started with is a grammar: https://github.com/tree-sitter-perl/tree-sitter-perl There is also some info in the Emacs manual under the title "(elisp)Parsing Program Source" -- Danny Freeman