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: Fri, 04 Jun 2021 20:29:02 -0400 Message-ID: References: <831r9iw473.fsf@gnu.org> <2d6d1cb0-2e8f-ceea-cb83-3bb840b65115@dancol.org> <83zgw6udxt.fsf@gnu.org> <87czt1zzns.fsf@gmail.com> <371647e9-9508-ae98-26f0-3649d7ba114e@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="9421"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , Eli Zaretskii , emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 05 02:36:40 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 1lpKIp-0002FZ-Ja for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Jun 2021 02:36:39 +0200 Original-Received: from localhost ([::1]:43372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpKIo-00041g-18 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 20:36:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpKBf-0000G7-US for emacs-devel@gnu.org; Fri, 04 Jun 2021 20:29:15 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpKBX-0005Ul-E9; Fri, 04 Jun 2021 20:29:14 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 27849100347; Fri, 4 Jun 2021 20:29:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A851F1002E9; Fri, 4 Jun 2021 20:29:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622852943; bh=9iQtdyhdFmumXO+x02/ELL3WvyVLJTol0cOOVL5nUjw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=QE/stQfCA7iQox/+ct5tf5DUWMrO0hjEAebZ7z3rTE3zAAFtJe7Vr+ZWDs7LQPSWj jskWp7fjbZEC71HKVFIcQLvuljhJZMCDe5vTaH3kUV9fifmeUxMhYjCf/aA8S4MG8R 4PFVnxVG6qIkht9rsbQoZEr8M+o1jjrWULybCxGRxsKqmpMMQ8ms5IKY+qFdUWx3wU My/u5LM9KnjDr6zAbta4+aRT/VW7QZcLQmSzbO7NC9wuGJZ4YS+Qmrry4D2AwFtTfV KOurGgsh+Xu3SKVT12oD5/xuMRepLrrx8s/5U7zILmMUK5RRyyzARqFIaVnmXnAv0i eGOuXsAkOBegw== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 63091120376; Fri, 4 Jun 2021 20:29:03 -0400 (EDT) In-Reply-To: <371647e9-9508-ae98-26f0-3649d7ba114e@dancol.org> (Daniel Colascione's message of "Fri, 4 Jun 2021 11:36:05 -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:270412 Archived-At: > The problem is more fundamental than that. Internally, each buffer has > a gap. External tools that operate on char arrays don't expect a gap. (They Yes, there's that as well. > Besides, memory copies are really, really, ridiculously fast. My system can > cat from /dev/zero to /dev/null at ~18GB/sec. Copying a buffer's contents > so we can give it to tree-sitter should be no issue at all. Yes, beside the potential difficulty of giving direct access to the buffer's content, there's the fact that the time needed to make a copy will be dwarfed by the time needed by tree-sitter to parse it, turn it into a tree, and for us to process the returned parse tree (unless we copy a lot more than the part that tree-sitter parses, admittedly, but presumably we shouldn't need to copy text at which tree-sitter won't look). Stefan