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#15874: 24.3.50; exit! not properly font-locked in ruby-mode Date: Thu, 05 Dec 2013 05:42:19 +0200 Message-ID: <529FF61B.4060709@yandex.ru> References: <8761r4bh8h.fsf@yandex.ru> <529FB799.3000203@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1386214999 6433 80.91.229.3 (5 Dec 2013 03:43:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 03:43:19 +0000 (UTC) Cc: 15874@debbugs.gnu.org, Bozhidar Batsov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 04:43:23 2013 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 1VoPqU-0001Hk-9v for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 04:43:22 +0100 Original-Received: from localhost ([::1]:51620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoPqT-0007ZF-Nm for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2013 22:43:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoPqJ-0007ZA-OK for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 22:43:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoPqA-0006we-Gn for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 22:43:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoPqA-0006wa-DG for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 22:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VoPqA-000495-2P for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 22:43: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: Thu, 05 Dec 2013 03:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15874 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15874-submit@debbugs.gnu.org id=B15874.138621494815893 (code B ref 15874); Thu, 05 Dec 2013 03:43:01 +0000 Original-Received: (at 15874) by debbugs.gnu.org; 5 Dec 2013 03:42:28 +0000 Original-Received: from localhost ([127.0.0.1]:58696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoPpb-00048G-Nz for submit@debbugs.gnu.org; Wed, 04 Dec 2013 22:42:27 -0500 Original-Received: from mail-wg0-f54.google.com ([74.125.82.54]:47744) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoPpY-000486-Dl for 15874@debbugs.gnu.org; Wed, 04 Dec 2013 22:42:24 -0500 Original-Received: by mail-wg0-f54.google.com with SMTP id n12so14663540wgh.21 for <15874@debbugs.gnu.org>; Wed, 04 Dec 2013 19:42:23 -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=oRnYo0phcJ5BUwyrD6kV95uAHkqd7jkZ1u/eEcawPOY=; b=GZfIqRLbfOW8NuhWR5Pjm9a4LqYtYHm39PiDOh2c4JX0DUcxyh7vxyKLDIrO0yP2Ok QxtPKDJ5/U8BbvdX+SW/B1stve4WgceiWjvBfmexBTYGLcAsy/A3WqKhuQ8yPr9q2Gfz XxOVovfeL9zQBcjjLMUnjXUglxAqx/bYI04nKeoz+QeQpW1k7b+Ha0U99hRT2aj/R4Qw 5knwTnjmIzQK9Qzrbdo/4FbJcUoiJNO8D6Wi6l0OlTCEGuy8SVlEBKYFqvxbzv0jlB0t t8/o8Yls1kZ7Q0MGJxSHaxeVlhHU7kbeVA1XAbkFqRQcCpsw26qPjmF3kZEqOqmR+6pO 2L1g== X-Received: by 10.180.81.33 with SMTP id w1mr8524217wix.42.1386214943224; Wed, 04 Dec 2013 19:42:23 -0800 (PST) Original-Received: from [192.168.10.2] ([62.228.136.233]) by mx.google.com with ESMTPSA id bk7sm2038186wib.10.2013.12.04.19.42.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 19:42:22 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: 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:81414 Archived-At: On 05.12.2013 04:50, Stefan Monnier wrote: > Maybe a good way to handle them is via syntax-propertize, Huh yes, that's an approach I haven't considered. But it seems more performance-intensive than the other options, at least as long as Emacs regexps don't support lookbehind. If we could match "non-symbols", then the font-lock part of the problem would be solved, and appending "?" or "!" in the forward-token and backward-token functions would take negligible amount of time. Say, why don't we have a "non-symbol" matcher? I would think that in many cases the regexp engine performs unnecessary work when it sees "\\_<" or "\\_>" because we often know in advance that the character we've already matched, or will have to match next, is a symbol constituent. But the engine has to check. Most uses of `(regexp-opt '("boats" "boats" "boats") 'symbols)' would fall under this scenario. > then, especially > if we can come up with a good regexp that distinguishes "method name" > from "local variable name"? Not really. References to local variables, unlike instance and global ones, are indistinguishable from method calls if we judge only by name. We could backtrack until the beginning of block or method, look for assignments, etc, but that's a lot of work for marginal gain: we can just assume that each such reference is a method calls, because otherwise it would be syntax error.