A good rule of thumb for this could be: if you can define an “operator” overload for something, then it is an operator and should be fontified as such.
Some examples:
1. `&&` or `and`, can define `operator &&()` or `operator and()` -> operator face.
2. `and_eq` or `&=`, can operator &=()` or `operator and_eq()` -> operator face.
3. `for`, cannot define `operator for()` -> keyword face.
4. `while`, cannot define `operator while()` -> keyword face.
Just my pair of pennies...
Best Regards,
Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)
On Jan 8, 2025, at 7:49 AM, Eli Zaretskii <eliz@gnu.org> wrote:
From: Yuan Fu <casouri@gmail.com>
Date: Tue, 7 Jan 2025 19:09:40 -0800
Cc: Jacob Faibussowitsch <jacob.fai@gmail.com>,
75226@debbugs.gnu.org
I found that both c++-mode and c++-ts-mode fontifies C++ alternative operators like and_eq, xor, etc as keywords. Maybe we should fontify them in operator face (added in Emacs 29) instead?
What do other editors do?
Alan, WDYT about this?