unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 17057@debbugs.gnu.org
Subject: bug#17057: 24.3.50; [ruby-mode] Font-locking of special global variables like $$ is broken(missing)
Date: Sat, 22 Mar 2014 12:02:10 +0200	[thread overview]
Message-ID: <EF339BA8A1A24120A78D16BA51AA0003@gmail.com> (raw)
In-Reply-To: <D528A22FC67A4D269AB18273C1C40604@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

On Friday, March 21, 2014 at 4:53 PM, Bozhidar Batsov wrote:
> On Friday, March 21, 2014 at 4:47 PM, Dmitry Gutov wrote:
> > Bozhidar Batsov <bozhidar@batsov.com (mailto:bozhidar@batsov.com)> writes:
> >  
> > > Here's a few examples:
> > >  
> > > "this is #$$"
> > >  
> > > var = $!
> > >  
> > > Things are different for:
> > >  
> > > "this is #$1"
> > >  
> > > var = $1
> >  
> > Have you tried it in the latest Emacs? For me, only one example
> >  
> > "this is #$$"
> >  
> > is not highlighted (I'll fix that).
> >  
> > > There's another thing to consider - do built-in global vars should be
> > > font-locked like built-ins or like the other (user-defined) global
> > > variables? Personally I'd font-lock them as built-in to underline their
> > > significance.
> > >  
> >  
> >  
> > Hmmm, maybe. But we also highlight nil, self, true, false, __LINE__,
> > __ENCODING__ and __FILE__ with font-lock-variable-name-face. Should we
> > change these, too?
> >  
> >  
> >  
>  
> Technically speaking all of those are keywords, not variables. Somewhat odd __LINE__ and friends are  
> treated at string literals by the Ruby parser. As all of those evaluate to some value unlike most other keywords I guess it makes some sense to font-lock them as variables, but I’d prefer if we used font-locking that makes their special status more apparent.  
>  
>  

There’s one more thing to consider - the special variables aliases defined in `English`. Those are considered de facto built-in (and are actually built-in in some implementations like JRuby; will probably be available out-of-the-box in MRI 3 as well), so I’d suggest treating them the same way as vars like $$, etc.  

[-- Attachment #2: Type: text/html, Size: 2807 bytes --]

  reply	other threads:[~2014-03-22 10:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 12:53 bug#17057: 24.3.50; [ruby-mode] Font-locking of special global variables like $$ is broken(missing) Bozhidar Batsov
2014-03-21 14:47 ` Dmitry Gutov
2014-03-21 14:53   ` Bozhidar Batsov
2014-03-22 10:02     ` Bozhidar Batsov [this message]
2014-03-22 10:05       ` Bozhidar Batsov
2014-03-24  7:33         ` Dmitry Gutov
2014-03-24  9:12     ` Dmitry Gutov
2014-03-24  9:45       ` Bozhidar Batsov
2014-03-26 12:35         ` Dmitry Gutov
2014-03-26 12:42           ` Bozhidar Batsov
2014-03-27  8:26             ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EF339BA8A1A24120A78D16BA51AA0003@gmail.com \
    --to=bozhidar@batsov.com \
    --cc=17057@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).