From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Sun, 06 Jun 2021 16:38:37 -0400 Message-ID: References: <86a85d26-75c0-e4a3-e8d3-244c5346dd3a@dancol.org> <83r1hehnz9.fsf@gnu.org> <192ccb74-90e5-aebc-1210-c4f685cc3b52@dancol.org> <4bb05195-d29b-c6a5-7cf0-e450dfbc1cac@dancol.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , acm@muc.de, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 06 22:39:26 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 1lpzYM-0003DU-2X for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 22:39:26 +0200 Original-Received: from localhost ([::1]:43992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpzYK-00070M-Gu for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 16:39:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpzXn-00067p-LK for emacs-devel@gnu.org; Sun, 06 Jun 2021 16:38:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpzXk-0000t9-Dd; Sun, 06 Jun 2021 16:38:50 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 41FF8440935; Sun, 6 Jun 2021 16:38:45 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 05247440945; Sun, 6 Jun 2021 16:38:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1623011919; bh=YqGyV288oljiqs+uM7YlNo6bVZqdZjmEe8xs5D03LqY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SXdsv/DtAVYaMh+MEEZZArl0UBHKDRKHUldjSfRLssTE7s1lu+BemahjHdGh28lCN MIT7BMEZUh0fNzG8KyiLf62ZV1pp0Xis6uRM+ZKRyUbWX5cOn7/XrLQrF3b0nKcuRX XVpgMke2HJmSWM6USb9bIkFSRHTuhFeD5Qq7ByuCMyobPL64stSX3qfJEmFKT3XNZS 0oSQt14gH3K8R2muQZk/lNNH5rpMI7VXL7FtQRdBx9zL7QHT7Xm+Qil93mbBuuS9UH zyXPQ2K7oe0L+WW8xbXEvu0f5vEl6QEg25vHzIotMXMHwofnTm0x69KEjPLFWVo/BG 21iKSob82Tbog== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B77EA120E14; Sun, 6 Jun 2021 16:38:38 -0400 (EDT) In-Reply-To: <4bb05195-d29b-c6a5-7cf0-e450dfbc1cac@dancol.org> (Daniel Colascione's message of "Sun, 6 Jun 2021 13:27:08 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:270503 Archived-At: > Manually placing syntax-multiline is annoying and error-prone. > Can't we instead keep track of what buffer positions were actually inspected? Depends how the inspection is done, but of course that could be done. Note that in the current uses of `syntax-propertize`, it's rather unusual to need `syntax-multiline` (and it's fairly easy to add it in most cases). So while I agree with "annoying and error-prone" the motivation to come up with some automatic way to do it has been rather low. In any case, I think this is a very secondary issue compared to the issue of deciding what it is you want to do in that "fontification" scan (and then how you want to do it, etc...). If you want to do something fancier than `parse-partial-sexp`, then that probably means inventing a new parsing engine, along with corresponding grammars. If so, using tree-sitter as that parsing engine is probably one of the most attractive options since it lets us reuse existing grammars. Stefan