From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Limits of multiline font-lock Date: Sat, 7 Oct 2023 02:30:21 -0500 Message-ID: <77114a4e-a487-40ce-9887-ba46d7b096bd@alphapapa.net> References: <87impuu7qy.fsf@web.de> <874l198g0q.fsf@alphapapa.net> <87ftktghwm.fsf@web.de> 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="17036"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 07 09:31:43 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 1qp1mp-0004DB-Ec for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Oct 2023 09:31:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp1lz-0004Le-6V; Sat, 07 Oct 2023 03:30:51 -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 1qp1lm-0004JX-6w for emacs-devel@gnu.org; Sat, 07 Oct 2023 03:30:48 -0400 Original-Received: from slategray.cherry.relay.mailchannels.net ([23.83.223.169]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp1lj-0005Jk-IR for emacs-devel@gnu.org; Sat, 07 Oct 2023 03:30:37 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5EFC336073A; Sat, 7 Oct 2023 07:30:33 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a314.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EF764360753; Sat, 7 Oct 2023 07:30:32 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1696663833; a=rsa-sha256; cv=none; b=DeD2US1sBzTGq2aw7iM5mmNu8uycMNhNbCOhP5QSaOMFrc2qB2OJ/1U/lg8rKv9ps1KWRM jL7Pn79E1We00my5nlxqZlI1cZtrtafcyRjUtdLUC2BqqHCcmLp4+/C2HSyUYhT/WtY03F PwqVXRRahfzjYAaHybfHv4fszZN4WSOmt743pDwB4FEo8VQUu7YoOT69apb1VmGAeJ4ELC WwjsAEgM9HRn6ht3yDiccd6QdRWkF+KlnTdBNtX+RXgJKAEps87AvG+t2O9YgmwFKflvNE 7Gpdmc/ri3QhDY2MyaIwVqdbL8FXwdZ9gxW4zeCjK4VsdqSkZKERVLscseYl8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1696663833; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DzsdHD5KaKUzkFIvNNkzZ9NmMAz3d7ATl9uTzhad194=; b=g5yt3cZnFZhNCViX1lfEqSoTenVR0CbZWFgfZSBLi61lFewfRW9LTGNAR4p1XXreJyhO9v D0vXZXld1kArJpWSxkggHf87WNkV42tkin2IkYt3gZVUwsRaWbWf4keitPkh360mzR685W 2KuSULDjEx0/cjYUAydIHlvOI8k1fdu62P03/d+OwelKi/lt2WpKanGfS/rENwJhWCQ88e ZoKko274y0x3TKlAWKj1pfMo0T6DntHgjNFDH89dJsg4uALc2fHxfcB3GaZBhgQFNbcBTx al0FLrEgxTj3ecDQQ8jWXP3bhZFlC3BStsSkPYVS5LoJ/igv20ItuyLgnENWaA== ARC-Authentication-Results: i=1; rspamd-7c449d4847-sqfxn; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Zesty-Irritate: 3b156796472fd8aa_1696663833202_3081306268 X-MC-Loop-Signature: 1696663833202:1152789620 X-MC-Ingress-Time: 1696663833201 Original-Received: from pdx1-sub0-mail-a314.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.131.218 (trex/6.9.1); Sat, 07 Oct 2023 07:30:33 +0000 Original-Received: from [10.66.1.110] (unknown [91.193.232.98]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a314.dreamhost.com (Postfix) with ESMTPSA id 4S2cQc3Rv6z3Q; Sat, 7 Oct 2023 00:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1696663832; bh=DzsdHD5KaKUzkFIvNNkzZ9NmMAz3d7ATl9uTzhad194=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=EKlAa9GpYPMFQRyJOBWev8gfwB+NokvrhEX3gZhuWmxEBNObc+SFYCdQ0nChI+TRj FuEv0dIzuXdCWvPyMBBRHXCb+Iv/fEW2Lg3rTNWxx0gQvCsuow0Nn5tr+87tGohOrb wQmfU06yyxo3LnqeMzGd2tYWYUR7McroEZD22Sfp0U3SC/uTKAmUu3o2Ah1SMYnVFw 0exjH1tlu6gbZTCmGPaYvnE2S9HVM5a+pJ/MhdXiVbQxlsCxDnM+e6Q05bJLCcHDbn 7nhR0OomLSgp07fywXO0eTwwBE+Ca94eDxnJ99UzW1OeC4b8vVF86DLqlGfr79mg84 XX2yF1EP5cFIA== Content-Language: en-US In-Reply-To: <87ftktghwm.fsf@web.de> Received-SPF: neutral client-ip=23.83.223.169; envelope-from=adam@alphapapa.net; helo=slategray.cherry.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 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:311339 Archived-At: Hi Michael, Please forgive the "blast from the past"; going through some old mail from the list I saw this message of yours that I missed. On 9/18/19 21:05, Michael Heerdegen wrote: > Adam Porter writes: > >> You might be interested in this package I published recently. It >> implements depth-based syntax highlighting for Lisp and some other >> languages. >> >> https://github.com/alphapapa/prism.el > > Nice. Could it go to Gnu Elpa? Yes, I think I will submit it to GNU ELPA one of these days. It's more mature now than it was then. >> However, I have discovered a performance issue in the case of sexps that >> span large portions of the buffer (e.g. in my init files, I have some >> large use-package forms that contain many functions and span hundreds of >> lines). If I could solve that, it would be great, but it works fine for >> most code. > > If you use `font-lock-extend-region-functions', all of font-lock uses > the extended region, right? I guess basing your functionality on > jit-lock-register could be better. If finding the beginning-of-defun > and identifying the levels is what causes the main cost, it wouldn't > help much, however. IIRC that performance issue turned out to be a bug elsewhere in the code; once solved, the issue with large forms spanning many lines was no longer a problem. > My use case is a bit simpler since I only have to deal with Lisp. What > modes does prism support btw? What are reasons why some languages are > not supported? Prism has two modes, one for whitespace-significant languages and one for all others. It seems to generally work well, especially since some recent bug fixes. The liability, to the extent that there is one, is that syntax tables can affect how delimiters and comments are detected, and some major modes may not use them in a way that makes such detection possible, e.g. using Emacs regexps' syntax types and syntax-ppss parsing. Now that treesitter is in Emacs, I'm guessing that it might be helpful as a backend for some languages, so I may look into that in the future.