[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: Wed, 10 Jul 2013 09:23:52 +0300

On 9 July 2013 20:18, Dmitry Gutov <address@hidden> wrote:
On 09.07.2013 20:07, Bozhidar Batsov wrote:
Currently we use the same face (font-lock-type-face) for both
classes/modules and constants. Classes and Modules are mandatory
CamelCase(although Camel_Case is also valid, albeit it's considered
extremely poor style) and just about everyone uses SCREAMING_SNAKE_CASE
for constants so I'd suggest to use font-lock-constant-face for constants.

Oh, but we already use font-lock-constant-face. For symbols. :)

Yep, I'm aware of that. Lisp modes use `font-lock-constant-face` for keywords (that are essentially the same as Ruby symbols) as well. I guess ideally we would have a separate face for symbols that simply derives `font-lock-constant-face` and give theme maintainers the ability to override it. I think the only face we're not currently using is the preprocessor face.

Considering that, in Ruby, class names are also constants, highlighting both with the same face doesn't look too bad.

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

I guess we can swap the two faces, but I'm kind of used to the way ruby-mode buffers look now. IOW, users may find it disruptive.

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.

reply via email to

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