From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Wed, 16 Jun 2021 00:38:15 +0200 Message-ID: <20210615223815.rlpfa64otupd43np@Ergus> References: <4140fcf4-3119-3f3f-4ac4-24d497774754@gmx.at> <874ke2ulhc.fsf@gmail.com> <706b6214-5a85-3b47-3851-bb7742a066af@gmx.at> <87r1h5u6qp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17035"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Richard Stallman , emacs-devel , Alan Mackenzie , Eli Zaretskii , Daniel Colascione To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 16 00:40:24 2021 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 1ltHjL-0004G5-FV for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Jun 2021 00:40:23 +0200 Original-Received: from localhost ([::1]:52076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltHjK-0002xA-H6 for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Jun 2021 18:40:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltHi3-0001lG-Qr for emacs-devel@gnu.org; Tue, 15 Jun 2021 18:39:03 -0400 Original-Received: from sonic301-3.consmr.mail.bf2.yahoo.com ([74.6.129.42]:37592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltHhX-0007cG-9Z for emacs-devel@gnu.org; Tue, 15 Jun 2021 18:38:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1623796703; bh=YVHbYbfb0iFhAeHzmtfC4Huc6ZaKDhjHIArcTOUWlHU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=ZI1FgO1zcjvKTznj62VGTLHma/1u4FG8x9tkBdC9GOYBiB5Evk4rW4Pue6Ox3PGxSwOC4CMtCh/5olU7ZDVbW/hBGdWdhyX/vh4fcSvroa9ZB2QPR0t6QDQ5STTvz6pTm8vEXd9YrF9AnunSFe1Af/2bFmYkeJcMLKsewcB6LV2JrzA6x6qe8PPcGSwkr+u5wjp0D0QSBVRtMi/yis3TvG211JhYOmpD4opIHfieNHNdz/v2Y/r7HQgsYvcB7CA0D2lVvSRUc6o6jHjH3KAR2cRTfVoGHBh+ym4dYKjN5BANgdg1Zp86rVywu/+mS/0JyuWQyhDbU4ljFRE50dUDwQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1623796703; bh=LPTIbQzXVSJcxTx4j12Tz3CG0YF6JN+4Nqnxv4Nim0h=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=kUQ94thSX1+Xkn9gA4JhWA+nT5lvRurRY95EYrxjhZksT+ZP2+6D1gviTCezC7NYCxOnM9On/klpOH4APxg+iBTs/tutlCrA86heY7hRMr8wwZ8+zOlJngqv2iDtNDxU4i6Ve0a/Bps6lFvfVi3lrW0rHm936JpnZnguyA4Os0PTLKj6hnkClRKIbfiNUqa965MghySMx4L+kcFRQskl8JWvCgOoTOSED+Q1zXl+axieMyhtEZwFQQdoFddbFRyCrl+K10LKRk5PCAz+w5kXTJq+iirzkNSJHEyUoCvb7VWlyIEJ2dGKp/wnITzrK5fGOGNZ043JO7UQZg4z6Vfeyw== X-YMail-OSG: ASIitIAVM1kk532XbnoJCHmtmCRqXD4LI6F3o7XWEqnBGECEJLdOBbjs1JFXu38 hkAg.KUR1XJH9E.VutrofaTkGHaSghFEJDDeaevO3YNiGkcafE3O_8vcRZtutr1phBgoybqEDUFM k77CodwS8zVKqP4fI34r41b29h3W_moWCHTpfpK2WowTSryL121q86EwbeyqC61cDI68mUKRb0cH MV4ptfHT8IbgzeRNqytkuA_8uxzb19HQtIAecI.lzySG3UrATSYoAUdSq8yuCgV4P4pX9vbOnkW_ Bcss7licjgmP7quEr6WCdO5__seOThGkdj0osxHyrVLOSOa9qdxFfpWRwFfwTQf3v6Y5tljyvGL_ KYkNrd27inGMDbBpVSG5rUtCDJ.xx..OtqzdhQbIVqGoZ5Y0MAq3zH_Bg1zI1Keo5.9NQxVYo_o4 7oOKSuR9yfh_0UrIVcGf9pY04i_L_us8wG6H_tYo.WNHin68kIlNNCVsByuRZj2S5TU7W0IfSXz3 03WETWqRfpv7a4UsyVlpwH73hzNuG0DDaK.TsHqCQUakzaRggAHM2n0BRGrZaqwNwR.wz7rRuI64 K_EjJUwzVubSWtevbgnC6KGcjVuKjj6T3gNiV8R1ciP8dk.neLMPwDa4snCWz4ZOP7hYepiiqjee xpgXncMy_fzs5SJtAbaWvaEQJsbrVNVhlBCFsDOGmwjcIetlXyH8aSjFjoAd8IUn1a4JMRfEFTT1 ALDemFbZdvWt7NCc6.sZVA5gcTDr2KK68rcl2dEPlT1Jjh1cnfF0wW5fQvSWkydnV3Nq8KN_DyPi H_5lhX8Oe2QWd5wGYG0iqNYqQFy6m2eJ7gT6Nx.yTp X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Tue, 15 Jun 2021 22:38:23 +0000 Original-Received: by kubenode514.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ab53cd7fb419944654422ca3320e5268; Tue, 15 Jun 2021 22:38:21 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.18469 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.129.42; envelope-from=spacibba@aol.com; helo=sonic301-3.consmr.mail.bf2.yahoo.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:270829 Archived-At: Hi Stefan: Finally anyone wrote to the emacs-tree-sitter module package to request them to join to elpa and do the paperwork? On Mon, Jun 14, 2021 at 10:39:49AM -0400, Stefan Monnier wrote: >> It is undocumented practice to steadily undermine the role of >> `open-paren-in-column-0-is-defun-start' in all modes with >> `beginning-of-defun' the only place left where it currently has any >> impact. > >You seem to attribute malice to the perpetrators (e.g. yours truly ;-). > >Here's my reasoning: > >`open-paren-in-column-0-is-defun-start` was used at a few different >places which feel into two categories: > >1- `beginning-of-defun`, where the effect is clear, deterministic, and reliable. >2- The rest (mostly `back_comment` in src/syntax.c, but also in some > parts of font-lock which used `beginning-of-defun`) where the effect > was not clear and reliable, it was a form of optimization which took > effect in some cases but not all. > >Part (2) has disappeared now, replaced by the `syntax-ppss` cache which >gives more reliable optimization (both in the sense that it speeds >things up more reliably and that it gives a more reliable behavior). > >You liked some of the side-effects of (2), apparently. I can agree with >that, but the old code did not really provide the feature you describe >(e.g. an unclosed comment/string in one defun would not magically stop >from "bleeding" into the next defun, although in some cases it indeed >did stop bleeding at some buffer position which depended on how the >chunks of text happened to be rehighlighted). > >So, I suggest you implement the behavior you describe (you might be able >to do that fairly easily by taking some of the code used for >multi-major-mode support (since those also need to confine >syntax-propertization and font-locking in separate blocks)). > > > Stefan > >