From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jacob Faibussowitsch Newsgroups: gmane.emacs.bugs Subject: bug#75226: [31.0.50] C++ ts-mode missing "alignof" as keyword Date: Wed, 8 Jan 2025 08:58:13 -0500 Message-ID: <12ACBADE-630D-43F4-AB45-73FFC3F6E34D@gmail.com> References: <7F2C7BC4-F609-4C59-BF1D-BAE12F10CFFE@gmail.com> <86ed1llntt.fsf@gnu.org> <95EAF964-0C9F-4719-8AF0-4F9912C9FC8B@gmail.com> <86seq0gm9m.fsf@gnu.org> <1736D702-1BC1-4DF6-967C-052D9E446677@gmail.com> <43399C53-8860-43D1-A319-B3DE2885592E@gmail.com> <867c754gi9.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_21357CA1-03A1-4F7C-9165-0D4E771BF774" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1810"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Mackenzie , Yuan Fu , 75226@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 08 14:59:39 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tVWaw-0000Kb-28 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jan 2025 14:59:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVWaR-0007Sl-Sg; Wed, 08 Jan 2025 08:59:07 -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 1tVWaM-0007SS-BO for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 08:59:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVWaM-0006oc-2e for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 08:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:Date:Mime-Version:From:To:Subject; bh=IBTgrfpIFDIUuv9jH5tFpi/zZVEqLPy2PJUoh3R/TVQ=; b=myIywL3EsW/4GkaNaBjfZO1ZdDUnCWJc9N2wt4bvFrIxOm6a3d5PTQTFBGOIhjWHDifdftNdwxDVNP48i/OErA/9uQ168RXVaSHNicUsvNgE1Kaq+5Pe/ZaC5BzSs5A4NLFrlqIcDT57B/v0yKEQJtIoNgsfYJz2IT7Q4O+1toTtzdB7fPg1MxC+GeFfIc2pnKcYD9cvQj8Unr82htElxFHv259LHcZCfL+4UDOmAWt+FKVjxRTvw5JJin7zKrkCGLdwC8hCMfn8uJ9wIBEoO/VeJxcAZpxgb9zLpKqxGsyNhF/rnIYe1PyHBh6AIZao3I6suySkWYIkDAzvXuf2Xg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVWaL-0004Aq-P0 for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 08:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jacob Faibussowitsch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jan 2025 13:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75226 X-GNU-PR-Package: emacs Original-Received: via spool by 75226-submit@debbugs.gnu.org id=B75226.173634471416011 (code B ref 75226); Wed, 08 Jan 2025 13:59:01 +0000 Original-Received: (at 75226) by debbugs.gnu.org; 8 Jan 2025 13:58:34 +0000 Original-Received: from localhost ([127.0.0.1]:46505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVWZt-0004AB-MC for submit@debbugs.gnu.org; Wed, 08 Jan 2025 08:58:34 -0500 Original-Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:50537) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tVWZq-00049w-FN for 75226@debbugs.gnu.org; Wed, 08 Jan 2025 08:58:32 -0500 Original-Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7b6f1b54dc3so2428416985a.1 for <75226@debbugs.gnu.org>; Wed, 08 Jan 2025 05:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736344705; x=1736949505; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=IBTgrfpIFDIUuv9jH5tFpi/zZVEqLPy2PJUoh3R/TVQ=; b=UYfpyEhCveN+UsDQoM/Kq7JLUmTjAWzsdhjckAHcTnvvzlI7BfuaMsZgNKsbbF0D3B k7ioLd+fW4+3LtTmjG2YfBCzEDd1iTmRhXa04SNTWDLlIraJ67zoFH0nxjbtjkDIQ+qr 5+++mBfjyoTqo99xWhbxnhisG+xS9ijbtXqsiwws8tVkD0EBpRxvMs0UTQci+oVGY0bO zv+Gak2IWB6ZbLgkFWA4bdNZptFAixtv2ynZGHaCPD7GbomY5En5DG2FmbCUu93Pytde mTChHc/rbM8Las/Nuv9boieOAbH9T+llcccTccrJZLisab7ZS9lsqlJmoSLMGE6QTGW8 9Wvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736344705; x=1736949505; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IBTgrfpIFDIUuv9jH5tFpi/zZVEqLPy2PJUoh3R/TVQ=; b=uJ8+oxT3RVsBdNADNl75yU0vXrAg7VzIg93zx5YzMuGgDewX94KOGM2rzoC42Kt36P JPXjXYx98IaiFHXdhJjT182Xbk03cqyODScPaz8yMYtlXYLY0WSFNbiW00Qd2K67U6FM EEH+HeF57edC0nQxU9RELmWI1MVCOi+JiZurZCtxgxe6mvQdMt52v/U0ZQzhzR6MvovA XzRukkpQWROFDbK9so8aQN/5LHbyoM60oqivxwd3PDdP+8v5ojQrUwI9qKWqvlwT6SEq fs0ur96VrbIVYoaXMixV0sZG8j0EXbHEoz9tanwwvzPn9FOTvyTaUifsfQaWs8L9Sc1v +aQg== X-Forwarded-Encrypted: i=1; AJvYcCXnIqPVejMRep2gZOlPafQW2042T6mX/wQ3/OL7jIhUNzv9W1EkCPzdGSA/EutvcuwhLFSbpw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwIK49epltn6obPYBGliZSItTpOWz5xOWH/vZ7TlIxxsQOaEylZ +XH4KJleVH6OXtJVZsCAjloq6N9i6qL3oahNucwjKdCtjYHOxo5a X-Gm-Gg: ASbGncs0RpmtLizfegZsM02Y9zuw2zwsDqa/lxS0Qa3buBRSgJh1W5wZK+uixVWsh5u SGcfKYExSq4BQe2nrmnaEOZbPiFyE1sgYVqPPib7kHNKrtthUrKNrvKJpKo46mkRQ4WLhJXgGFT 8oBYbXXm4o5R6n9eDeYOL7DJl+wiYP9dTpAYJLqGEATm9Bfe2AwsJUG0lMD2nDK6pf0Q20Gl+/u nScAQrQU4U4aQCkzwnkI73P2vGyxKz9x9g8Q3tKpwoL760OT40YdKULntRU4fT5bqoG1A== X-Google-Smtp-Source: AGHT+IHY/5KPQus0ntlog5GcjcqCx6RCyTCS+r0CxmE9xDbQrA+AusuFZi1i+dF6VpMKgBeq8xDE6w== X-Received: by 2002:a05:620a:2787:b0:7b6:d6ff:86ba with SMTP id af79cd13be357-7bcd97d1e64mr409166785a.52.1736344704726; Wed, 08 Jan 2025 05:58:24 -0800 (PST) Original-Received: from smtpclient.apple ([70.23.89.94]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac2d113bsm1679818485a.30.2025.01.08.05.58.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2025 05:58:23 -0800 (PST) In-Reply-To: <867c754gi9.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.300.87.4.3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298780 Archived-At: --Apple-Mail=_21357CA1-03A1-4F7C-9165-0D4E771BF774 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 A good rule of thumb for this could be: if you can define an = =E2=80=9Coperator=E2=80=9D 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 `&=3D`, can operator &=3D()` or `operator and_eq()` -> = operator face. 3. `for`, cannot define `operator for()` -> keyword face. 4. `while`, cannot define `operator while()` -> keyword face.=20 Just my pair of pennies... Best Regards, Jacob Faibussowitsch (Jacob Fai - booss - oh - vitch) > On Jan 8, 2025, at 7:49=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Yuan Fu >> Date: Tue, 7 Jan 2025 19:09:40 -0800 >> Cc: Jacob Faibussowitsch , >> 75226@debbugs.gnu.org >>=20 >> 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? >=20 > What do other editors do? >=20 > Alan, WDYT about this? --Apple-Mail=_21357CA1-03A1-4F7C-9165-0D4E771BF774 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
A good = rule of thumb for this could be: if you can define an =E2=80=9Coperator=E2= =80=9D 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 `&=3D`, can operator &=3D()` 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=E2=80=AFAM= , 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?

= --Apple-Mail=_21357CA1-03A1-4F7C-9165-0D4E771BF774--