[Top][All Lists]

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

Re: Small improvements to ruby-mode

From: Bozhidar Batsov
Subject: Re: Small improvements to ruby-mode
Date: Thu, 11 Jul 2013 14:23:21 +0300

On 10 July 2013 21:09, Dmitry Gutov <address@hidden> wrote:
On 10.07.2013 10:09, Bozhidar Batsov wrote:
Normally I'd have been doing that from the start, but I'm not extremely
fond of Emacs's "issue tracker".

Me neither. It's better that no tracker at all, though.

> While class names are actually constants, the reverse is obviously
> not the same - therefore my desire to separate them.

Still, that's likely the original reason why they're highlighted with the same face. Class names are closer to constants than constants are to symbols.

> Since in a typical Ruby program class and module names are used much
> more than "regular" constants I don't think the change would be
> particularly disruptive.
> classes and modules continue to use the type face, constants start
> using the constant face, symbols continue to use the constant face
> (and optionally there is the ability to customize it). In the long
> run such a change would surely be beneficial.

I meant that we would preserve the equality between module name and constants' faces. So, if they both switch to font-lock-constant-face, this will be noticeable, as, like you said, module names are used a lot.

Symbols can then use type-face, or preprocessor-face, the latter would be a smidgen less inappropriate.

If you do want class names and constants to have different faces, there is an obvious question of ambiguity. Is "C" a class or a constant? I don't like the idea of it changing color after I type the second letter.

Still, we should consider functions with names like Float. Currently they are not highlighted correctly - Something(test) is highlighted as a constant, when obviously it's not. I guess classes, constants and functions like this could be font-locked after the first character that's not part of the identifier name appears, to avoid the changing of the face after the initial character.

ST2 doesn't seem to highlight either, at all. RubyMine, from what I can tell from a Youtube video, either doesn't highlight them, or, depending on the context, highlights them with the same color (and symbols, too): http://www.youtube.com/watch?v=LnN-JIxDRCg#t=1464s

reply via email to

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