GNU bug report logs - #17057
24.3.50; [ruby-mode] Font-locking of special global variables like $$ is broken(missing)

Previous Next

Package: emacs;

Reported by: Bozhidar Batsov <bozhidar <at> batsov.com>

Date: Fri, 21 Mar 2014 12:54:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 17057 <at> debbugs.gnu.org (full text, mbox):

From: Bozhidar Batsov <bozhidar <at> batsov.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 17057 <at> debbugs.gnu.org
Subject: Re: bug#17057: 24.3.50; [ruby-mode] Font-locking of special
 global variables like $$ is broken(missing)
Date: Sat, 22 Mar 2014 12:05:42 +0200
[Message part 1 (text/plain, inline)]
On Saturday, March 22, 2014 at 12:02 PM, Bozhidar Batsov wrote:
> 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 <at> batsov.com (mailto:bozhidar <at> 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).
> > >  
$1 gets font-locked immediately, but $$ currently gets font-locked only after some “word-boundary” character gets inserted (like space, newline, etc).  
> > >  
> > > > 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.  
>  
>  


[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.