From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: CC Mode troubles and Emacs 29 Date: Wed, 11 Jan 2023 09:27:28 +0000 Message-ID: <502d6ee86af078e950e9@heytings.org> References: <874jt0hw7p.fsf.ref@yahoo.com> <874jt0hw7p.fsf@yahoo.com> <838ribq48f.fsf@gnu.org> <87zgarhl7j.fsf@yahoo.com> <83zgarodeh.fsf@gnu.org> <87v8lfgpwf.fsf@yahoo.com> <83k01uo8db.fsf@gnu.org> <56368889cb296ad26b5e@heytings.org> <87zgapg8di.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37352"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , acm@muc.de, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 11 10:28:46 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 1pFXPa-0009D7-Jy for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Jan 2023 10:28:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFXOU-0002HR-2L; Wed, 11 Jan 2023 04:27:38 -0500 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 1pFXOS-0002HH-9N for emacs-devel@gnu.org; Wed, 11 Jan 2023 04:27:36 -0500 Original-Received: from heytings.org ([95.142.160.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFXOP-0004yf-PF; Wed, 11 Jan 2023 04:27:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1673429249; bh=DTjycNpSAi1YQ07ZG6dQYXGrG9jMsZN6RId8WH6bFgs=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=6RvnuYnRZatCMuoUiChmVDgJH/fewcDYr7HTSzkwrLZ7wV6fpjmt3Oh3MMWGJxvdP yo7MnqdOzzPJi/WW+ftB4x7JkPBxMzi87MlBAby93YfXspwnP5k2gFsi3Lx/nwuL6a yJvGOPdPFLN2KEd6sFtpg+0SJ6m4PIx/kF5ElTCUYhGsmxOGae8szZZb/SmTytTfq1 swwW/D00w7TS2nTl+/QtCWYx32VwwrlPYQn1C4Jx73hWQtWqvCBI3brehO8WwJtB0b 5tAnK5Kjj4x/EWu/0ZNUgRKD7bDkWBRyBaVK/SQqIj+UXW62JSE/0FK0q/G/fSHDs2 5p1DoqVAQub7g== In-Reply-To: <87zgapg8di.fsf@yahoo.com> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org 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, SPF_HELO_PASS=-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.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:302329 Archived-At: > > Previously, CC Mode fontification was missing some types. Judge for > yourself what is better: missing types, or randomly adding types? > That's the problem. Clearly you prefer the former (all bug reports in the long list that Alan shared were filed by you), and others prefer the latter. There is a tension between fontifying too few identifiers with a type face and fontifying too many identifiers with a type face. And that problem cannot have an accurate solution without a parser. (In fact, even a parser is not enough for that job if you want 100% accuracy.) >> Note that this can easily be fixed with C-u C-x x f C-x x f. > > Or re-enabling C Mode. Both of which are annoying things that weren't > necessary in Emacs 28. > Alan did not add a defcustom around that new feature (and rightly so, AFAIU), but you can also turn it off with a single short line in your init file: (advice-add #'c-fontify-new-found-type :override #'ignore) > > It worked in Emacs 28, 27, and since before that, because it really is > not vital for CC Mode to proactively look for types. > Evidently that's your opinion and preference, and it's not what others prefer: they are more annoyed by type identifiers that remain unfontified than by occasional fontification of non-type identifiers as types. > > AFAIU tree-sitter has the same problem: it does not understand typedefs > previously encountered in a buffer > Yes, as I said above if you want 100% accuracy, you need more than a parser, you need a full compiler. > > In the meantime, the so-called ``fontification based on an actual > parser'' does not even understand traditional C code. Last I checked, > it also had problems indenting the Motif WM hints structure that people > copy everywhere. > Sorry, I don't understand what you mean by this, or how it is related to the problem at hand.