unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Andrey Listopadov <andreyorst@gmail.com>
Cc: Wilhelm Kirschbaum <wkirschbaum@gmail.com>, 67246@debbugs.gnu.org
Subject: bug#67246: 30.0.50; elixir-ts-mode uses faces inconsistently
Date: Sun, 26 Nov 2023 01:26:21 +0200	[thread overview]
Message-ID: <d3233eeb-2afc-b9fb-c7a7-4c5d5aa764c9@gutov.dev> (raw)
In-Reply-To: <87a5r2p4pq.fsf@gmail.com>

On 25/11/2023 10:33, Andrey Listopadov wrote:

>> And here's another aspect: the default built-in theme doesn't
>> distinguish many of the faces (and the same is true for many other
>> built-in themes). E.g. it doesn't distinguish variable-name-face from
>> variable-use-face or function-name-face from function-call-face.
> 
> I'm wondering if font-lock.el needs a bit more generic faces, as
> packages often define their own faces, that aren't supported by themes
> in any way.  Again, the example with elixir-mode isn't to bash the
> developers, but before 2019 elixir-mode (not elixir-ts-mode) defined a
> few faces with explicit colors.  Here's a commit that fixed that
> https://github.com/elixir-editors/emacs-elixir/commit/f101c676cc9485aa22ec088a71d8afc72cda3d58
> but before it, `elixir-atom-face' and `elixir-attribute-face' were
> `RoyalBlue4' and `MediumPurple4' no matter what theme you were using.
> IIRC the CIDER package also defines some faces like that, so it's
> somewhat common.

As long as the faces are for unusual contexts and have some fallbacks 
(or preferably inherit from some of the core ones), that's fair practice.

> I can't come up with missing faces, and most modes I use define extra
> faces in terms of inheritance to the inbuilt faces,

Right.

> but maybe
> font-lock-symbol-face is worth including, as some languages may want to
> distinguish these like elixir does right now with `elixir-ts-atom-face'.

I agree we could add more. E.g. a face like that could automatically be 
used for "keywords" in Elisp (and Clojure, and other Lisps) and 
"symbols" in Elixir in Ruby.

What makes me pause is naming: the terminology is a mess here across 
languages. "symbols" usually mean something else in Emacs (and in Lisp 
languages in general), whereas "keywords" mean something else across 
most other languages. Using the name font-lock-symbol-face is bound to 
cause confusion at least across Lisp programmers. Luckily, 
'font-lock-keyword-face' is already taken, so we don't have to consider 
this alternative (which would puzzle the rest of the programming world).

The docstring of 'font-lock-constant-face' says "Face name to use for 
constant and label names", but a name 'font-lock-label-name' sounds 
pretty bland... OTOH, there are labels in C, but nothing with that 
particular name in Elixir, Ruby or Lisp (aside from one macro, I suppose).





  reply	other threads:[~2023-11-25 23:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 19:50 bug#67246: 30.0.50; elixir-ts-mode uses faces inconsistently Andrey Listopadov
2023-11-18  1:36 ` Dmitry Gutov
2023-11-18  7:50   ` Wilhelm Kirschbaum
2023-11-20  1:50     ` Dmitry Gutov
2023-11-20 10:00       ` Andrey Listopadov
2023-11-24 18:56         ` Wilhelm Kirschbaum
2023-11-24 19:05           ` Dmitry Gutov
2023-11-24 19:23             ` Wilhelm Kirschbaum
2023-11-24 19:30               ` Dmitry Gutov
2023-11-24 19:47       ` Wilhelm Kirschbaum
2023-11-25  0:21         ` Dmitry Gutov
2023-11-25  8:33           ` Andrey Listopadov
2023-11-25 23:26             ` Dmitry Gutov [this message]
2023-11-27 17:59               ` Wilhelm Kirschbaum
2023-11-29  3:24                 ` Dmitry Gutov
2023-12-03 10:41                   ` Andrey Listopadov
2023-12-04 17:50                     ` Wilhelm Kirschbaum
2023-12-04 17:46                   ` Wilhelm Kirschbaum
2024-01-10 17:47                     ` Stefan Kangas
2024-01-13  8:50                       ` Wilhelm Kirschbaum
2024-01-29  4:08                         ` Dmitry Gutov
2024-01-30  1:59                           ` Dmitry Gutov
2024-02-05 17:05                             ` Wilhelm Kirschbaum
2024-02-05 17:34                               ` Wilhelm Kirschbaum
2024-02-05 17:42                                 ` Dmitry Gutov
2024-02-05 17:47                                   ` Wilhelm Kirschbaum
2024-02-05 20:51                                     ` Dmitry Gutov
2024-02-07  2:21                                       ` Dmitry Gutov
2024-02-23 15:05                                         ` Wilhelm Kirschbaum
2024-02-07  2:21                               ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=d3233eeb-2afc-b9fb-c7a7-4c5d5aa764c9@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=67246@debbugs.gnu.org \
    --cc=andreyorst@gmail.com \
    --cc=wkirschbaum@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).