From unknown Tue Jun 17 20:19:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7735 <7735@debbugs.gnu.org> To: bug#7735 <7735@debbugs.gnu.org> Subject: Status: A questing mark at the end of a string in ruby-mode Reply-To: bug#7735 <7735@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:19:05 +0000 retitle 7735 A questing mark at the end of a string in ruby-mode reassign 7735 emacs submitter 7735 Lennart Borgman severity 7735 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 25 18:21:47 2010 Received: (at submit) by debbugs.gnu.org; 25 Dec 2010 23:21:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PWdQo-0000S4-TP for submit@debbugs.gnu.org; Sat, 25 Dec 2010 18:21:47 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PWdQm-0000Rr-Vj for submit@debbugs.gnu.org; Sat, 25 Dec 2010 18:21:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWdXI-0006xk-53 for submit@debbugs.gnu.org; Sat, 25 Dec 2010 18:28:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:38073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWdXI-0006xg-36 for submit@debbugs.gnu.org; Sat, 25 Dec 2010 18:28:28 -0500 Received: from [140.186.70.92] (port=50755 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWdXH-0005bk-9s for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2010 18:28:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWdXG-0006xU-6a for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2010 18:28:27 -0500 Received: from mail-ew0-f41.google.com ([209.85.215.41]:60557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWdXF-0006xQ-To for bug-gnu-emacs@gnu.org; Sat, 25 Dec 2010 18:28:26 -0500 Received: by ewy27 with SMTP id 27so4800252ewy.0 for ; Sat, 25 Dec 2010 15:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=rsGwmWKIV82UPzIk5hQNI9WOLali37FMHeRb8J53lsc=; b=arZ8xuInfLJ+gxtVGIuh7z82cVEqIdtGTs/NfVhPpIfJjTV5S4HY/ONMOJ5urlOeaR 1pLUgC3VguYuBydCABGdLduIFAFtpr6MLdvaW15cuPMZwJ959qf7DIdnhTU6TGQXJRP+ Thc9fstAyjR1nOSbbCcb4zGtUdEb6QxJNud+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=jaEJDrp2Y+ypg4c3lYspnEqGE3ACFch5iBgrvIo6e2Q02KFHm0AAXs3UDJ5NaCKeTk rye/PXMFfOsfDyEMBfJKrhZq+U8LZFgPv5w/4zbT6GzEh0WMKdQS+khaGViW7PYgCGIE OTZQ1tx8zasqsrr7LS18IQT7e4OcqQXPB11bE= Received: by 10.213.28.147 with SMTP id m19mr9959618ebc.97.1293319705054; Sat, 25 Dec 2010 15:28:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.20.148 with HTTP; Sat, 25 Dec 2010 15:28:04 -0800 (PST) From: Lennart Borgman Date: Sun, 26 Dec 2010 00:28:04 +0100 Message-ID: Subject: A questing mark at the end of a string in ruby-mode To: Emacs Bugs Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -4.7 (----) 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: -4.7 (----) A question mark at the end of a string makes ruby-mode believe the string does not end there. To show this place the following in a ruby-mode buffer: re_str = wild.join(".*?") re = Regexp.new(re_str, 1) GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-12-15 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 22 19:59:22 2011 Received: (at 7735) by debbugs.gnu.org; 23 Jan 2011 00:59:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgoIb-0003PX-LI for submit@debbugs.gnu.org; Sat, 22 Jan 2011 19:59:21 -0500 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgoIZ-0003PK-8L for 7735@debbugs.gnu.org; Sat, 22 Jan 2011 19:59:19 -0500 Received: from furball (dhcp128036014187.central.yale.edu [128.36.14.187]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p0N17ER7003909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 22 Jan 2011 20:07:14 -0500 Received: by furball (Postfix, from userid 1000) id AE5E6161EC4; Sat, 22 Jan 2011 20:07:13 -0500 (EST) From: Chong Yidong To: Stefan Monnier Subject: Re: bug#7735: A questing mark at the end of a string in ruby-mode References: Date: Sat, 22 Jan 2011 20:07:13 -0500 In-Reply-To: (Lennart Borgman's message of "Sun, 26 Dec 2010 00:28:04 +0100") Message-ID: <87mxmsbf7i.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.7 (--) X-Debbugs-Envelope-To: 7735 Cc: 7735@debbugs.gnu.org, Lennart Borgman 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.7 (--) Lennart Borgman writes: > A question mark at the end of a string makes ruby-mode believe the > string does not end there. > > To show this place the following in a ruby-mode buffer: > > re_str = wild.join(".*?") > re = Regexp.new(re_str, 1) This bug was appeared during the introduction of syntax-propertize. Stefan, could you take a look? 2010-09-10 Stefan Monnier * progmodes/ruby-mode.el (ruby-here-doc-beg-re): Define while compiling. (ruby-here-doc-end-re, ruby-here-doc-beg-match) (ruby-font-lock-syntactic-keywords, ruby-comment-beg-syntax) (syntax-ppss, ruby-in-ppss-context-p, ruby-in-here-doc-p) (ruby-here-doc-find-end, ruby-here-doc-beg-syntax) (ruby-here-doc-end-syntax): Only define when syntax-propertize is not available. (ruby-syntax-propertize-function, ruby-syntax-propertize-heredoc): New functions. (ruby-in-ppss-context-p): Update to new syntax of heredocs. (electric-indent-chars): Silence bytecompiler. (ruby-mode): Use prog-mode, syntax-propertize-function, and electric-indent-chars. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 14:41:37 2011 Received: (at 7735) by debbugs.gnu.org; 24 Jan 2011 19:41:37 +0000 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 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" 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 Received: by pastel.home (Postfix, from userid 20848) id 9477258C4E; Mon, 24 Jan 2011 14:49:35 -0500 (EST) From: Stefan Monnier To: Lennart Borgman Subject: Re: bug#7735: A questing mark at the end of a string in ruby-mode Message-ID: References: Date: Mon, 24 Jan 2011 14:49:35 -0500 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) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 7735 Cc: 7735@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.1 (--) > 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 "\"/") From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 15:03:44 2011 Received: (at control) by debbugs.gnu.org; 24 Jan 2011 20:03:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhSdb-0000gK-DX for submit@debbugs.gnu.org; Mon, 24 Jan 2011 15:03:43 -0500 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 1PhSdZ-0000g4-FC for control@debbugs.gnu.org; Mon, 24 Jan 2011 15:03:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQGAN9rPU1MCo4O/2dsb2JhbACWS44ddLtYhVAEhHCOOg X-IronPort-AV: E=Sophos;i="4.60,371,1291611600"; d="scan'208";a="89092854" 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 15:11:40 -0500 Received: by pastel.home (Postfix, from userid 20848) id 23C3058C4E; Mon, 24 Jan 2011 15:11:40 -0500 (EST) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: bug#7735: A question mark at the end of a string in ruby-mode Message-ID: References: Date: Mon, 24 Jan 2011 15:11:40 -0500 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) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) 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.1 (--) close 7735 thanks From unknown Tue Jun 17 20:19:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 22 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