From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 12:42:56 2011 Received: (at submit) by debbugs.gnu.org; 21 Jan 2011 17:42:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgL0h-0006YB-De for submit@debbugs.gnu.org; Fri, 21 Jan 2011 12:42:55 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgL0f-0006Xy-7W for submit@debbugs.gnu.org; Fri, 21 Jan 2011 12:42:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgL8I-0003PJ-Tv for submit@debbugs.gnu.org; Fri, 21 Jan 2011 12:50:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:47065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgL8I-0003P0-DE for submit@debbugs.gnu.org; Fri, 21 Jan 2011 12:50:46 -0500 Received: from [140.186.70.92] (port=49743 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgL8D-0001uM-Op for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 12:50:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgL88-0003O6-78 for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 12:50:38 -0500 Received: from anne.math.ntnu.no ([129.241.15.150]:55370) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PgL87-0003EN-PH for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 12:50:36 -0500 Received: (qmail 7630 invoked from network); 21 Jan 2011 17:50:30 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.102) by anne.math.ntnu.no with ESMTPA; 21 Jan 2011 17:50:30 -0000 Date: Fri, 21 Jan 2011 18:50:29 +0100 (CET) Message-Id: <20110121.185029.1304555966254424651.hanche@math.ntnu.no> To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Bad regexp for javascript regexps From: Harald Hanche-Olsen X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.3.50 on Emacs 24.0.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Put the following four line code snippet in a new buffer: replace(/\\/g,something); // Now we're in trouble: // Still in trouble. // And all's well again. and activate js-mode and font-lock-mode. The syntax colouring is now off: The code starting with the first slash on the first line and ending with the first slash on the second line is coloured as a regexp; now the syntax highlighter is unaware that we are in a comment, and reads the single quote as the start of a string. After the second single quote things return to normal. The problem seems to lie with the constant js--regexp-literal declared in js.el, as this regexp does not treat backslashes with sufficient care. In GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.5.0, NS apple-appkit-1038.35) of 2010-12-27 on mack Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns'' - Harald From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 15:42:30 2011 Received: (at 7882-done) by debbugs.gnu.org; 21 Jan 2011 20:42:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgNoU-0002kJ-Cf for submit@debbugs.gnu.org; Fri, 21 Jan 2011 15:42:30 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgNoO-0002jz-Kx for 7882-done@debbugs.gnu.org; Fri, 21 Jan 2011 15:42:28 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p0LKofuR012437; Fri, 21 Jan 2011 15:50:41 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 47BB7B411E; Fri, 21 Jan 2011 15:50:17 -0500 (EST) From: Stefan Monnier To: Harald Hanche-Olsen Subject: Re: bug#7882: 24.0.50; Bad regexp for javascript regexps Message-ID: References: <20110121.185029.1304555966254424651.hanche@math.ntnu.no> Date: Fri, 21 Jan 2011 15:50:17 -0500 In-Reply-To: <20110121.185029.1304555966254424651.hanche@math.ntnu.no> (Harald Hanche-Olsen's message of "Fri, 21 Jan 2011 18:50:29 +0100 (CET)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3735=0 X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7882-done Cc: 7882-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > replace(/\\/g,something); Thanks, I've installed the patch below into the emacs-23 branch which should fix this problem. The highlighting is not reliable when the regexp spans multiple lines, tho, so I wonder: are multi-line regexps valid? common? important? Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 16:08:39 2011 Received: (at 7882) by debbugs.gnu.org; 21 Jan 2011 21:08:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgODm-0003J9-C5 for submit@debbugs.gnu.org; Fri, 21 Jan 2011 16:08:39 -0500 Received: from anne.math.ntnu.no ([129.241.15.150]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PgODj-0003Iw-Bd for 7882@debbugs.gnu.org; Fri, 21 Jan 2011 16:08:36 -0500 Received: (qmail 2772 invoked from network); 21 Jan 2011 21:16:29 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.102) by anne.math.ntnu.no with ESMTPA; 21 Jan 2011 21:16:29 -0000 Date: Fri, 21 Jan 2011 22:16:28 +0100 (CET) Message-Id: <20110121.221628.1271751938436426242.hanche@math.ntnu.no> To: 7882@debbugs.gnu.org, help-debbugs@gnu.org Subject: Re: bug#7882: closed From: Harald Hanche-Olsen In-Reply-To: References: <20110121.185029.1304555966254424651.hanche@math.ntnu.no> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.3.50 on Emacs 24.0.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 7882 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.0 (----) I have no idea how common or important multiline regexps are in javascript. As far as I am concerned, if it's difficult to match them reliably, maybe one shouldn't even try. Though that has its own dangers: Namely, stuff inside an unmatched regexp triggering inappropriate syntax highlighting. So perhaps we should stick with doing the best we can, anyhow. - Harald From unknown Tue Aug 19 05:09:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Feb 2011 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator