From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7735: A questing mark at the end of a string in ruby-mode Date: Mon, 24 Jan 2011 14:49:35 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295898912 28445 80.91.229.12 (24 Jan 2011 19:55:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 24 Jan 2011 19:55:12 +0000 (UTC) Cc: 7735@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 24 20:55:07 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PhSVH-0004xq-Hu for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 20:55:07 +0100 Original-Received: from localhost ([127.0.0.1]:41892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhSVG-0005H4-DL for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 14:55:06 -0500 Original-Received: from [140.186.70.92] (port=55666 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhSV9-0005Ey-Ov for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 14:55:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhSV8-00005e-LD for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 14:54:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhSV8-00005Y-IT for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 14:54:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PhSIb-0000BX-OJ; Mon, 24 Jan 2011 14:42:01 -0500 X-Loop: help-debbugs@gnu.org 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, 24 Jan 2011 19:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7735-submit@debbugs.gnu.org id=B7735.1295898097679 (code B ref 7735); Mon, 24 Jan 2011 19:42:01 +0000 Original-Received: (at 7735) by debbugs.gnu.org; 24 Jan 2011 19:41:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhSID-0000At-6V for submit@debbugs.gnu.org; Mon, 24 Jan 2011 14:41:37 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhSIA-0000Ah-JR for 7735@debbugs.gnu.org; Mon, 24 Jan 2011 14:41:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAANmPU1MCo4O/2dsb2JhbACkaHS7aYVQBIRwjjo X-IronPort-AV: E=Sophos;i="4.60,371,1291611600"; d="scan'208";a="89089837" Original-Received: from 76-10-142-14.dsl.teksavvy.com (HELO pastel.home) ([76.10.142.14]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Jan 2011 14:49:36 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 9477258C4E; Mon, 24 Jan 2011 14:49:35 -0500 (EST) In-Reply-To: (Lennart Borgman's message of "Sun, 26 Dec 2010 00:28:04 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 24 Jan 2011 14:42:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43609 Archived-At: > A question mark at the end of a string makes ruby-mode believe the > string does not end there. Indeed, when I switched to syntax-propertize-rules code, I didn't notice that one of the regexps use backrefs, which aren't supported by syntax-propertize-rules. I've just installed the patch below which should fix it, Stefan === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2011-01-16 02:21:30 +0000 +++ lisp/progmodes/ruby-mode.el 2011-01-24 19:47:16 +0000 @@ -1121,14 +1121,13 @@ (syntax-propertize-rules ;; #{ }, #$hoge, #@foo are not comments ("\\(#\\)[{$@]" (1 ".")) - ;; the last $', $", $` in the respective string is not variable - ;; the last ?', ?", ?` in the respective string is not ascii code - ("\\(^\\|[\[ \t\n<+\(,=]\\)\\(['\"`]\\)\\(\\\\.\\|\\2\\|[^'\"`\n\\\\]\\)*?\\\\?[?$]\\(\\2\\)" - (2 "\"") - (4 "\"")) ;; $' $" $` .... are variables ;; ?' ?" ?` are ascii codes - ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" (3 ".")) + ("\\([?$]\\)[#\"'`]" + (1 (unless (save-excursion + ;; Not within a string. + (nth 3 (syntax-ppss (match-beginning 0)))) + (string-to-syntax "\\")))) ;; regexps ("\\(^\\|[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" (4 "\"/")