From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111958: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only Date: Sat, 09 Mar 2013 05:45:07 +0400 Message-ID: <513A9423.1000301@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1362793522 9875 80.91.229.3 (9 Mar 2013 01:45:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 01:45:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 09 02:45:47 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UE8r5-00060b-66 for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2013 02:45:47 +0100 Original-Received: from localhost ([::1]:48744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE8qj-0004gb-9X for ged-emacs-devel@m.gmane.org; Fri, 08 Mar 2013 20:45:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE8qZ-0004g9-VF for emacs-devel@gnu.org; Fri, 08 Mar 2013 20:45:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UE8qS-0003jk-DH for emacs-devel@gnu.org; Fri, 08 Mar 2013 20:45:15 -0500 Original-Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:38636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE8qS-0003jV-62 for emacs-devel@gnu.org; Fri, 08 Mar 2013 20:45:08 -0500 Original-Received: by mail-la0-f42.google.com with SMTP id fe20so2314637lab.1 for ; Fri, 08 Mar 2013 17:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=msp+1KbUEF7XJQbuKQHZD3IMW5bpv7SUhjNzp/0m3dg=; b=TkB2dCck4SuHrm2TTgYlh4jt32Yw195bWjnD0BngUyyLCsKC3kiEUnpU/GorpDJG30 EDbde0k/Pzp/Yf148dNaPM9AZ6RK9nqlY0ri/ZtEHGWOCVfTfKm8pxDW347qwu6Ovkjc WYl32TO4SgMAy0A4ux54jzGEnmlsoC1Z4oXE0N+SlnUKLhCcIp95IieQ4JjYENeqzWoP L0N3DO4XUaj7WwDOyb21l/A5IHza/L+bWlvrIzdch/en18m/6J0pjxUba4i6tQPzBfn4 F/UgbFgAoHlOqRLaVQlu+svlq6LXeHRDeB8UE51Or3QGCiz4ucEPNLDhE35hSVZymg9q fTrw== X-Received: by 10.112.47.41 with SMTP id a9mr1786654lbn.134.1362793506891; Fri, 08 Mar 2013 17:45:06 -0800 (PST) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id iq6sm3437934lab.10.2013.03.08.17.45.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Mar 2013 17:45:05 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: X-Antivirus: avast! (VPS 130308-1, 09.03.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157636 Archived-At: On 09.03.2013 5:41, Stefan Monnier wrote: >> ;; The regular expression itself. >> "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)") >> - (2 (string-to-syntax "\"/")) >> - (3 (string-to-syntax "\"/"))) >> + (3 (unless (nth 3 (syntax-ppss (match-beginning 2))) >> + (put-text-property (match-beginning 2) (match-end 2) >> + 'syntax-table (string-to-syntax "\"/")) >> + (string-to-syntax "\"/")))) > > If match n°2 is not inside a string, I think we should not skip all > that's matched by the regexp (since it's not a string and may hence > contain other things that need to be syntax-propertized). I.e. The > `unless' should be turned into an `if' and in the non-string case it > should move point back to (match-end 2). `syntax-ppss' moves point, so that's taken care of. See the second test in the same commit. I agree that that's not obvious from reading the code, though.