all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, acm@muc.de, emacs-devel@gnu.org
Subject: Re: CC Mode troubles and Emacs 29
Date: Wed, 11 Jan 2023 09:27:28 +0000	[thread overview]
Message-ID: <502d6ee86af078e950e9@heytings.org> (raw)
In-Reply-To: <87zgapg8di.fsf@yahoo.com>


>
> 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.




  parent reply	other threads:[~2023-01-11  9:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <874jt0hw7p.fsf.ref@yahoo.com>
2023-01-09  9:51 ` CC Mode troubles and Emacs 29 Po Lu
2023-01-09 12:31   ` Eli Zaretskii
2023-01-09 13:49     ` Po Lu
2023-01-09 15:48       ` Alan Mackenzie
2023-01-09 16:56         ` Eli Zaretskii
2023-01-10  1:05           ` Po Lu
2023-01-10 12:57             ` Eli Zaretskii
2023-01-10 14:13               ` Gregory Heytings
2023-01-11  1:36                 ` Po Lu
2023-01-11  1:46                   ` Po Lu
2023-01-11  9:27                   ` Gregory Heytings [this message]
2023-01-11 10:12                     ` Po Lu
2023-01-11 13:27                       ` Eli Zaretskii
2023-01-11 14:17                         ` Po Lu
2023-01-11 14:27                           ` Gregory Heytings
2023-01-10 17:37               ` Alan Mackenzie
2023-01-10 17:50                 ` Eli Zaretskii
2023-01-09 16:36       ` Eli Zaretskii
2023-01-10  9:26       ` Gregory Heytings
2023-01-10  9:49         ` Po Lu
2023-01-10 10:06           ` Gregory Heytings
2023-01-10 17:05             ` Alan Mackenzie
2023-01-09 15:52   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502d6ee86af078e950e9@heytings.org \
    --to=gregory@heytings.org \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.