all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Randy Taylor <dev@rjt.dev>
Cc: casouri@gmail.com, 61655@debbugs.gnu.org,
	Theodor Thornhill <theo@thornhill.no>,
	Eli Zaretskii <eliz@gnu.org>,
	jacob.fai@gmail.com
Subject: bug#61655: [Tree sitter] [Feature Request] font-lock function calls, definitions, separately
Date: Sat, 25 Feb 2023 15:05:38 +0200	[thread overview]
Message-ID: <1cd94489-7368-ce2c-0246-6a55c7fc5044@yandex.ru> (raw)
In-Reply-To: <PRxAJSYBiWcFRlw0KQ_PSNXxsx3bNKcMM7osaWm0jvabUvmYYx15Le4MlEpGRpmtofLb2c_jBR-KzaSp6c1WsDO9b_et9ucFRGzZ0tMGUrY=@rjt.dev>

On 25/02/2023 05:59, Randy Taylor wrote:

> It is a suitable term, but there is a confusing overlap, at least to me. In C++ parlance, for example, they are referred to as reference variables. I wasn't really getting down to the semantics of it, just when I see something like:
> 
> void quack(int& thing)
>                  ^^^^^
> obj_t& thing2 = otherthing;
>         ^^^^^^
> 
> Those are the things I would expect font-lock-variable-ref-face to highlight if I was just going off of the name, and I would expect many others to think the same.

That's not unreasonable.

> I don't have any better ideas than font-lock-{property,variable}-use-face, so I guess we can see if anyone else has any opinions on the matter.

The only one I could think of is 
font-lock-{property,variable}-value-face. But that one can give wrong 
ideas as well.

I suppose we should go with -use-, unless more alternatives are suggested.

>>> Personally, I don't really see the value in differentiating these for variables. I can understand it a little more for properties. But I guess it doesn't hurt to add if folks want it.
>>
>>
>> I see two potential uses:
>>
>> 1. Customize treesit-font-lock-level to 4 but
>> font-lock-variable-ref-face to copy 'default' (or close to it), to skip
>> variable reference highlighting or make it less noticeable.
> 
> Wouldn't they just remove the variable feature if they want that?

That's the obvious choice (which might be less accessible to those who 
don't venture into the manual, though, or don't write Elisp), but now 
they also have the option of toning down the highlights.

>> 2. Pattern matching or comparably complex syntax which at a first glance
>> may look like variable reference, but actually creates new bindings (or
>> vice versa, creates new binding when one wanted to refer to an existing
>> value).
>>
>> Emphasizing the difference can help people, beginners especially [in a
>> particular language].
>>
> 
> No doubt there are uses, I just don't really see them actually getting much use in practice. But maybe I'm wrong :).

We'll see. I hope we will. Some third-party theme or two might start 
carrying that distinction, to start with.

It might be nice to improve the default theme in that regard too, but 
that's a non-trivial task.





  reply	other threads:[~2023-02-25 13:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 15:54 bug#61655: [Tree sitter] [Feature Request] font-lock function calls, definitions, separately Jacob Faibussowitsch
2023-02-20 17:03 ` Eli Zaretskii
2023-02-20 20:24   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 20:45     ` Jacob Faibussowitsch
2023-02-21  8:28 ` Yuan Fu
2023-02-21  9:55   ` Dmitry Gutov
2023-02-21 15:31     ` Jacob Faibussowitsch
2023-02-21 23:24       ` Dmitry Gutov
2023-02-22 18:07         ` Jacob Faibussowitsch
2023-02-22 21:39           ` Dmitry Gutov
2023-02-22 20:45       ` Yuan Fu
2023-02-22 21:38         ` Dmitry Gutov
2023-02-23 18:15           ` Eli Zaretskii
2023-02-24  2:31             ` Dmitry Gutov
2023-02-24  7:56               ` Eli Zaretskii
2023-02-24 11:31                 ` Dmitry Gutov
2023-02-24 11:44                   ` Eli Zaretskii
2023-02-24 14:24                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-25  1:06               ` Randy Taylor
2023-02-25  2:28                 ` Dmitry Gutov
2023-02-25  3:59                   ` Randy Taylor
2023-02-25 13:05                     ` Dmitry Gutov [this message]
2023-02-28  2:09                       ` Dmitry Gutov
2023-02-25  8:05                 ` Eli Zaretskii

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=1cd94489-7368-ce2c-0246-6a55c7fc5044@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=61655@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dev@rjt.dev \
    --cc=eliz@gnu.org \
    --cc=jacob.fai@gmail.com \
    --cc=theo@thornhill.no \
    /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.