From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Fri, 04 Jun 2021 11:08:48 +0100 Message-ID: <87h7ieyma7.fsf@gmail.com> References: <831r9iw473.fsf@gnu.org> 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="6771"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , Daniel Colascione , ubolonton@gmail.com, emacs-devel@gnu.org To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 04 12:14: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 1lp6qe-0001ah-PR for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 12:14:40 +0200 Original-Received: from localhost ([::1]:39390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp6qd-0000eJ-O9 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 06:14:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp6l4-0004Xh-Ip for emacs-devel@gnu.org; Fri, 04 Jun 2021 06:08:57 -0400 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:41866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lp6l1-0003sv-UU; Fri, 04 Jun 2021 06:08:54 -0400 Original-Received: by mail-wm1-x330.google.com with SMTP id l11-20020a05600c4f0bb029017a7cd488f5so5325314wmq.0; Fri, 04 Jun 2021 03:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=FcIaaqUtWppOhq52iQGh6m7osBumHfjpKwYZZd3072w=; b=eMn5Bb6J3YvyN6fagtsg3koPoOSnAoNz4/SEqyAU8yRQezYXn1aOHtcOagtyP59CkE mEnN9GOPu2PPcbS1lSkRjJb05X7580QiezT4MDVndGX3VLzooVGMzL5CMuzQjGsuhmId h0A07K8xkGcGQenXAq2vf6qUQXEsziQVJcG25rZLI2I35EqVl9OyPewIC5JqY7mTpYEP 0mPOi5QiuELOZPCH73ZSlUp8gFCVLKmT8FuoF11Bo0PfbvDFIhdv504svGS38oZz7c+l 8hsJTM7SU8pyptdMJBg8ppBN2rAr4oyWNasD8fF/WrGWbsBl6G56ipH2MVD6lL6fcU38 MEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FcIaaqUtWppOhq52iQGh6m7osBumHfjpKwYZZd3072w=; b=SZ/pqrG9u1k2WS/ach7ATYymoTNMePyZzPOIySomQ1Zbswn0oaBdSDP/hDuUHNPvyD yFj5xIWGw9SPgPFmxccaT50nGy1QutGrwmgOFa4VZ8my+7mEdTkMZCOiwWJB24qySgkl +kXlJzXlVK/8C6dR72uPC1xogwHt8D6duPgNf98moZYDd3xphw0Zq8nG2ma8dI3hohFN 9BJkD0iTDgjZP2YFRKLxi0893IRZKAzffly/VZ3Q2Et1ifUtAjsabPmoC0taeHMD6kVJ VkHhWlLjNnsee8AZ1zVEubeaAqpUH7GkPUvhcCm+WECvnimh3MeZcvOZXWVx3pP+6o6Z EgCQ== X-Gm-Message-State: AOAM531V5wIzoMo5l+9EZf8RRJ1J6/CToK2YMsSG+4VP/3lPeMfTaKIN yTMkRBIGxNWCa6YDZoOEOF4= X-Google-Smtp-Source: ABdhPJzInpzwZa63x8Egls8Gw6xaL+dFy/1XlSvNWm8pN1HZbijAc6QHOyC+EKO47tOdsW5wMr0ncA== X-Received: by 2002:a1c:f60f:: with SMTP id w15mr2861685wmc.5.1622801329721; Fri, 04 Jun 2021 03:08:49 -0700 (PDT) Original-Received: from krug ([89.180.155.72]) by smtp.gmail.com with ESMTPSA id q19sm8026080wmc.44.2021.06.04.03.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 03:08:49 -0700 (PDT) In-Reply-To: (Theodor Thornhill's message of "Fri, 04 Jun 2021 09:10:33 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x330.google.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, 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:270367 Archived-At: Theodor Thornhill writes: > Pinging @Ubolonton and Joao, as they probably know way more than > me about this. Here are my quick views on this: - Eglot can add LSP fontification support, that doesn't seem hard. - However, LSP support for fontification seems like it's potentially _less_ efficient than integrating something like tree-sitter as a C module in Emacs. That's because the contents of the buffer and fontification results are continually transmitted back and forth via pipes and JSON format. - Moreover, if one wishes 100% out-of-the-box support for LSP (this or any other feature), one needs to also distribute a capable server program. For C/C++ this is potentially problematic due to licensing issues: the most capable such program for C/C++, is to the best of my limited knowldge, clangd. There are others, though. - The past few weeks I've been trying to get back to the long-stated goal of integrating Eglot into Emacs proper, as discussed some time ago. The idea is to first let it be an independent extension much like it is now, then experiment with integrating its functionality directly in major modes, eventually evolving into an out-of-the-box, seamless "i-dont-even-know-that-LSP-is-being-leveraged-in-the-background" experience for documentation, definition-finding, diagnostics, etc. And also fontification, of course, but my gut feeling says that tree-sitter (or any other integrated parser) approach is more efficient and "tighter" for such a basic thing. Jo=C3=A3o