From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Corwin Brust Newsgroups: gmane.emacs.devel Subject: Re: Enhancing cperl-mode (was: Re: Does Emacs need two Perl modes?) Date: Mon, 19 Jun 2023 09:58:46 -0500 Message-ID: References: <16da6ae7-66d8-fc43-cb84-6d104d3a2ef8@mavit.org.uk> <4d18a051-07d5-fba7-1c36-ae2eb72bf71c@vodafonemail.de> <878rcfbjwg.fsf_-_@oook.m.uunet.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7804"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?UTF-8?B?SGFyYWxkIErDtnJn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 19 17:00:06 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 1qBGMQ-0001n5-DF for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Jun 2023 17:00:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBGLP-0007wd-Sf; Mon, 19 Jun 2023 10:59:03 -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 1qBGLN-0007uO-Qr for emacs-devel@gnu.org; Mon, 19 Jun 2023 10:59:01 -0400 Original-Received: from mail-ot1-f49.google.com ([209.85.210.49]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBGLK-00043U-Pv for emacs-devel@gnu.org; Mon, 19 Jun 2023 10:59:01 -0400 Original-Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6b2a875b1bfso3054143a34.0 for ; Mon, 19 Jun 2023 07:58:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687186737; x=1689778737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6MjyX0nCD+0JjClKnYsmgp28Fi0PlUB59oesRBvfh9Q=; b=OTvY1ebuDZRx0gBI5zoyEJEz6Qxn0GZCNzUsl8IndRnLb+ZOVhlo5urYOaV+LOXMTB evlEzI2TPR1FZ1AGI+yNrgT5Eb8lr2AHQ1otS4+lpOSwXgW2NSVGWmE99T49+MIedlMg w+WdVy/41Uk7P5RR+jD6TOZ7qpg6RtBFTIgsiqUkHTqVi7zAgMOXQN51zrL80iSbcqIW P12A0Uc5AEDgm+XSFUCbgvHIFvoK56lZdBzFfUWFFkDNjerVSobVQBtuHqJWGTDMskYu 6ejrvUlY5WiM48YecHmj4I0+ZBggJLilbq380wp9HTulafoR8umF04phFwckN7PsHkiM tTcA== X-Gm-Message-State: AC+VfDwKqqh9hOFTJBbyG6LzdD+aXnzknkNGTcSBcx3kuDBEkUa6tfQW hyL5B4FBvEhDseXgCXgj0+VhI2OXP8BDQ4MIGBE8e/W/IgY= X-Google-Smtp-Source: ACHHUZ6Ab9khk3j4YeYgBz3F5bwr5PAM7UZ8v8fj3NrNxvnoElW3u5cr6JpZ7Plo2FM0902bH1DY/3FqAMC7TdONEtY= X-Received: by 2002:a9d:6343:0:b0:6b1:d368:557c with SMTP id y3-20020a9d6343000000b006b1d368557cmr6813545otk.30.1687186737597; Mon, 19 Jun 2023 07:58:57 -0700 (PDT) In-Reply-To: <878rcfbjwg.fsf_-_@oook.m.uunet.de> Received-SPF: pass client-ip=209.85.210.49; envelope-from=mplscorwin@gmail.com; helo=mail-ot1-f49.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:307047 Archived-At: Wonderful seeing this.. we are clearly thinking along very similar lines! --more-- On Mon, Jun 19, 2023 at 9:34=E2=80=AFAM Harald J=C3=B6rg wr= ote: > > Corwin Brust writes: > > > I was thinking about this just yesterday while whipping up this rather > > naive patch for cperl (adding class/method/ADJUST and async/await): > > https://bpa.st/VPAW4 > > Nice! > > Are you going to commit this? I'm working on adapting cperl-mode to > Perl 5.38 as well, and unsurprisingly my patch looks very similar (but > isn't committed yet either). I'd be very happy to defer to your efforts; if you would like to take the lead on this I'm happy to help all I can, like please absorb what you will from my version. As you can see, I've not even bothered to fix trivial things like line length in my rush to see the new keywords "light up" :) If you aren't excited by this prospect then sure, I'll do my best to make my patch tidy and so forth. (Starting checking for a rebase vs master, I guess; it's effectively made against the release branch). > > > [...] > > My sense has been that perl-mode is wired up by default specifically > > because it's the less frills choice, and thus more likely to perform > > well on older and underpowered systems. > > The performance was indeed a point of criticism when I started using > cperl-mode. But that was in another century - I doubt that it is a > serious issue today. I agree with you, but then there's the whole "survivorship bias" as was just mentioned. I *do* have a fairly speedy workstation.. [..] > I guess that in some areas both Perl modes will converge (for example, > they are using the same test suite). Once the tree-sitter grammar for > Perl is reasonably complete (it isn't today), both modes might want to > use that. Also, I've been dreaming of adding support for Perl's syntax > extensions as minor modes which can be activated on top of perl-mode and > cperl-mode. I have the same theory/vision. I have long term vision/hopes, and too, I've also been of adding support for syntax.pm keywords via minor-modes, probably via some new hooks? I have the idea of a "amada" of cperl-syntax-FOO minor modes mirroring the CPAN modules using syntax.pm. I hooks call while setting up font-locking could be a feasible way, but I'm still trying to parse the parsing (sorry if I crashed ur tokenizer there). More specifically, I'm not clear on the interaction/use subrs vs calling hooks to add/tweak font-locking and what all, exactly, is happening at compile time. (Is this effectively impossible? Will we wreck performance?) I do know I haven't found an incantation to make updating the font-lock setup "live"; I have to re-launch Emacs as I go to test these changes. Excited to hear the extent you'd like to work on this!