[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding Emacs, js.el, template-strings and syntax-tables

From: Dmitry Gutov
Subject: Re: Regarding Emacs, js.el, template-strings and syntax-tables
Date: Tue, 5 Sep 2017 02:40:59 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0

On 8/24/17 3:31 PM, Anders Lindgren wrote:

If you use a string face with, say, both a background and a foreground color, it will matter if you *replace* the existing face as opposed to *prepend* a new face on top of it.

For example, the default Ruby mode replace the face,

That is a legacy behavior, as far as I'm concerned. In some other editors that I've looked at (e.g. Vim and either Sublime Text or Atom), the contents of the interpolation construct look like normal text. You can have nested strings and interpolations inside them, so it's a good semantic cue.


One question is if the delimiters around the expression should be highlighted as well? In Ruby they are highlighted. In my cmake-font-lock[1] package I have opted not to highlight them, as it makes it easier to read the variable name:

If the contents are highlighted differently, the variable name will stand out just the same, even with the delimiters highlighted.

In all cases I've seen, the content is displayed using `font-lock-variable-name-face', even for the cases where the content is more complex than a plain variable. I would say that this is OK, as they stand out and, most of the time, it is a plain variable anyway.

We don't use font-lock-variable-name-face for "plain variables" outside of strings, though. Not in ruby-mode, at least.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]