From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs 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 Message-ID: <52ED20D6.5000300@yandex.ru> References: <87eh3moo7e.fsf@yandex.ru> <6BA278AF18054533AC980400A5F5FD54@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1391272216 12924 80.91.229.3 (1 Feb 2014 16:30:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Feb 2014 16:30:16 +0000 (UTC) Cc: 16610@debbugs.gnu.org To: Bozhidar Batsov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 01 17:30:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1W9dSX-0000HH-Rh for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Feb 2014 17:30:21 +0100 Original-Received: from localhost ([::1]:38158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9dSX-0006eb-9H for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Feb 2014 11:30:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9dSN-0006eE-16 for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 11:30:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9dSF-0007En-Le for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 11:30:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9dSF-0007Cs-Gs for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 11:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W9dSE-00083y-Jq for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 11:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Feb 2014 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16610 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16610-submit@debbugs.gnu.org id=B16610.139127216030900 (code B ref 16610); Sat, 01 Feb 2014 16:30:02 +0000 Original-Received: (at 16610) by debbugs.gnu.org; 1 Feb 2014 16:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:45278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9dRX-00082K-Pk for submit@debbugs.gnu.org; Sat, 01 Feb 2014 11:29:20 -0500 Original-Received: from mail-ea0-f171.google.com ([209.85.215.171]:61557) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9dRU-000828-Nk for 16610@debbugs.gnu.org; Sat, 01 Feb 2014 11:29:17 -0500 Original-Received: by mail-ea0-f171.google.com with SMTP id f15so2929013eak.30 for <16610@debbugs.gnu.org>; Sat, 01 Feb 2014 08:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TbxgBIMZ6ypy0FYkYJBi46ofsIGGQ6jKl6ejtYJvPo0=; b=Q4ljAEw8xhz884XX318upIoeL7MPbEu9/WvZ0ZD52KampjDM4xI5SMWjopeofhfDQc 8SZWlwEv7Le0PdssXJbBdB6iZZBzphCtiZygMaaiPdkzkDHfessR2MqM0P3ut3YR8sM0 qkqqpJ8Li7Me0pwJOzmjZjaaFUkZQO5l+pBTGFQMDGBL55WBnHeVVO042XYoUndAhDVX INRCuJe5JMLWolynF9vqmK1tfWDv/uDtSmt7WUv+MkFYjqxNJ6TEEXTVnCcWH9Lm5Uul vvbJsmk4F25xbf3bhlyWwj/5+FcUnc7kZoBqn1zR2ceYHewNpojkJvnc3pReaxvcVe58 DUvw== X-Received: by 10.15.53.133 with SMTP id r5mr56824eew.100.1391272155146; Sat, 01 Feb 2014 08:29:15 -0800 (PST) Original-Received: from [192.168.10.2] (93-150-41.netrun.cytanet.com.cy. [93.109.150.41]) by mx.google.com with ESMTPSA id v7sm51048577eel.2.2014.02.01.08.29.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 08:29:14 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <6BA278AF18054533AC980400A5F5FD54@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84399 Archived-At: 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).