From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: Small improvements to ruby-mode Date: Wed, 10 Jul 2013 09:23:52 +0300 Message-ID: References: <2A6700DEDCA640EF92B326002717596D@gmail.com> <51D1CB5A.2060900@yandex.ru> <51D1F98D.3060900@yandex.ru> <51D31E12.7060002@yandex.ru> <51D4476A.40107@yandex.ru> <51D6A02C.2020207@yandex.ru> <51D6D500.7080306@yandex.ru> <51DB6516.1090708@yandex.ru> <51DC45D2.4090200@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001517570c4250fd4004e122525c X-Trace: ger.gmane.org 1373437445 26304 80.91.229.3 (10 Jul 2013 06:24:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2013 06:24:05 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 10 08:24:07 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uwnor-00049r-6h for ged-emacs-devel@m.gmane.org; Wed, 10 Jul 2013 08:24:05 +0200 Original-Received: from localhost ([::1]:35997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwnoq-0007u7-P9 for ged-emacs-devel@m.gmane.org; Wed, 10 Jul 2013 02:24:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwnok-0007tu-5R for emacs-devel@gnu.org; Wed, 10 Jul 2013 02:24:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uwnof-0005wA-Km for emacs-devel@gnu.org; Wed, 10 Jul 2013 02:23:58 -0400 Original-Received: from mail-qe0-x234.google.com ([2607:f8b0:400d:c02::234]:43586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uwnof-0005w3-Em for emacs-devel@gnu.org; Wed, 10 Jul 2013 02:23:53 -0400 Original-Received: by mail-qe0-f52.google.com with SMTP id i11so3539947qej.39 for ; Tue, 09 Jul 2013 23:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=a9FQIITr1hPAdKqwbeZDF7NE940ek+z2PdmZEEq0F84=; b=XK2RvtcMQo+9DUGEfE/u6bnCXPhPKnT8EYTAFuwshQ0OPATOstfj02QR3tJmZ0ncLE jEurwPxq9BtZuMjZrLqWKXps2WdumSJ2jHdDY/VF0b2w3N9gtyNj9UlmR4QckkaAknog Bxtze0vKTpNiAHOgsMhV2ZTcaCChDJEcZz9XQM044iz2EODqVwJoQSbZSrqXri2UdFtN WKG7n+yCx3djjn5Kv5d59TkMvgSZJc/jgunKrCtRY3uR0o2CZePBo1CRT580j4dZkG8y TxQAmx7sd92NIJfU7Q5Xj3Q0oowjkwFOmsazJGgbmKV1OCCO2R2lypi+mQfAaYQHpzJx rhMg== X-Received: by 10.229.128.100 with SMTP id j36mr1218652qcs.12.1373437433016; Tue, 09 Jul 2013 23:23:53 -0700 (PDT) Original-Received: by 10.49.59.13 with HTTP; Tue, 9 Jul 2013 23:23:52 -0700 (PDT) In-Reply-To: <51DC45D2.4090200@yandex.ru> X-Google-Sender-Auth: 9qhYX006Qz2PL0Py_emLCYXHxEs X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c02::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161794 Archived-At: --001517570c4250fd4004e122525c Content-Type: text/plain; charset=UTF-8 On 9 July 2013 20:18, Dmitry Gutov 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. --001517570c4250fd4004e122525c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 9 July 2013 20:18, Dmitry Gutov <<= a href=3D"mailto:dgutov@yandex.ru" target=3D"_blank">dgutov@yandex.ru&g= t; wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
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 constan= ts.

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 Rub= y symbols) as well. I guess ideally we would have a separate face for symbo= ls 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.
=C2=A0

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

While class names are actually constants, the reverse is obvi= ously not the same - therefore my desire to separate them.
=C2=A0

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 thi= nk the change would be particularly disruptive.
classes and modules continue to use the type face, constants sta= rt 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 ch= ange would surely be beneficial.

--001517570c4250fd4004e122525c--