all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Bozhidar Batsov <bozhidar@batsov.com>
Cc: 16610@debbugs.gnu.org
Subject: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly
Date: Sat, 01 Feb 2014 18:29:10 +0200	[thread overview]
Message-ID: <52ED20D6.5000300@yandex.ru> (raw)
In-Reply-To: <6BA278AF18054533AC980400A5F5FD54@gmail.com>

On 01.02.2014 17:31, Bozhidar Batsov wrote:
> Variables can’t end with ?, so
> block_given? is always clear. Same goes for exit!. Pretty sure no one
> will ever name a var __xxx__.

Good points.

> `binding` & `caller` seem the most likely
> names in the list to cause a problem like `format`, since they’d be good
> variable names (at least in code making use of metaprogramming).

Still not very likely, though (e.g. compared to `format`, which is in 
every other Rails tutorial). And anyone doing metaprogramming should be 
aware of these two, and would probably name their vars differently.

I have a patch ready, but here's what I'm not sure about: if the 
built-in method that requires arguments is followed by (maybe whitespace 
and) newline, do we highlight it?

If yes, we'll have false positives when a local variable with that name 
is at a line by itself, maybe on the last line of a method, so that its 
value is returned.

If no, any such built-in won't be highlighted until the user types in 
the first argument, which is also suboptimal (if I made a typo, I'll 
have to go back a longer distance).





  reply	other threads:[~2014-02-01 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01  7:22 bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly Bozhidar Batsov
2014-02-01 15:19 ` Dmitry Gutov
2014-02-01 15:31   ` Bozhidar Batsov
2014-02-01 16:29     ` Dmitry Gutov [this message]
2014-02-01 16:47       ` Bozhidar Batsov
2014-02-01 17:09         ` 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

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

  git send-email \
    --in-reply-to=52ED20D6.5000300@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=16610@debbugs.gnu.org \
    --cc=bozhidar@batsov.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.