Received: (at 16915) by debbugs.gnu.org; 12 Mar 2014 14:25:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 12 10:25:33 2014
Received: from localhost ([127.0.0.1]:34714 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WNk69-0000FV-E4
for submit <at> debbugs.gnu.org; Wed, 12 Mar 2014 10:25:33 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:35909)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <monnier@HIDDEN>) id 1WNk67-0000FN-Ri
for 16915 <at> debbugs.gnu.org; Wed, 12 Mar 2014 10:25:32 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AmdOABK/CFFMCppy/2dsb2JhbAA8CINut0eDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtjRuDbwOkeoFegxM
X-IPAS-Result: AmdOABK/CFFMCppy/2dsb2JhbAA8CINut0eDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtjRuDbwOkeoFegxM
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208,217";a="51457277"
Received: from 76-10-154-114.dsl.teksavvy.com (HELO pastel.home)
([76.10.154.114])
by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
12 Mar 2014 10:25:31 -0400
Received: by pastel.home (Postfix, from userid 20848)
id E40156057F; Wed, 12 Mar 2014 10:25:30 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#16915: 24.3.50;
[ruby-mode] Comments in regexps using the extended syntax are not
font-locked properly
Message-ID: <jwvk3bz4hy2.fsf-monnier+emacsbugs@HIDDEN>
References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN>
<jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN>
<531D67DE.4030200@HIDDEN>
<jwv8usib04s.fsf-monnier+emacsbugs@HIDDEN>
<53201131.3080400@HIDDEN>
Date: Wed, 12 Mar 2014 10:25:30 -0400
In-Reply-To: <53201131.3080400@HIDDEN> (Dmitry Gutov's message of "Wed, 12
Mar 2014 09:48:01 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 16915
Cc: 16915 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)
> If we're speaking of multiple modes in general, syntax-ppss might not be
> enough to determine which keywords to highlight. Even if it includes
> information about new syntax classes.
It wouldn't really include info *about* new syntax classes, but the new
syntax class I suggest (which specifies a syntax-table to use) would
require changing the "parse-partial-sexp state" by keeping track of the
"current syntax-table".
"Syntax classes" are "events" which cause changes in the
parse-partial-sexp state machine, and syntax-ppss is a way to get the
state of that machine at a given position.
> Suppose we have an HTML file with <script> and <style> tags inside. Would
> points inside of these tags have different states?
Yes. E.g. (nth 10 (syntax-ppss)) would return a new "context" info
(which could just be "the syntax table to use in that area").
> Would some font-lock code compare syntax table reference attached
> to a syntax class, with a syntax table it wants?
Yes, quite possibly.
Stefan
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.Received: (at 16915) by debbugs.gnu.org; 12 Mar 2014 07:48:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 12 03:48:13 2014 Received: from localhost ([127.0.0.1]:33859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1WNdtc-0001Ee-Ma for submit <at> debbugs.gnu.org; Wed, 12 Mar 2014 03:48:13 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:53117) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <raaahh@HIDDEN>) id 1WNdtW-0001EP-RV for 16915 <at> debbugs.gnu.org; Wed, 12 Mar 2014 03:48:07 -0400 Received: by mail-wi0-f176.google.com with SMTP id hr14so1956472wib.15 for <16915 <at> debbugs.gnu.org>; Wed, 12 Mar 2014 00:48:05 -0700 (PDT) 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=Yr11CUCIKELZsCLJlAc/s3hQ9iY//xu60qz279ksfPU=; b=J77upFW3w8vZ9NhPg/u38+NXdZAGSaivaYyXn7B2sd6s7RvaH5SqUQGhXmHbfwwPq5 ugS85X34av5gMj29o3mHwtB2WlmFkM1TqhQvZfHek4adC4RjQU/MYsieJutDNQSGzg76 uXZhoZgKbheC0Mz8KrPBao/yeAmXABQf9At5bxd6no8ozK+aiFWL4SRabQJjCkFgQE3+ igKmDuzStTxNjgoll9z8meu9ncQJWVecVyQutmTmNPW8jE+XQV51VVVb6sdWSHpIcUBV k5VMDEJNOUzTuHxXfHy7Y0zi19DTr6BICdDUbxnm1yrowTqJ5CErGZ6HWFOxVvxLSAJZ A+6g== X-Received: by 10.180.89.225 with SMTP id br1mr6334713wib.38.1394610485687; Wed, 12 Mar 2014 00:48:05 -0700 (PDT) Received: from [192.168.10.2] ([93.109.49.57]) by mx.google.com with ESMTPSA id f7sm67570826wjb.7.2014.03.12.00.48.03 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 00:48:04 -0700 (PDT) Message-ID: <53201131.3080400@HIDDEN> Date: Wed, 12 Mar 2014 09:48:01 +0200 From: Dmitry Gutov <dgutov@HIDDEN> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN> <jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN> <531D67DE.4030200@HIDDEN> <jwv8usib04s.fsf-monnier+emacsbugs@HIDDEN> In-Reply-To: <jwv8usib04s.fsf-monnier+emacsbugs@HIDDEN> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16915 Cc: 16915 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 10.03.2014 16:40, Stefan Monnier wrote: > We usually use syntax-tables for that. They do provide more flexibility > than needed (so far), such as making it possible to allow different > commenting conventions within the new context. But it seems like > a "simple" way to handle the problem, so the extra generality is a bonus. To handle this part of the problem (literals within literals), yes, certainly. >> (but - and this is a change from certain other multi-mode uses - still >> fontify uncommented text inside them with the regexp face). But in the >> general case, we would at least want to be able to change >> font-lock-keywords, too. > > `font-lock-keywords' can use `syntax-ppss' to decide which rules to use > (since syntax-ppss would have to include the "context state" somewhere > in its output). It's not terribly convenient to do currently, so we may > want to provide a new replacement for font-lock-keywords which makes it > easier (and avoids relying on "eval" while we're at it). If we're speaking of multiple modes in general, syntax-ppss might not be enough to determine which keywords to highlight. Even if it includes information about new syntax classes. Suppose we have an HTML file with <script> and <style> tags inside. Would points inside of these tags have different states? What might be the difference between them? Would some font-lock code compare syntax table reference attached to a syntax class, with a syntax table it wants?
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
Received: (at 16915) by debbugs.gnu.org; 10 Mar 2014 14:40:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 10:40:22 2014
Received: from localhost ([127.0.0.1]:60409 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WN1NN-0007il-GI
for submit <at> debbugs.gnu.org; Mon, 10 Mar 2014 10:40:22 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:16788)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <monnier@HIDDEN>) id 1WN1NG-0007iW-F3
for 16915 <at> debbugs.gnu.org; Mon, 10 Mar 2014 10:40:15 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCppy/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0bg28DklqSIIFegxM
X-IPAS-Result: Av8EABK/CFFMCppy/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0bg28DklqSIIFegxM
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="50988486"
Received: from 76-10-154-114.dsl.teksavvy.com (HELO pastel.home)
([76.10.154.114])
by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
10 Mar 2014 10:40:13 -0400
Received: by pastel.home (Postfix, from userid 20848)
id E11F6606E8; Mon, 10 Mar 2014 10:40:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#16915: 24.3.50;
[ruby-mode] Comments in regexps using the extended syntax are not
font-locked properly
Message-ID: <jwv8usib04s.fsf-monnier+emacsbugs@HIDDEN>
References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN>
<jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN>
<531D67DE.4030200@HIDDEN>
Date: Mon, 10 Mar 2014 10:40:12 -0400
In-Reply-To: <531D67DE.4030200@HIDDEN> (Dmitry Gutov's message of "Mon, 10
Mar 2014 09:21:02 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 16915
Cc: 16915 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)
>> My preference would be to think about it as a "multi-mode" case, and
>> hence make it possible to specify a different syntax-table to use within
>> the regexp.
> I remember this idea, but have a hard time viewing it in the context of our
> latest discussion on the subject of multi-modes.
> First, why only syntax-table?
It was not meant as excluding other data.
> For this specific case, a syntax table change is not required, we only
> need to be able to view the text between /'s as a separate context
Not necessarily required in all cases, but in order to handle the
various existing cases in various languages, we need some way to
indicate, for instance:
- Do double quotes introduce strings when used within this new context?
- Do comment chars introduce comments when used within this new context?
- Does \ still escape chars in this new context?
We usually use syntax-tables for that. They do provide more flexibility
than needed (so far), such as making it possible to allow different
commenting conventions within the new context. But it seems like
a "simple" way to handle the problem, so the extra generality is a bonus.
> (but - and this is a change from certain other multi-mode uses - still
> fontify uncommented text inside them with the regexp face). But in the
> general case, we would at least want to be able to change
> font-lock-keywords, too.
`font-lock-keywords' can use `syntax-ppss' to decide which rules to use
(since syntax-ppss would have to include the "context state" somewhere
in its output). It's not terribly convenient to do currently, so we may
want to provide a new replacement for font-lock-keywords which makes it
easier (and avoids relying on "eval" while we're at it).
>> I think of it along the lines of a new syntax-class, applied to the "/"
>> char, which would change the syntax-table for the subsequent text.
> How would this interact with a new hook that would `syntax-ppss' would run
> on the cached entries?
The way I imagine it, it would work at the parse-partial-sexp level
(extending the returned PPSS with a new field indicating the current
syntax-table or something similar). So syntax.el would stay
basically unchanged.
How that would interact with a new hook? Haven't thought about it yet.
> Would its default value look for the chars bearing the new syntax class?
I don't really understand the question. But I'd guess that I don't know
the answer.
Stefan
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.Received: (at 16915) by debbugs.gnu.org; 10 Mar 2014 07:21:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 03:21:13 2014 Received: from localhost ([127.0.0.1]:58664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1WMuWO-0000RV-9u for submit <at> debbugs.gnu.org; Mon, 10 Mar 2014 03:21:12 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:63853) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <raaahh@HIDDEN>) id 1WMuWK-0000RL-HK for 16915 <at> debbugs.gnu.org; Mon, 10 Mar 2014 03:21:09 -0400 Received: by mail-we0-f178.google.com with SMTP id u56so7847381wes.23 for <16915 <at> debbugs.gnu.org>; Mon, 10 Mar 2014 00:21:07 -0700 (PDT) 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=f1qwoUpAIUC37Za1lSe2TA6BIcJHGn4CYa3TVIBjBos=; b=JR+5XDRZb77A8C8QL0k2YJJGWkFtjl//jwQmY2I25QQPJX/cVCEMl37Q4xWUDJclTy rHefImFRPKNfW4VZi0k3O8z2VtUjC1uWP8SobwWkOUuQy0uJ5DMIaZzhz31o+DHHnQTn 2QUuzAuqQU3Qgi1jx90vAP6ASzzVBzzWxiVo9FgxERrjwt4nHBfhS5Z/MVJG5LtOAaJf 5g4sdh0ZzD3mL6kTXrHAmU0CwTEXo+yXmSwwSZVy9q8pIPiZToGeh+m8CEYGHgM2JJtM cL1D4NJOSBaAYCs3lVBO0FZMOHkFp+ewjEaABOzItvienG2+o9BXyo2/P5BdQJ02juyQ OfSg== X-Received: by 10.180.36.8 with SMTP id m8mr6750134wij.42.1394436067554; Mon, 10 Mar 2014 00:21:07 -0700 (PDT) Received: from [192.168.10.2] (31-125-150.netrun.cytanet.com.cy. [31.153.125.150]) by mx.google.com with ESMTPSA id 15sm48337160wjo.13.2014.03.10.00.21.05 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Mar 2014 00:21:06 -0700 (PDT) Message-ID: <531D67DE.4030200@HIDDEN> Date: Mon, 10 Mar 2014 09:21:02 +0200 From: Dmitry Gutov <dgutov@HIDDEN> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN> <jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN> In-Reply-To: <jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16915 Cc: 16915 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 07.03.2014 23:04, Stefan Monnier wrote: > My preference would be to think about it as a "multi-mode" case, and > hence make it possible to specify a different syntax-table to use within > the regexp. I remember this idea, but have a hard time viewing it in the context of our latest discussion on the subject of multi-modes. First, why only syntax-table? For this specific case, a syntax table change is not required, we only need to be able to view the text between /'s as a separate context (but - and this is a change from certain other multi-mode uses - still fontify uncommented text inside them with the regexp face). But in the general case, we would at least want to be able to change font-lock-keywords, too. > I think of it along the lines of a new syntax-class, applied to the "/" > char, which would change the syntax-table for the subsequent text. How would this interact with a new hook that would `syntax-ppss' would run on the cached entries? Would its default value look for the chars bearing the new syntax class?
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
Received: (at 16915) by debbugs.gnu.org; 7 Mar 2014 21:04:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 16:04:06 2014
Received: from localhost ([127.0.0.1]:55254 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WM1w5-00035U-E5
for submit <at> debbugs.gnu.org; Fri, 07 Mar 2014 16:04:05 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61049)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <monnier@HIDDEN>) id 1WM1w2-00035K-Qq
for 16915 <at> debbugs.gnu.org; Fri, 07 Mar 2014 16:04:03 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCppy/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0bg28DiGGcGYFegxU
X-IPAS-Result: Av8EABK/CFFMCppy/2dsb2JhbAA8CLs1g1kXc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0bg28DiGGcGYFegxU
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="50828957"
Received: from 76-10-154-114.dsl.teksavvy.com (HELO pastel.home)
([76.10.154.114])
by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
07 Mar 2014 16:04:01 -0500
Received: by pastel.home (Postfix, from userid 20848)
id 32CA960349; Fri, 7 Mar 2014 16:04:01 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#16915: 24.3.50;
[ruby-mode] Comments in regexps using the extended syntax are not
font-locked properly
Message-ID: <jwvy50ld8tq.fsf-monnier+emacsbugs@HIDDEN>
References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN>
Date: Fri, 07 Mar 2014 16:04:00 -0500
In-Reply-To: <87y50to93u.fsf@HIDDEN> (Dmitry Gutov's message of "Sun, 02
Mar 2014 00:19:17 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 16915
Cc: 16915 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)
> Ideally, we'd have a new kind of syntax instead of strings (native
> regexp support?), which would make font-lock fontify comments inside.
This is not completely new. We have a similar problem for example with
TeX's math $...$ and with PostScript's strings (...(...)..).
> Or maybe a modifier on the string syntax?
My preference would be to think about it as a "multi-mode" case, and
hence make it possible to specify a different syntax-table to use within
the regexp.
I think of it along the lines of a new syntax-class, applied to the "/"
char, which would change the syntax-table for the subsequent text.
Stefan
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
Received: (at 16915) by debbugs.gnu.org; 4 Mar 2014 10:02:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 04 05:02:13 2014
Received: from localhost ([127.0.0.1]:49797 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WKmAu-0001it-Jk
for submit <at> debbugs.gnu.org; Tue, 04 Mar 2014 05:02:13 -0500
Received: from mail-ee0-f50.google.com ([74.125.83.50]:34937)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <bozhidar.batsov@HIDDEN>) id 1WKmAr-0001ik-80
for 16915 <at> debbugs.gnu.org; Tue, 04 Mar 2014 05:02:09 -0500
Received: by mail-ee0-f50.google.com with SMTP id c13so2662971eek.37
for <16915 <at> debbugs.gnu.org>; Tue, 04 Mar 2014 02:02:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=sender:date:from:to:cc:message-id:in-reply-to:references:subject
:mime-version:content-type;
bh=6t6OBzONZYrr+9JKUdM9wQ+YH6ldrQcFCwrOZo8U4SE=;
b=Q7lZ3YXZ2rY3LSJXCGtcf78AJQuoUk9ziZ4zzN1NRWrba3BFNOmPQzj3/hoJbx0y9R
ZhTnXvl5nFrINzAaTHP34ZKxta9bQkyYagEeSJMUGZfG2eVTa9AKdnB+IDQ6Wqc3lIHj
lsBn66KCZgZTMpnCyO2it1jn1dBoCzt4FIknIY9aRITJN2KqO1pTtYw11NgxFTlVWBgX
+5s/Q3Xk+0ZSiKEpHHh0i7NMLBv+iA/pfOzMgHwyz9AEjoWNfdQIHsBqlSHgV3rgd8Ta
Z6zYir6ZvIQmY3VJSSBMSjaajWsQ47uYk0Qx6fmf2CO5p+BQJOGfvcAVxtjTlLqHPCaG
XoZw==
X-Received: by 10.15.75.66 with SMTP id k42mr45759754eey.2.1393927328364;
Tue, 04 Mar 2014 02:02:08 -0800 (PST)
Received: from [192.168.1.28] ([95.87.231.111])
by mx.google.com with ESMTPSA id a2sm61247033eem.18.2014.03.04.02.02.06
for <multiple recipients>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Tue, 04 Mar 2014 02:02:07 -0800 (PST)
Date: Tue, 4 Mar 2014 12:02:06 +0200
From: Bozhidar Batsov <bozhidar@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <B2B12B1E1A33413390C0CCBF54CCBD66@HIDDEN>
In-Reply-To: <5313482E.3050706@HIDDEN>
References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN>
<CFD6EE423DDE468AAC847DE8772540BD@HIDDEN> <5313482E.3050706@HIDDEN>
Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using
the extended syntax are not font-locked properly
X-Mailer: sparrow 1.6.4 (build 1178)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="5315a49e_75a2a8d4_331"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 16915
Cc: 16915 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)
--5315a49e_75a2a8d4_331
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
On Sunday, March 2, 2014 at 5:03 PM, Dmitry Gutov wrote:
> On 02.03.2014 13:03, Bozhidar Batsov wrote:
> > Native regexp support is preferable IMO. After all - regexps are not
> > strings. If they were treated differently we=E2=80=99d also be able t=
o have
> > extra highlighting for things like named groups, quantifiers, regexp
> > classes, etc. I guess, however, that this would require a lot of work=
.
> > =20
> =20
> =20
> Since the regexp syntax can be different between languages, we probably=
=20
> won't get all of that automatically. The direct benefits from the nativ=
e =20
> support I can see is highlighting comments (for regexps with appropriat=
e =20
> modifiers, in languages that support that), new faces for regexp itself=
, =20
> and maybe for groups, quantifiers, etc.
> =20
> =20
That would be totally sufficient, but I have no idea how much work it wou=
ld require. =20
> =20
> The highlighting of the elements inside regexp would probably have to b=
e =20
> done the old-fashioned way, in font-lock-keywords (although that code =20
> could be shared between many languages). We could implement something =20
> like it right now, the main difference is just the lack of standard fac=
es.
> =20
> =20
Many modes introduce =22non-standard=E2=80=9D faces, so the lack of non-s=
tandard faces is not a significant problem I think (though I=E2=80=99d lo=
ve to see faces for regexps, command execution (%x, =60=60 as in sh-mode)=
and symbols/keywords (as they are present in many languages outside Ruby=
). =20
=20
--5315a49e_75a2a8d4_331
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div><span style=3D=22color: rgb(160, 160, 168);=22>On Su=
nday, March 2, 2014 at 5:03 PM, Dmitry Gutov wrote:</span></div>
<blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
<span><div><div><div>On 02.03.2014 13:03, Bozhidar Ba=
tsov wrote:</div><blockquote type=3D=22cite=22><div><div>Native regexp su=
pport is preferable IMO. After all - regexps are not</div><div>strings. I=
f they were treated differently we=E2=80=99d also be able to have</div><d=
iv>extra highlighting for things like named groups, quantifiers, regexp</=
div><div>classes, etc. I guess, however, that this would require a lot of=
work.</div></div></blockquote><div><br></div><div>Since the regexp synta=
x can be different between languages, we probably </div><div>won't get al=
l of that automatically. The direct benefits from the native </div><div>s=
upport I can see is highlighting comments (for regexps with appropriate <=
/div><div>modifiers, in languages that support that), new faces for regex=
p itself, </div><div>and maybe for groups, quantifiers, etc.</div></div><=
/div></span></blockquote><div><font face=3D=22Trebuchet MS=22>That would =
be totally sufficient, but I have no idea how much work it would require.=
</font> </div><blockquote type=3D=22cite=22 style=3D=22border-left-s=
tyle:solid;border-width:1px;margin-left:0px;padding-left:10px;=22><span><=
div><div><div><br></div><div>The highlighting of the elements inside rege=
xp would probably have to be </div><div>done the old-fashioned way, in fo=
nt-lock-keywords (although that code </div><div>could be shared between m=
any languages). We could implement something </div><div>like it right now=
, the main difference is just the lack of standard faces.</div></div></di=
v></span></blockquote><div>Many modes introduce =22non-standard=E2=80=9D =
faces, so the lack of non-standard faces is not a significant problem I t=
hink (though I=E2=80=99d love to see faces for regexps, command execution=
(%x, =60=60 as in sh-mode) and symbols/keywords (as they are present in =
many languages outside Ruby). </div><div> </div>
=20
<div>
<br>
</div>
--5315a49e_75a2a8d4_331--
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.Received: (at 16915) by debbugs.gnu.org; 2 Mar 2014 15:03:19 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 10:03:19 2014 Received: from localhost ([127.0.0.1]:48009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1WK7vD-0003F0-Cu for submit <at> debbugs.gnu.org; Sun, 02 Mar 2014 10:03:19 -0500 Received: from mail-ee0-f52.google.com ([74.125.83.52]:45412) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <raaahh@HIDDEN>) id 1WK7vA-0003Er-Cy for 16915 <at> debbugs.gnu.org; Sun, 02 Mar 2014 10:03:17 -0500 Received: by mail-ee0-f52.google.com with SMTP id e49so118974eek.25 for <16915 <at> debbugs.gnu.org>; Sun, 02 Mar 2014 07:03: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=PefMeEFBepiXbib3uFZ9WLmEPD24p9ZvuJ6gLbcl4/Q=; b=xWz6cpLXwMDf6RGl+VDK2gr7kJxJ0DEIpyj7EiXap/EK5/uYgUsaqNBKwhD7F7y5f6 L2y0baArB5N5O5WhYReoimdMnh64veVWHEU/iunx9GRVxe2aRyY9Zbuchon22/EuICx1 CVUNQQaTqyA7C7hu5M82fXYiytCVmFtGT21JN/Jol+wYNhsNG7Be5ht4RFC+ykgI6Cl7 1MGL4h2WC4/a9cbvuMs0vpUIX9C2JylnapICJdQ5bc99RzhqFXoVkTCa/PObhxwuWiyz PsXfElAEangk3K50xa6wXqIwc9HE6wt+17mEmM63EA13ZBusv2Am8VC6Tfm+vS+6V8Wa 1/vQ== X-Received: by 10.14.2.193 with SMTP id 41mr33276214eef.55.1393772595336; Sun, 02 Mar 2014 07:03:15 -0800 (PST) Received: from [192.168.10.2] ([93.109.195.252]) by mx.google.com with ESMTPSA id y51sm37522432eeu.0.2014.03.02.07.03.12 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Mar 2014 07:03:13 -0800 (PST) Message-ID: <5313482E.3050706@HIDDEN> Date: Sun, 02 Mar 2014 17:03:10 +0200 From: Dmitry Gutov <dgutov@HIDDEN> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Bozhidar Batsov <bozhidar@HIDDEN> Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN> <CFD6EE423DDE468AAC847DE8772540BD@HIDDEN> In-Reply-To: <CFD6EE423DDE468AAC847DE8772540BD@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16915 Cc: 16915 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 02.03.2014 13:03, Bozhidar Batsov wrote: > Native regexp support is preferable IMO. After all - regexps are not > strings. If they were treated differently we’d also be able to have > extra highlighting for things like named groups, quantifiers, regexp > classes, etc. I guess, however, that this would require a lot of work. Since the regexp syntax can be different between languages, we probably won't get all of that automatically. The direct benefits from the native support I can see is highlighting comments (for regexps with appropriate modifiers, in languages that support that), new faces for regexp itself, and maybe for groups, quantifiers, etc. The highlighting of the elements inside regexp would probably have to be done the old-fashioned way, in font-lock-keywords (although that code could be shared between many languages). We could implement something like it right now, the main difference is just the lack of standard faces.
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
Received: (at 16915) by debbugs.gnu.org; 2 Mar 2014 11:03:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 06:03:13 2014
Received: from localhost ([127.0.0.1]:47470 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WK4Aq-00048I-Dx
for submit <at> debbugs.gnu.org; Sun, 02 Mar 2014 06:03:12 -0500
Received: from mail-ea0-f171.google.com ([209.85.215.171]:57250)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <bozhidar.batsov@HIDDEN>) id 1WK4An-000486-V7
for 16915 <at> debbugs.gnu.org; Sun, 02 Mar 2014 06:03:10 -0500
Received: by mail-ea0-f171.google.com with SMTP id n15so2302173ead.30
for <16915 <at> debbugs.gnu.org>; Sun, 02 Mar 2014 03:03:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=sender:date:from:to:cc:message-id:in-reply-to:references:subject
:mime-version:content-type;
bh=SNyJ7SS5RqwnfRhBHyy4NDVE1SBP1HJWaTVRtuA51R4=;
b=xvKW5eaoWv6DEM9yiJ2DNVHhFUGMtDwuv50uIqUp8NNVbzbURP6Et9VbxyTM7WNulA
RuR/WVhILWSasm2U43gBaEqgwMm0pWWdgL/tXFZdgwnVnivypMGtMliaJr9KhyuGjgaI
RUtnK+DP2mq+Khl8SmZdO8Cutc+1eKLNK5TjdcmuvM+PJWhNxmI/TuI8e3h6IEqT0+mQ
OEmvaxbVIsECHZOIsjJ77L0D8ZDz2AyclnpttWRL/nqb1x6evubtxG8kjigF978mXcMe
BGjsjivVd9SRFFGWQQ6wzJTzjF0sAUA23nMp2IihXZX06NnSHQE00nzJKsUJdkPPzbLc
Qu5g==
X-Received: by 10.14.215.133 with SMTP id e5mr872814eep.103.1393758188833;
Sun, 02 Mar 2014 03:03:08 -0800 (PST)
Received: from [10.0.1.3] (93-152-182-45.ddns.onlinedirect.bg. [93.152.182.45])
by mx.google.com with ESMTPSA id m1sm35186810een.7.2014.03.02.03.03.07
for <multiple recipients>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Sun, 02 Mar 2014 03:03:08 -0800 (PST)
Date: Sun, 2 Mar 2014 13:03:14 +0200
From: Bozhidar Batsov <bozhidar@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <CFD6EE423DDE468AAC847DE8772540BD@HIDDEN>
In-Reply-To: <87y50to93u.fsf@HIDDEN>
References: <m2bnxqujtx.fsf@HIDDEN> <87y50to93u.fsf@HIDDEN>
Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using
the extended syntax are not font-locked properly
X-Mailer: sparrow 1.6.4 (build 1178)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="53130ff2_5c482a97_209"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 16915
Cc: 16915 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)
--53130ff2_5c482a97_209
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
On Sunday, March 2, 2014 at 12:19 AM, Dmitry Gutov wrote:
> Bozhidar Batsov <bozhidar=40batsov.com (mailto:bozhidar=40batsov.com)> =
writes:
> =20
> > In most editors/IDEs code like this
> > =20
> > regexp =3D /
> > start =23 some text
> > =5Cs =23 white space char
> > (group) =23 first group
> > (=3F:alt1=7Calt2) =23 some alternation
> > end
> > /x
> > =20
> > will have the comments font-locked as comments, because comments are
> > allowed in the extended regexp literal syntax (/x). It would be nice
> > if this was taken into account in ruby-mode as well.
> > =20
> =20
> =20
> Not sure how to implement it best.
> =20
> Ideally, we'd have a new kind of syntax instead of strings (native
> regexp support=3F), which would make font-lock fontify comments inside.=
> =20
> Or maybe a modifier on the string syntax=3F
Native regexp support is preferable IMO. After all - regexps are not stri=
ngs. If they were treated differently we=E2=80=99d also be able to have e=
xtra highlighting for things like named groups, quantifiers, regexp class=
es, etc. I guess, however, that this would require a lot of work.
> =20
> Of course, we could just scan the contents of every regexp, look for an=
y
> hash character that doesn't look like it starts interpolation, and
> forcibly fontify the text from it till the end of line.
> =20
> =20
--53130ff2_5c482a97_209
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div><span style=3D=22color: rgb(160, 160, 168);=22>On Su=
nday, March 2, 2014 at 12:19 AM, Dmitry Gutov wrote:</span></div>
<blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
<span><div><div><div>Bozhidar Batsov <<a href=3D=22=
mailto:bozhidar=40batsov.com=22>bozhidar=40batsov.com</a>> writes:</di=
v><div><br></div><blockquote type=3D=22cite=22><div><div>In most editors/=
IDEs code like this</div><div><br></div><div>regexp =3D /</div><div> sta=
rt =23 some text</div><div> =5Cs =23 white space char=
</div><div> (group) =23 first group</div><div> (=3F:alt1=7Calt2) =
=23 some alternation</div><div> end</div><div>/x</div><div><br></div><di=
v>will have the comments font-locked as comments, because comments are</d=
iv><div>allowed in the extended regexp literal syntax (/x). It would be n=
ice</div><div>if this was taken into account in ruby-mode as well.</div><=
/div></blockquote><div><br></div><div>Not sure how to implement it best.<=
/div><div><br></div><div>Ideally, we'd have a new kind of syntax instead =
of strings (native</div><div>regexp support=3F), which would make font-lo=
ck fontify comments inside.</div><div><br></div><div>Or maybe a modifier =
on the string syntax=3F</div></div></div></span></blockquote><div>Native =
regexp support is preferable IMO. After all - regexps are not strings. If=
they were treated differently we=E2=80=99d also be able to have extra hi=
ghlighting for things like named groups, quantifiers, regexp classes, etc=
. I guess, however, that this would require a lot of work.</div><blockquo=
te type=3D=22cite=22 style=3D=22border-left-style:solid;border-width:1px;=
margin-left:0px;padding-left:10px;=22><span><div><div><div><br></div><div=
>Of course, we could just scan the contents of every regexp, look for any=
</div><div>hash character that doesn't look like it starts interpolation,=
and</div><div>forcibly fontify the text from it till the end of line.</d=
iv></div></div></span>
=20
=20
=20
=20
</blockquote>
=20
<div>
<br>
</div>
--53130ff2_5c482a97_209--
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.Received: (at 16915) by debbugs.gnu.org; 1 Mar 2014 22:19:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 01 17:19:26 2014 Received: from localhost ([127.0.0.1]:47057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1WJsFh-0000Ec-Tg for submit <at> debbugs.gnu.org; Sat, 01 Mar 2014 17:19:26 -0500 Received: from mail-ee0-f53.google.com ([74.125.83.53]:35207) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <raaahh@HIDDEN>) id 1WJsFg-0000ET-3N for 16915 <at> debbugs.gnu.org; Sat, 01 Mar 2014 17:19:24 -0500 Received: by mail-ee0-f53.google.com with SMTP id e51so1997695eek.26 for <16915 <at> debbugs.gnu.org>; Sat, 01 Mar 2014 14:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=CnDKShOpLzOi3KmsGMVxA2aDR+Es7YmXRRlH91Zw0dk=; b=HrCjBuy8Ke4jzqX2Z7dUT10Za/kd5dfXfjgqiONwxP64etc8Kmzc0xcUI9PTg8S4zz J6KePkAv2KC09oDee9pQZf1YFIaFZctVYZoG0I1SLlIRq9i9mMoDaFU4aiuBVAqVgkix zbgVmc1VNsrnuwZrmpcDQEDCQkxGIkHiepEWV750BVDdj4eLSCklVIqYtnHSkKmKkWd/ 4k4Um5OzRUwx5ndYtGwHL0TspqHQV0LKE2f2BIcG54rPeOGyLVj147c4VmWGe7Xz3Mb0 T4+e+2lwaArXAeZvMLM9r1klD2cgSsq31FG9LVhWe3U4k7hZLokj4LKhhfdRws9PM354 jDZQ== X-Received: by 10.14.194.2 with SMTP id l2mr30060078een.39.1393712363394; Sat, 01 Mar 2014 14:19:23 -0800 (PST) Received: from axl ([93.109.195.252]) by mx.google.com with ESMTPSA id x45sm2739791eef.15.2014.03.01.14.19.21 for <multiple recipients> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 01 Mar 2014 14:19:22 -0800 (PST) From: Dmitry Gutov <dgutov@HIDDEN> To: Bozhidar Batsov <bozhidar@HIDDEN> Subject: Re: bug#16915: 24.3.50; [ruby-mode] Comments in regexps using the extended syntax are not font-locked properly References: <m2bnxqujtx.fsf@HIDDEN> Date: Sun, 02 Mar 2014 00:19:17 +0200 In-Reply-To: <m2bnxqujtx.fsf@HIDDEN> (Bozhidar Batsov's message of "Sat, 01 Mar 2014 15:31:06 +0200") Message-ID: <87y50to93u.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16915 Cc: 16915 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Bozhidar Batsov <bozhidar@HIDDEN> writes: > In most editors/IDEs code like this > > regexp = / > start # some text > \s # white space char > (group) # first group > (?:alt1|alt2) # some alternation > end > /x > > will have the comments font-locked as comments, because comments are > allowed in the extended regexp literal syntax (/x). It would be nice > if this was taken into account in ruby-mode as well. Not sure how to implement it best. Ideally, we'd have a new kind of syntax instead of strings (native regexp support?), which would make font-lock fontify comments inside. Or maybe a modifier on the string syntax? Of course, we could just scan the contents of every regexp, look for any hash character that doesn't look like it starts interpolation, and forcibly fontify the text from it till the end of line.
bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 1 Mar 2014 13:31:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 01 08:31:44 2014
Received: from localhost ([127.0.0.1]:45462 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1WJk11-0001DG-DQ
for submit <at> debbugs.gnu.org; Sat, 01 Mar 2014 08:31:44 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46588)
by debbugs.gnu.org with esmtp (Exim 4.80)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0w-0001D6-GW
for submit <at> debbugs.gnu.org; Sat, 01 Mar 2014 08:31:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0m-00009W-VU
for submit <at> debbugs.gnu.org; Sat, 01 Mar 2014 08:31:38 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level:
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:44664)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0i-00009D-IG
for submit <at> debbugs.gnu.org; Sat, 01 Mar 2014 08:31:28 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48139)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0b-0004pv-1x
for bug-gnu-emacs@HIDDEN; Sat, 01 Mar 2014 08:31:24 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0Q-0008TG-9t
for bug-gnu-emacs@HIDDEN; Sat, 01 Mar 2014 08:31:17 -0500
Received: from mail-ee0-f50.google.com ([74.125.83.50]:62244)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from <bozhidar@HIDDEN>) id 1WJk0Q-0008Sx-1u
for bug-gnu-emacs@HIDDEN; Sat, 01 Mar 2014 08:31:06 -0500
Received: by mail-ee0-f50.google.com with SMTP id c13so980595eek.9
for <bug-gnu-emacs@HIDDEN>; Sat, 01 Mar 2014 05:31:05 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:from:to:subject:date:message-id:mime-version
:content-type;
bh=h7J98/b+PTmagsB4WLvb8cIw6SSQufdX405+S74dJ1M=;
b=OXwyyXMR/GOkd630AxmxPLEEnN1tg0WAbVGYyS6XSu9G7GgP2r51uKJvKW76WCQ2l+
pTylwi5B4mjgqiSDQj/bRQAdtIvMRE5Gy7KtpXdfJk4n3WNtnYfJYar1ji1PN3fxoHIX
bxBtxh2hXZNG+JCLVvV1IXBHHuS4TsdExC/buaJSW7DcFCLqMunguEhZl5HJXZUs6V8X
8Rc79WazPo7k9fX2w2sm85P74MP+IumZjsV/rPoepEFM/83ECbPFKnu521G4GS+qE7le
XVUpEOSL4YjHOfHA7wK8NU4bl+x2dd6Hbt4v6YZKJFkStq90rZBa+z1yjHSEiZmhCAcc
H1XA==
X-Gm-Message-State: ALoCoQlK7sDd8rO3mPZ7SLBJKC3HMjMsaD0tqZ9uqnbHHZmgdHODJTEW4HJULDmK0ccwcYaUYkSe
X-Received: by 10.14.1.198 with SMTP id 46mr10234398eed.9.1393680665221;
Sat, 01 Mar 2014 05:31:05 -0800 (PST)
Received: from Bozhidars-MacBook-Pro.local ([95.87.231.111])
by mx.google.com with ESMTPSA id u6sm23573087eep.11.2014.03.01.05.31.03
for <bug-gnu-emacs@HIDDEN>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Sat, 01 Mar 2014 05:31:04 -0800 (PST)
Received: by Bozhidars-MacBook-Pro.local (Postfix, from userid 501)
id 28A7C83A1544; Sat, 1 Mar 2014 15:31:06 +0200 (EET)
From: Bozhidar Batsov <bozhidar@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50;
[ruby-mode] Comments in regexps using the extended syntax are not
font-locked properly
Date: Sat, 01 Mar 2014 15:31:06 +0200
Message-ID: <m2bnxqujtx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
[fuzzy]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
(bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)
In most editors/IDEs code like this
regexp = /
start # some text
\s # white space char
(group) # first group
(?:alt1|alt2) # some alternation
end
/x
will have the comments font-locked as comments, because comments are
allowed in the extended regexp literal syntax (/x). It would be nice
if this was taken into account in ruby-mode as well.
In GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
of 2014-01-27 on Bozhidars-MacBook-Pro.local
Windowing system distributor `Apple', version 10.3.1265
Configured using:
`configure --prefix=/usr/local/Cellar/emacs/HEAD --without-dbus
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs/HEAD/share/info/emacs
--without-gnutls --with-ns --disable-ns-self-contained'
Important settings:
locale-coding-system: utf-8-unix
Major mode: Ruby
Minor modes in effect:
ruby-tools-mode: t
inf-ruby-minor-mode: t
diff-auto-refine-mode: t
subword-mode: t
guru-mode: t
erc-truncate-mode: t
erc-spelling-mode: t
erc-list-mode: t
erc-menu-mode: t
erc-autojoin-mode: t
erc-ring-mode: t
erc-networks-mode: t
erc-pcomplete-mode: t
erc-track-mode: t
erc-match-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-stamp-mode: t
erc-netsplit-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
erc-move-to-prompt-mode: t
erc-readonly-mode: t
global-flycheck-mode: t
flycheck-mode: t
which-function-mode: t
flx-ido-mode: t
ido-ubiquitous-mode: t
winner-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
whitespace-mode: t
global-anzu-mode: t
anzu-mode: t
projectile-global-mode: t
projectile-mode: t
flyspell-mode: t
volatile-highlights-mode: t
global-hl-line-mode: t
shell-dirtrack-mode: t
recentf-mode: t
savehist-mode: t
show-smartparens-global-mode: t
show-smartparens-mode: t
smartparens-mode: t
global-auto-revert-mode: t
delete-selection-mode: t
prelude-global-mode: t
prelude-mode: t
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
size-indication-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
' d SPC s u g g e s t SPC t h e SPC u s e SPC o f SPC
t h e SPC ` <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> f SPC a SPC d i
f f e r e n t SPC f a c e SPC t h a n SPC t h e SPC
s t r i n g SPC f a c e SPC u s e d SPC o f <backspace>
<backspace> f o r SPC t h e SPC l i t e r a i l <backspace>
<backspace> l SPC i t s e l f , SPC b u t SPC e v e
n SPC i t SPC w o u l d SPC b e SPC a n SPC i m p r
o v e m e n t . SPC I SPC a s o <backspace> <backspace>
l s o SPC t h i n k <return> t h a t SPC o n l y SPC
v a l i d SPC m o d i f i e r s SPC s h o u l d SPC
b e SPC c <backspace> f o n t SPC l o c k e d . SPC
M-b M-b M-f C-d - C-x b <return> <return> % r / t e
s t / i <help-echo> C-x b <return> C-p C-p C-p C-p
C-p C-p C-p C-n C-p C-p C-a C-f C-d n C-n C-n C-e <return>
$ <backspace> % r { t e s t } i C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-n
C-n C-n C-n C-e C-c C-c y M-x r e p o r t <return>
Recent messages:
Wrote /Users/bozhidar/*message*-20140301-152412
Saving file /Users/bozhidar/projects/test.rb...
Wrote /Users/bozhidar/projects/test.rb
Auto-saving...done
Mark set
Send this bug report to the Emacs maintainers? (y or n) y
Sending...
Mark set [2 times]
Sending via mail...
Sending...done
Load-path shadows:
/Users/bozhidar/.emacs.d/elpa/tabulated-list-20120406.2251/tabulated-list hides /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/emacs-lisp/tabulated-list
Features:
(shadow sort mail-extr emacsbug vc-annotate vc vc-dispatcher nxml-uchnm
rng-xsd xsd-regexp rng-cmpct edebug crm ielm hippie-exp markdown-mode
noutline outline gitignore-mode conf-mode yaml-mode ace-jump-mode ffap
url-parse url-vars ruby-tools inf-ruby ruby-mode-expansions
smartparens-ruby ruby-mode smie misearch multi-isearch jka-compr
eieio-opt speedbar sb-image ezimage dframe mule-util find-dired
magit-key-mode magit view epa derived epg epg-config diff-mode
git-rebase-mode git-commit-mode server log-edit message sendmail rfc822
mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util
add-log executable vc-git lisp-mnt network-stream starttls tls cider
cider-mode cider-repl cider-eldoc clojure-test-mode cider-interaction
arc-mode archive-mode cider-client nrepl-client cider-util ewoc
superword subword clojure-mode-expansions clojure-mode inf-lisp
rainbow-mode color rainbow-delimiters elisp-slime-nav guru-mode
prelude-key-chord key-chord prelude-xml nxml-mode-expansions
html-mode-expansions sgml-mode smartparens-html rng-nxml rng-valid
rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn
nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc
xmltok prelude-web prelude-scss prelude-scheme prelude-ruby prelude-perl
prelude-org prelude-js prelude-erc erc-truncate erc-autoaway
erc-spelling erc-notify erc-log erc-list erc-menu erc-join erc-ring
erc-networks erc-pcomplete erc-track erc-match erc-button erc-fill
erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat
prelude-emacs-lisp prelude-css prelude-common-lisp slime-autoloads
prelude-clojure prelude-lisp prelude-c prelude-programming flycheck
help-mode rx f which-func imenu prelude-ido smex flx-ido flx
ido-ubiquitous warnings ido prelude-osx exec-path-from-shell
prelude-global-keybindings prelude-editor winner undo-tree diff esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell
esh-module esh-mode esh-util re-builder whitespace browse-kill-ring
midnight ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff dired-x dired anzu projectile pkg-info
find-func grep compile s bookmark pp expand-region text-mode-expansions
er-basic-expansions expand-region-core expand-region-custom flyspell
ispell etags volatile-highlights hl-line windmove tramp-cache tramp-sh
tramp tramp-compat auth-source gnus-util mm-util mail-prsvr
password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color
ring format-spec recentf tree-widget wid-edit savehist saveplace
diminish smartparens-config smartparens autorevert filenotify delsel
prelude-mode easy-mmode edmacro kmacro prelude-core epl advice help-fns
dash thingatpt prelude-ui zenburn-theme prelude-packages finder-inf
ack-and-a-half-autoloads diminish-autoloads erlang-autoloads
flx-ido-autoloads eieio byte-opt bytecomp byte-compile cconv eieio-core
grizzl-autoloads key-chord-autoloads logito-autoloads info easymenu
cl-macs gv move-text-autoloads pkg-info-autoloads puppet-mode-autoloads
rainbow-delimiters-autoloads request-autoloads rubocop-autoloads
volatile-highlights-autoloads yaml-mode-autoloads package cl cl-loaddefs
cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process cocoa ns
multi-tty emacs)
Bozhidar Batsov <bozhidar@HIDDEN>:bug-gnu-emacs@HIDDEN.
Full text available.bug-gnu-emacs@HIDDEN:bug#16915; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.