From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Noah Peart Newsgroups: gmane.emacs.bugs Subject: bug#67235: [PATCH] Fix finding test name with erts-run-test with point-char Date: Thu, 16 Nov 2023 18:12:52 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000001b8874060a4fadd1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33710"; mail-complaints-to="usenet@ciao.gmane.io" To: 67235@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 17 03:14:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3oN8-0008aT-3v for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Nov 2023 03:14:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3oMt-00065P-O6; Thu, 16 Nov 2023 21:14:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3oMs-00065F-AC for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 21:14:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3oMs-00078f-1D for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 21:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3oMr-0000Xb-O5 for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 21:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noah Peart Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Nov 2023 02:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67235 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17001871982017 (code B ref -1); Fri, 17 Nov 2023 02:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2023 02:13:18 +0000 Original-Received: from localhost ([127.0.0.1]:44926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3oM9-0000WT-Au for submit@debbugs.gnu.org; Thu, 16 Nov 2023 21:13:17 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:38548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3oM5-0000WE-57 for submit@debbugs.gnu.org; Thu, 16 Nov 2023 21:13:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3oLz-0005v8-29 for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 21:13:07 -0500 Original-Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3oLx-00059d-6A for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 21:13:06 -0500 Original-Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-586a516755aso1276082eaf.0 for ; Thu, 16 Nov 2023 18:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700187183; x=1700791983; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7nYWHyodC2Gd1HXIWu/EMKD2YsVUG0TMHAfZoUb10fo=; b=gn0bg7WiOGgkCA7osdA+SkvjLHdMG+RzdMH3LvXFcyOzXrfwpQsF0Zuszna0bjLnHC o20wYWviJLSkGBYUo6ulGeqmp3O6cKyeokRapD7TF5QMnDFM7Vl+J6rb5G0Ur3elauul 4rjo4cgLVZw38cmMx/2DiXS+vHMULTfapOrjp3TRE9sUO+/dSEDLookTEG6D/kU2ZsEI 0YYrMXLUc1qIxIas4VSiBoS9HiwcPc9aPMQN77F+lXEZfbcrNAZVq44X0P2F1u0t6RXv JAB1NDlmBhO1GqwrMw++cx5RClKewwRrhcQ+cy1eK6Kp1jdCzO8RLJZ/pFrkhomMEsk9 cpKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700187183; x=1700791983; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7nYWHyodC2Gd1HXIWu/EMKD2YsVUG0TMHAfZoUb10fo=; b=GBOzb08tyZGaNFt9r2Prvp2NUcfJTbwIk7X7XYFa8Oj3p57NM+W9uGnTfsBT3w3DPB hbF6EHiUTgsgXih0pJ092h0xhjbfYewWxIVC/ED/U3c6dndKCLM21z4FnfwQ8gF0i2nx lpFU69BD2Dz/57SvYOLEl3bMhPQf6NWL7SfFlq55KJi0F958r7kFqa9UZ9PLir3u+D4h aJPGztymKc8/ujmzrtw58Mh/ao7DhWZExrl79bpMFLg6bQgAWhMH0cmMJppEzFtkfTob qPTk5akyaTwoVY0rxYdH6zrGQTqvLYKIaYnyOgINMYY1zQuJzsF2f7ezhz7SJOJgon+C IzNw== X-Gm-Message-State: AOJu0Yy1BYw8gKfiskakRhMbNYPhg2sT/Mk0caM3FSNEhksNRjwbXaX7 E8d5ri14/EmNVeV3cJj9tejTAM5dBkAV8avMZ0LH8f8nutxa/GBIvtQ= X-Google-Smtp-Source: AGHT+IHErx0QVClXIryhUjESUV4q5KpdgfEt5+HXIS+GbqoQsH0W0x9ge7Rb/hGoCgVx42utleBIUqYWNguMGqvjj9Q= X-Received: by 2002:a05:6871:a693:b0:1f5:6753:dd71 with SMTP id wh19-20020a056871a69300b001f56753dd71mr2038732oab.18.1700187183201; Thu, 16 Nov 2023 18:13:03 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::c30; envelope-from=noah.v.peart@gmail.com; helo=mail-oo1-xc30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274486 Archived-At: --0000000000001b8874060a4fadd1 Content-Type: multipart/alternative; boundary="0000000000001b8873060a4fadcf" --0000000000001b8873060a4fadcf Content-Type: text/plain; charset="UTF-8" Tags: patch * lisp/progmodes/erts-mode.el(erts-run-test): Fix finding the test name when Point-Char is defined Bug: Interactively running a test with `erts-run-test` fails when the test has a Point-Char definition. When there is a Point-Char definition, `erts-run-test` calls `(erts-mode--preceding-spec "Point-Char")`, overwriting the match data expected by `ert-test--erts-test`. Recipe to reproduce: Try `M-x erts-run-test` in the indent.erts test from test/lisp/progmodes/typescript-ts-mode-resources/indent.erts: [[The following is in `erts-mode`]] Code: (lambda () (setq indent-tabs-mode nil) (setq typescript-ts-mode-indent-offset 2) (typescript-ts-mode) (indent-region (point-min) (point-max))) Point-Char: | Name: Basic indentation =-= const foo = () => { console.log("bar"); if (x) { return y; } else if (y) { return u; } return baz.x() ? true : false; } =-=-= In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-11-15 built on noah-X580VD Repository revision: 1a1f47e4a1fb70e6810f9eabd0f1826b71a2bcb0 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.3 LTS Configured using: 'configure --prefix=/usr/local --with-modules --with-tree-sitter --with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls --with-json --with-mailutils --with-jpeg --with-png --with-rsvg --with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12 CXX=gcc-12' --0000000000001b8873060a4fadcf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tags: patch


* lisp/progmodes/erts-mode.el(erts-= run-test): Fix finding the test name
when Point-Char is defined

B= ug: Interactively running a test with `erts-run-test` fails when the
tes= t has a Point-Char definition. When there is a Point-Char definition,
`e= rts-run-test` calls `(erts-mode--preceding-spec "Point-Char")`,overwriting the match data expected by `ert-test--erts-test`.

Reci= pe to reproduce:
Try `M-x erts-run-test` in the indent.erts test fromtest/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
[[The fol= lowing is in `erts-mode`]]

Code:
=C2=A0 (lambda ()
=C2=A0 =C2= =A0 (setq indent-tabs-mode nil)
=C2=A0 =C2=A0 (setq typescript-ts-mode-i= ndent-offset 2)
=C2=A0 =C2=A0 (typescript-ts-mode)
=C2=A0 =C2=A0 (ind= ent-region (point-min) (point-max)))

Point-Char: |

Name: Basi= c indentation

=3D-=3D
const foo =3D () =3D> {
=C2=A0 consol= e.log("bar");
=C2=A0 if (x) {
=C2=A0 =C2=A0 return y;
= =C2=A0 } else if (y) {
=C2=A0 =C2=A0 return u;
=C2=A0 }
=C2=A0 ret= urn baz.x()
=C2=A0 =C2=A0 ? true
=C2=A0 =C2=A0 : false;
}
=3D-= =3D-=3D

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Ver= sion
3.24.33, cairo version 1.16.0) of 2023-11-15 built on noah-X580VDRepository revision: 1a1f47e4a1fb70e6810f9eabd0f1826b71a2bcb0
Reposito= ry branch: master
Windowing system distributor 'The X.Org Foundation= ', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS
<= br>Configured using:
=C2=A0'configure --prefix=3D/usr/local --with-m= odules --with-tree-sitter
--with-threads --with-x-toolkit=3Dgtk3 --with-= xwidgets --with-gnutls
--with-json --with-mailutils --with-jpeg --with-p= ng --with-rsvg
--with-tiff --with-xml2 --with-xpm --with-imagemagick CC= =3Dgcc-12
CXX=3Dgcc-12'
--0000000000001b8873060a4fadcf-- --0000000000001b8874060a4fadd1 Content-Type: text/x-patch; charset="US-ASCII"; name="erts-run-test.patch" Content-Disposition: attachment; filename="erts-run-test.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lp1zjj8u0 RnJvbSA5NDBmYWRhMDEzODNhYTA1M2VlN2I1ZjcwZTM3MTRkOGI2OTU0ODE4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBudmVybm8gPG5vYWgudi5wZWFydEBnbWFpbC5jb20+CkRhdGU6 IFRodSwgMTYgTm92IDIwMjMgMTc6NTU6NTkgLTA4MDAKU3ViamVjdDogW1BBVENIXSBGaXggdGVz dCBuYW1lIHdpdGggZXJ0cy1ydW4tdGVzdCB3aX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