From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#25529: diagnosis and one approach to a fix Date: Sat, 11 Feb 2017 08:27:04 -0700 Message-ID: <8737fk694n.fsf@tromey.com> References: <87wpd58ag6.fsf@tromey.com> <87shnt89be.fsf@tromey.com> <87o9yg8qdi.fsf@tromey.com> <87k2948onb.fsf@tromey.com> <183374a4-6469-44af-6ae6-fec02874547a@yandex.ru> <87bmuf8c1l.fsf@tromey.com> <87vash5wag.fsf@tromey.com> <87r3355q2r.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486826892 18187 195.159.176.226 (11 Feb 2017 15:28:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Feb 2017 15:28:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux) Cc: Tom Tromey , 25529@debbugs.gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 11 16:28:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccZan-0004Kb-7j for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Feb 2017 16:28:05 +0100 Original-Received: from localhost ([::1]:48687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccZas-0001S0-VE for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Feb 2017 10:28:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccZan-0001Rt-GD for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 10:28:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccZak-00039N-C7 for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 10:28:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37632) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ccZak-00039I-8E for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 10:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ccZaj-0004ud-Vn for bug-gnu-emacs@gnu.org; Sat, 11 Feb 2017 10:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Feb 2017 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25529 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25529-submit@debbugs.gnu.org id=B25529.148682685418849 (code B ref 25529); Sat, 11 Feb 2017 15:28:01 +0000 Original-Received: (at 25529) by debbugs.gnu.org; 11 Feb 2017 15:27:34 +0000 Original-Received: from localhost ([127.0.0.1]:35831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccZaI-0004tw-6z for submit@debbugs.gnu.org; Sat, 11 Feb 2017 10:27:34 -0500 Original-Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:43440) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ccZaG-0004tk-BK for 25529@debbugs.gnu.org; Sat, 11 Feb 2017 10:27:32 -0500 Original-Received: (qmail 17841 invoked by uid 0); 11 Feb 2017 15:27:16 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy7.mail.unifiedlayer.com with SMTP; 11 Feb 2017 15:27:16 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id jTTA1u00V2f2jeq01TTD3T; Sat, 11 Feb 2017 08:27:16 -0700 X-Authority-Analysis: v=2.1 cv=H5NInYoi c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=n2v9WMKugxEA:10 a=EH5AKhaK2ebAwYdbQ1UA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jkaOqvtRQsfNXv/u3NCZjrocg6C+/0hzB9Lhm4QvKqo=; b=q0oFP8ZoziW6fLW6pDNcB9DF6V KdjD3bpfqplygbVTVI2qLBa5+J+62K+eVhcbn2uv+d7GT6cdbSDTysmDdxu/joLe0yB4IodLmzwUM Ycy5UReXA9qljrsWvjOZ1Cgmn; Original-Received: from 75-171-188-196.hlrn.qwest.net ([75.171.188.196]:49964 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1ccZZu-00074I-94; Sat, 11 Feb 2017 08:27:10 -0700 X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Fri, 10 Feb 2017 23:22:23 -0500") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.171.188.196 X-Exim-ID: 1ccZZu-00074I-94 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-171-188-196.hlrn.qwest.net (bapiya) [75.171.188.196]:49964 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:129244 Archived-At: >> I thought it was ok because the region is always extended to the end of >> the line, and I think this regexp can't span lines. Stefan> Why come up with complex semantic arguments when a simple `max` ensures Stefan> the right behavior regardless of other assumptions? I had already done it, so inertia. I'm making the change, but I think the fix has to look like this: (when (and (looking-at js--syntax-propertize-regexp-regexp) ;; Don't touch text after END. (<= (match-end 1) end)) (put-text-property (match-beginning 1) (match-end 1) 'syntax-table (string-to-syntax "\"/")) (goto-char (match-end 0)))))) ... the reason being, in the new regexp match #1 is just the terminating "/", which is the only character whose syntax we want to modify here. Let me know what you think. Tom