From unknown Sat Jun 21 10:45:08 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5757: 23.1; String literal parse problem in ruby-mode Resent-From: Rhett Sutphin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Mar 2010 16:23:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-GNU-PR-Message: report 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 5757@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.126936137528098 (code B ref -1); Tue, 23 Mar 2010 16:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Mar 2010 16:22:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nu6sY-0007J9-LV for submit@debbugs.gnu.org; Tue, 23 Mar 2010 12:22:54 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nu6r4-0007IK-Mr for submit@debbugs.gnu.org; Tue, 23 Mar 2010 12:21:23 -0400 Received: from lists.gnu.org ([199.232.76.165]:45433) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nu6qz-00076H-Rn for submit@debbugs.gnu.org; Tue, 23 Mar 2010 12:21:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu6qz-0001QH-0A for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2010 12:21:17 -0400 Received: from [140.186.70.92] (port=59471 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu6qw-0001Op-WC for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2010 12:21:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) 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.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nu6qu-0001o0-Gw for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2010 12:21:14 -0400 Received: from mailp4.ci.northwestern.edu ([129.105.16.84]:42078) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nu6qu-0001no-D3 for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2010 12:21:12 -0400 Received: from dhcp-165-124-223-167.nubic.northwestern.edu (dhcp-165-124-223-167.nubic.northwestern.edu [165.124.223.167]) by mailp4.ci.northwestern.edu (Postfix) with ESMTP id 30D8676DD2 for ; Tue, 23 Mar 2010 11:21:11 -0500 (CDT) Message-Id: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> From: Rhett Sutphin Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Tue, 23 Mar 2010 11:21:10 -0500 X-Mailer: Apple Mail (2.936) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Tue, 23 Mar 2010 12:22:53 -0400 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.6 (------) ruby-mode will misunderstand a ruby double-quoted string literal which contains a single quote and ends with a question mark. It thinks that the string literal is unterminated, which contaminates the syntax highlighting for the remainder of the buffer. Example ruby code which will demonstrate the problem: ["Is 'this' a string?"], [:something, :else] If there's anything between the question mark and the terminating double-quote, the string will be correctly interpreted. Thanks, Rhett Sutphin rhett@detailedbalance.net In GNU Emacs 23.1.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2009-08-16 on black.local Windowing system distributor `Apple', version 10.3.949 configured using `configure '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Ruby Minor modes in effect: yas/global-mode: t yas/minor-mode: t auto-fill-function: do-auto-fill global-auto-revert-mode: t hi-lock-mode: t shell-dirtrack-mode: t hl-line-mode: t global-linum-mode: t linum-mode: t show-paren-mode: t nxhtml-global-minor-mode: t recentf-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: ' " ' , SPC [ : a ] ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' " ? ? M-x r e p o r t - e m Recent messages: Auto-saving...done Quit Mark set Undo! [6 times] Quit Auto-saving...done Making completion list... Quit ruby-indent-to: invalid nest [2 times] call-interactively: End of buffer From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: The line which causes the bug is 1185 References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> In-Reply-To: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> Resent-From: =?UTF-8?Q?P=C3=A5l?= de Vibe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Mar 2011 22:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.130152354315010 (code B ref 5757); Wed, 30 Mar 2011 22:20:02 +0000 Received: (at 5757) by debbugs.gnu.org; 30 Mar 2011 22:19:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q53jC-0003u3-CW for submit@debbugs.gnu.org; Wed, 30 Mar 2011 18:19:02 -0400 Received: from nm15.bullet.mail.ukl.yahoo.com ([217.146.183.189]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q53Z9-0003fI-4b for 5757@debbugs.gnu.org; Wed, 30 Mar 2011 18:08:40 -0400 Received: from [217.146.183.210] by nm15.bullet.mail.ukl.yahoo.com with NNFMP; 30 Mar 2011 22:08:33 -0000 Received: from [217.146.183.160] by tm3.bullet.mail.ukl.yahoo.com with NNFMP; 30 Mar 2011 22:08:33 -0000 Received: from [127.0.0.1] by omp1001.mail.ukl.yahoo.com with NNFMP; 30 Mar 2011 22:08:33 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 271440.66924.bm@omp1001.mail.ukl.yahoo.com Received: (qmail 57776 invoked by uid 60001); 30 Mar 2011 22:08:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.no; s=s1024; t=1301522913; bh=9OITTPjvYHjVzQG92XHuheq2b6LQeOumrZ3fr7xHb4E=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=G9SXAWdR/PA4qIS9s8Ad1CUIKnA/GoRBf7R/ehtVPxslahYEih/g3nRahkOjZL1pFPI4kCSx4rpjP4ossBVkqW0EktOVON5APOmdb+rGHSJRTfVIN4CnF1uH+GDiSn+3Td5z+3PIsGzgahYrFmjXbMnpBJM1M7Q4KG0BPXNf/34= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.no; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=5OGNeJ7JnGhKErRyoB9hPpQ6v0/FZPy2HMBYrXxIooi7xXOvuboj26Bu94N6eZ+6jzny7jRSTZvfbzP6UjuAzHXiWeIXuDihhQD91QLGFwcHMxxhroQxnbPpClVWXPa6fR2iXhBn3DFur+a3LDKDnp3YFOYmNNO2LG2B/Qc2FQg=; Message-ID: <139083.40321.qm@web28507.mail.ukl.yahoo.com> X-YMail-OSG: caidMKEVM1nKE5hWeXY98sv1Xq7GnudKJx6hHi1VI2O8Wbh dUmJLmXOUdLdUmogOtk4Qgp0vHLgQnUHiYuv7N.W6skr_nYuwW4Wc5xTaRqV S4CnVUdGI.4DPMAsHarKI.CI3Cd7kjeiC8Hy6uY5E8vAXh5PXuMc5qcQn.7S 3neCgpTyHmMUSVH4yC6bQwmrkLuHBisQs7.DQjCeCdS3K1viTaabhqbf16VD Vpqqh9Em743kKGV3zkM3ZIv9HYH1Dbjv52_Aj83asLAXqVZmkatBkt092XF7 Md1b2jzYFdzZkHWzhTPbMbI0TZnP1e7uFUhrocXJselW6o6vZ7aHW7bqW8mN QMpbZ3fKYDVoldy3S6exiWdZvsuB_Xy0- Received: from [201.211.169.94] by web28507.mail.ukl.yahoo.com via HTTP; Wed, 30 Mar 2011 23:08:33 BST X-Mailer: YahooMailRC/559 YahooMailWebService/0.8.109.295617 Date: Wed, 30 Mar 2011 23:08:33 +0100 (BST) From: =?UTF-8?Q?P=C3=A5l?= de Vibe MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1131313677-1301522913=:40321" X-Spam-Score: -2.6 (--) X-Mailman-Approved-At: Wed, 30 Mar 2011 18:19:00 -0400 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.6 (--) --0-1131313677-1301522913=:40321 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Line 1185:=0A ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)"= 3 (1 . nil))=0A=0AA workaround (with, to me, uknown consequences) is to re= move the question mark =0Afrom the line, like this:=0A=0A ("\\(^\\= |[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil)) --0-1131313677-1301522913=:40321 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Line 1185:
     &n= bsp;    ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1= . nil))

A workaround (with, to me, uknown c= onsequences) is to remove the question mark from the line, like this:
=

          ("\\(^\= \|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil))
=
=0A=0A=0A
--0-1131313677-1301522913=:40321-- From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: String literal parse problem in ruby-mode Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2011 00:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Nobuyoshi Nakada Cc: =?UTF-8?Q?P=C3=A5l?= de Vibe , 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.130179182123308 (code B ref 5757); Sun, 03 Apr 2011 00:51:01 +0000 Received: (at 5757) by debbugs.gnu.org; 3 Apr 2011 00:50:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6BWH-00063t-0n for submit@debbugs.gnu.org; Sat, 02 Apr 2011 20:50:21 -0400 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6BWF-00063d-AD for 5757@debbugs.gnu.org; Sat, 02 Apr 2011 20:50:19 -0400 Received: from furball ([64.134.67.135]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p330oAoa021317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 2 Apr 2011 20:50:11 -0400 Received: by furball (Postfix, from userid 1000) id B973A1603EB; Sat, 2 Apr 2011 20:50:11 -0400 (EDT) From: Chong Yidong References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> Date: Sat, 02 Apr 2011 20:50:11 -0400 In-Reply-To: <139083.40321.qm@web28507.mail.ukl.yahoo.com> ("=?UTF-8?Q?P=C3=A5l?= de Vibe"'s message of "Wed, 30 Mar 2011 23:08:33 +0100 (BST)") Message-ID: <87k4fcma4c.fsf_-_@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.6 (--) 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.6 (--) Hi Nakada-san, Could you help review P=C3=A5l de Vibe's proposed fix to the following problem in Emacs ruby-mode? Thanks. P=C3=A5l de Vibe writes: >> ruby-mode will misunderstand a ruby double-quoted string literal which >> contains a single quote and ends with a question mark. It thinks that >> the string literal is unterminated, which contaminates the syntax >> highlighting for the remainder of the buffer. >> >> Example ruby code which will demonstrate the problem: >> >> ["Is 'this' a string?"], [:something, :else] >> >> If there's anything between the question mark and the terminating >> double-quote, the string will be correctly interpreted. > > Line 1185: > ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) > > A workaround (with, to me, uknown consequences) is to remove the > question mark from the line, like this: > > ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil)) From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: String literal parse problem in ruby-mode Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Apr 2011 13:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chong Yidong Cc: =?UTF-8?Q?P=C3=A5l?= de Vibe , Nobuyoshi Nakada , 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.13019252348258 (code B ref 5757); Mon, 04 Apr 2011 13:54:01 +0000 Received: (at 5757) by debbugs.gnu.org; 4 Apr 2011 13:53:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kE6-000299-Bh for submit@debbugs.gnu.org; Mon, 04 Apr 2011 09:53:54 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kE3-00028s-Op for 5757@debbugs.gnu.org; Mon, 04 Apr 2011 09:53:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAB/NmU1Ld/Y6/2dsb2JhbAClXniIebcGhWsElC+CEA X-IronPort-AV: E=Sophos;i="4.63,297,1299474000"; d="scan'208";a="103071395" Received: from 75-119-246-58.dsl.teksavvy.com (HELO pastel.home) ([75.119.246.58]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 04 Apr 2011 09:53:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id A553658DF1; Mon, 4 Apr 2011 09:53:45 -0400 (EDT) From: Stefan Monnier Message-ID: References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> <87k4fcma4c.fsf_-_@stupidchicken.com> Date: Mon, 04 Apr 2011 09:53:45 -0400 In-Reply-To: <87k4fcma4c.fsf_-_@stupidchicken.com> (Chong Yidong's message of "Sat, 02 Apr 2011 20:50:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.1 (--) 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.1 (--) > Could you help review P=E5l de Vibe's proposed fix to the following > problem in Emacs ruby-mode? Thanks. His proposed fix is not correct: in ruby (like in Elisp) ? is used for chars (including ?' and ?") and $' and $" are also special vars, so his fix just disables the special treatment of ?. For Emacs-24, we use a different chunk of code which doesn't suffer from this problem (mostly calling syntax-ppss to determine if we're inside a string). Stefan > P=E5l de Vibe writes: >>> ruby-mode will misunderstand a ruby double-quoted string literal which >>> contains a single quote and ends with a question mark. It thinks that >>> the string literal is unterminated, which contaminates the syntax >>> highlighting for the remainder of the buffer. >>>=20 >>> Example ruby code which will demonstrate the problem: >>>=20 >>> ["Is 'this' a string?"], [:something, :else] >>>=20 >>> If there's anything between the question mark and the terminating >>> double-quote, the string will be correctly interpreted. >>=20 >> Line 1185: >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) >>=20 >> A workaround (with, to me, uknown consequences) is to remove the >> question mark from the line, like this: >>=20 >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil)) From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: String literal parse problem in ruby-mode Resent-From: =?UTF-8?Q?P=C3=A5l?= de Vibe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Apr 2011 13:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Chong Yidong , Nobuyoshi Nakada , 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.13019253358553 (code B ref 5757); Mon, 04 Apr 2011 13:56:02 +0000 Received: (at 5757) by debbugs.gnu.org; 4 Apr 2011 13:55:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kFi-0002Du-K8 for submit@debbugs.gnu.org; Mon, 04 Apr 2011 09:55:34 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kFf-0002Dj-Ao for 5757@debbugs.gnu.org; Mon, 04 Apr 2011 09:55:32 -0400 Received: by wyb29 with SMTP id 29so4583638wyb.3 for <5757@debbugs.gnu.org>; Mon, 04 Apr 2011 06:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=MR62ybPMbSu2NGrh4bxKzfgSbnTZvm3lGlaBeoNsamc=; b=iGdubOc9u93zJdqvdx+S5R+aosb5B7UrI5wFtMFN+MkKSIjQg2CYHHyPSGJxhbz2Lp 2sETKdJ5VwcPV+GCL+EiTSbuGVp5Y0e/CXHNmU2BndkhN7kTrV5dLStp/TyquWwRulQz 8G8rZjIvFXHnlMZWXeTjd1AYbMqX4XIv0XT34= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=DRoPhcBDUTdwYkYJgn0WQInUj+maqwnwAuOwVLF7zWFtCBvGwWxAMjpGEaUHEXwqYD CvbvBas5smyUkZBZC4mfD1WpXCL/fzrZ0mLftjjqorMmyhV3laSzaTbCd9Eo+z9NnVd5 RsWz4jf5fN2jZMlkuIH728WaR7grqEDJfsuYI= MIME-Version: 1.0 Received: by 10.216.182.20 with SMTP id n20mr537232wem.113.1301925325635; Mon, 04 Apr 2011 06:55:25 -0700 (PDT) Received: by 10.216.155.82 with HTTP; Mon, 4 Apr 2011 06:55:25 -0700 (PDT) In-Reply-To: References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> <87k4fcma4c.fsf_-_@stupidchicken.com> Date: Mon, 4 Apr 2011 09:25:25 -0430 X-Google-Sender-Auth: dkKOV8ZEhUZjiOWxCMr4-xTs3mQ Message-ID: From: =?UTF-8?Q?P=C3=A5l?= de Vibe Content-Type: multipart/alternative; boundary=0016364267718f004104a0181c18 X-Spam-Score: -3.6 (---) 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: -3.6 (---) --0016364267718f004104a0181c18 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi. This wasn't really a proposed fix but more a hint to help debugging. I haven't had time to really study the code. Thanks for the feedback. On Mon, Apr 4, 2011 at 9:23 AM, Stefan Monnier wr= ote: > > Could you help review P=E5l de Vibe's proposed fix to the following > > problem in Emacs ruby-mode? Thanks. > > His proposed fix is not correct: in ruby (like in Elisp) ? is used > for chars (including ?' and ?") and $' and $" are also special vars, so > his fix just disables the special treatment of ?. > For Emacs-24, we use a different chunk of code which doesn't suffer from > this problem (mostly calling syntax-ppss to determine if we're inside > a string). > > > Stefan > > > > P=E5l de Vibe writes: > > >>> ruby-mode will misunderstand a ruby double-quoted string literal whic= h > >>> contains a single quote and ends with a question mark. It thinks tha= t > >>> the string literal is unterminated, which contaminates the syntax > >>> highlighting for the remainder of the buffer. > >>> > >>> Example ruby code which will demonstrate the problem: > >>> > >>> ["Is 'this' a string?"], [:something, :else] > >>> > >>> If there's anything between the question mark and the terminating > >>> double-quote, the string will be correctly interpreted. > >> > >> Line 1185: > >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) > >> > >> A workaround (with, to me, uknown consequences) is to remove the > >> question mark from the line, like this: > >> > >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil)) > > > > --0016364267718f004104a0181c18 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi. This wasn't really a proposed fix but more a hint to help debugging= . I haven't had time to really study the code. Thanks for the feedback.=

On Mon, Apr 4, 2011 at 9:23 AM, Stefan M= onnier <mo= nnier@iro.umontreal.ca> wrote:
> Could you help revie= w P=E5l de Vibe's proposed fix to the following
> problem in Emacs ruby-mode? =A0Thanks.

His proposed fix is not correct: in ruby (like in Elisp) ?<char>= ; is used
for chars (including ?' and ?") and $' and $" are also sp= ecial vars, so
his fix just disables the special treatment of ?.
For Emacs-24, we use a different chunk of code which doesn't suffer fro= m
this problem (mostly calling syntax-ppss to determine if we're inside a string).


=A0 =A0 =A0 =A0Stefan


> P=E5l de Vibe <pauldevibe@ya= hoo.no> writes:

>>> ruby-mode will misunderstand a ruby double-quoted string liter= al which
>>> contains a single quote and ends with a question mark. =A0It t= hinks that
>>> the string literal is unterminated, which contaminates the syn= tax
>>> highlighting for the remainder of the buffer.
>>>
>>> Example ruby code which will demonstrate the problem:
>>>
>>> ["Is 'this' a string?"], [:something, :else]=
>>>
>>> If there's anything between the question mark and the term= inating
>>> double-quote, the string will be correctly interpreted.
>>
>> Line 1185:
>> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)&= quot; 3 (1 . nil))
>>
>> A workaround (with, to me, uknown consequences) is to remove the >> question mark from the line, like this:
>>
>> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)&q= uot; 3 (1 . nil))




--0016364267718f004104a0181c18-- From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: String literal parse problem in ruby-mode Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Apr 2011 20:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: =?UTF-8?Q?P=C3=A5l?= de Vibe , Nobuyoshi Nakada , 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.130238125815098 (code B ref 5757); Sat, 09 Apr 2011 20:35:02 +0000 Received: (at 5757) by debbugs.gnu.org; 9 Apr 2011 20:34:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8erK-0003vT-7M for submit@debbugs.gnu.org; Sat, 09 Apr 2011 16:34:18 -0400 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8erJ-0003vH-1Q for 5757@debbugs.gnu.org; Sat, 09 Apr 2011 16:34:17 -0400 Received: from furball ([64.134.240.70]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p39KYA3d023930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 9 Apr 2011 16:34:11 -0400 Received: by furball (Postfix, from userid 1000) id 164531602E5; Sat, 9 Apr 2011 16:34:11 -0400 (EDT) From: Chong Yidong References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> <87k4fcma4c.fsf_-_@stupidchicken.com> Date: Sat, 09 Apr 2011 16:34:10 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 04 Apr 2011 09:53:45 -0400") Message-ID: <87ipunnozh.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.6 (--) 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.6 (--) Stefan Monnier writes: > His proposed fix is not correct: in ruby (like in Elisp) ? is used > for chars (including ?' and ?") and $' and $" are also special vars, so > his fix just disables the special treatment of ?. > For Emacs-24, we use a different chunk of code which doesn't suffer from > this problem (mostly calling syntax-ppss to determine if we're inside > a string). Is this worth backporting to Emacs 23? If not, let's close this bug. From unknown Sat Jun 21 10:45:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5757: String literal parse problem in ruby-mode Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Apr 2011 03:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chong Yidong Cc: =?UTF-8?Q?P=C3=A5l?= de Vibe , Nobuyoshi Nakada , 5757@debbugs.gnu.org Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.13025785912092 (code B ref 5757); Tue, 12 Apr 2011 03:24:02 +0000 Received: (at 5757) by debbugs.gnu.org; 12 Apr 2011 03:23:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9UC7-0000Xh-BF for submit@debbugs.gnu.org; Mon, 11 Apr 2011 23:23:11 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9UC5-0000XV-SM for 5757@debbugs.gnu.org; Mon, 11 Apr 2011 23:23:10 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p3C3OMun014988; Mon, 11 Apr 2011 23:24:23 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 72463660EF; Mon, 11 Apr 2011 23:16:38 -0400 (EDT) From: Stefan Monnier Message-ID: References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> <87k4fcma4c.fsf_-_@stupidchicken.com> <87ipunnozh.fsf@stupidchicken.com> Date: Tue, 12 Apr 2011 00:16:38 -0300 In-Reply-To: <87ipunnozh.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 09 Apr 2011 16:34:10 -0400") 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-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3824=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3824> : streams <620207> : uri <848736> X-Spam-Score: -2.0 (--) 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 (--) >> His proposed fix is not correct: in ruby (like in Elisp) ? is used >> for chars (including ?' and ?") and $' and $" are also special vars, so >> his fix just disables the special treatment of ?. >> For Emacs-24, we use a different chunk of code which doesn't suffer from >> this problem (mostly calling syntax-ppss to determine if we're inside >> a string). > Is this worth backporting to Emacs 23? If not, let's close this bug. I think it's more important to keep in touch with the upstream maintainers. E.g. I still haven't heard anything from them regarding the changes I've made for syntax-propertize (which happen to fix the OP's problem). I'm worried we might not stay in sync. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 16:00:26 2011 Received: (at control) by debbugs.gnu.org; 28 May 2011 20:00:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQPgQ-0005Nb-B9 for submit@debbugs.gnu.org; Sat, 28 May 2011 16:00:26 -0400 Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQPgN-0005NR-G3 for control@debbugs.gnu.org; Sat, 28 May 2011 16:00:24 -0400 Received: from furball (c-71-192-165-84.hsd1.ct.comcast.net [71.192.165.84]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p4SK0HDZ029660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 28 May 2011 16:00:18 -0400 Received: by furball (Postfix, from userid 1000) id 7176516031F; Sat, 28 May 2011 16:00:17 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 5757 Date: Sat, 28 May 2011 16:00:17 -0400 Message-ID: <87zkm638a6.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control 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.6 (--) close 5757 thanks