From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode Date: Thu, 05 Dec 2013 14:02:53 -0500 Message-ID: References: <8761r4bh8h.fsf@yandex.ru> <529FB799.3000203@yandex.ru> <529FF61B.4060709@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386270197 22430 80.91.229.3 (5 Dec 2013 19:03:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 19:03:17 +0000 (UTC) Cc: 15874@debbugs.gnu.org, Bozhidar Batsov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 20:03:21 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 1VoeCm-0005eY-N8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 20:03:20 +0100 Original-Received: from localhost ([::1]:55264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoeCm-0007Bl-5A for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 14:03:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoeCc-0007Be-7m for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 14:03:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoeCU-0008M6-TO for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 14:03:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoeCU-0008M2-GU for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 14:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VoeCT-0004Ax-Pn for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 14:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2013 19:03: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.138627017816042 (code B ref 15874); Thu, 05 Dec 2013 19:03:01 +0000 Original-Received: (at 15874) by debbugs.gnu.org; 5 Dec 2013 19:02:58 +0000 Original-Received: from localhost ([127.0.0.1]:60310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoeCP-0004Af-JL for submit@debbugs.gnu.org; Thu, 05 Dec 2013 14:02:57 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:14470) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoeCM-0004AW-Mj for 15874@debbugs.gnu.org; Thu, 05 Dec 2013 14:02:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxL6g/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtjRuDbwOIYZwZgV6DFQ X-IPAS-Result: Av8EABK/CFFFxL6g/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtjRuDbwOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="41233109" Original-Received: from 69-196-190-160.dsl.teksavvy.com (HELO pastel.home) ([69.196.190.160]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Dec 2013 14:02:53 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 90B0560379; Thu, 5 Dec 2013 14:02:53 -0500 (EST) In-Reply-To: <529FF61B.4060709@yandex.ru> (Dmitry Gutov's message of "Thu, 05 Dec 2013 05:42:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:81458 Archived-At: >> Maybe a good way to handle them is via syntax-propertize, > Huh yes, that's an approach I haven't considered. The advantage is that it would also fix the sexp-movement operations. > But it seems more performance-intensive than the other options, at > least as long as Emacs regexps don't support lookbehind. I don't see why we'd need lookbehind. We can use a regexp like "\\(?:\\sw\\|\\s_\\)\\([!?]\\)" and then place the syntax-table property on the ? (or !) character. > Say, why don't we have a "non-symbol" matcher? I'd rather do something a bit more generic, then, like a \\S which can take a set of syntaxes to exclude. Or maybe extend the [:foo:] character classes to allow [:sw:], [:s_:], etc... so we could do [^[:sw:][:s_:]]. > 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. It's not that big of a deal, tho. I doubt this would ever appear as a noticeable slowdown. And with [^[:sw:][:s_:]] you'd have the extra work of having to handle the EOB case, so you'd have \(\'\|[^[:sw:][:s_:]]). >> 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. But you said that ! and ? are only allowed in method names. So somehow Ruby's parser/lexer distinguishes the two cases. Would a reference to a variable "foo?" simply always be parsed as "a reference to variable foo?" which would later trigger an error because there's no such variable (because there can't be any such variable)? Stefan