GNU bug report logs - #73206
28.2; xml comment with blank lines to do not indent correctly, nxml-mode.el

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: ciolfi@HIDDEN; dated Thu, 12 Sep 2024 18:04:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 73206 <at> debbugs.gnu.org:


Received: (at 73206) by debbugs.gnu.org; 2 Oct 2024 11:59:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 02 07:59:13 2024
Received: from localhost ([127.0.0.1]:56802 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1svy0e-0003ky-SC
	for submit <at> debbugs.gnu.org; Wed, 02 Oct 2024 07:59:13 -0400
Received: from us-smtp-delivery-120.mimecast.com ([170.10.133.120]:60231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ciolfi@HIDDEN>) id 1svy0b-0003kp-Ms
 for 73206 <at> debbugs.gnu.org; Wed, 02 Oct 2024 07:59:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathworks.com;
 s=mimecast20180117; t=1727870348;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=7NDwHB5/BrTGUAcLNP8UT+0Kq2lZMONJv/94fwJrpVA=;
 b=HTL+8qcApiBKaKOccARUh1ylyc9Mo0/a6t0ALdox+DSDd7NexZAienra3WWm0fUqZxMK/8
 U8KYjtgVn/yH8jrqZ+SPyvP939OGVL01Z/r+KPcZtuRFR/njQCEn7ZAJVtFsd3BEX5LMTE
 dGB/4VnR6nGpeZFb9LGfz1pDG7R5y7w=
Received: from CY4PR05CU001.outbound.protection.outlook.com
 (mail-westcentralusazlp17010007.outbound.protection.outlook.com
 [40.93.6.7]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-386-YzgWDrFhNDCmGjjon8kqgQ-1; Wed, 02 Oct 2024 07:59:07 -0400
X-MC-Unique: YzgWDrFhNDCmGjjon8kqgQ-1
Received: from MN2PR05MB6766.namprd05.prod.outlook.com (2603:10b6:208:185::15)
 by MN6PR05MB10236.namprd05.prod.outlook.com (2603:10b6:208:47b::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Wed, 2 Oct
 2024 11:59:04 +0000
Received: from MN2PR05MB6766.namprd05.prod.outlook.com
 ([fe80::5ea6:b1eb:653c:426f]) by MN2PR05MB6766.namprd05.prod.outlook.com
 ([fe80::5ea6:b1eb:653c:426f%6]) with mapi id 15.20.8026.016; Wed, 2 Oct 2024
 11:59:04 +0000
From: John Ciolfi <ciolfi@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
Thread-Topic: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
Thread-Index: AQHbBTy3wtVaBrQozEqF93tHMuSqjrJVVsC4gANujs+AFDXodIACW/sAgAQWaY4=
Date: Wed, 2 Oct 2024 11:59:03 +0000
Message-ID: <MN2PR05MB67666D35B1FFBF2F60368DDBD1702@HIDDEN>
References: <r9seu4vjvt.fsf@HIDDEN> <87h6akknhu.fsf@HIDDEN>
 <MN2PR05MB676630F8B5B626E5EDA991FCD1672@HIDDEN>
 <86v7yg6u9x.fsf@HIDDEN>
 <CADwFkm=Uazbs5EeYQp__239-WUdgbFqpR3B8-3NGsg8qp2icYA@HIDDEN>
In-Reply-To: <CADwFkm=Uazbs5EeYQp__239-WUdgbFqpR3B8-3NGsg8qp2icYA@HIDDEN>
Accept-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
msip_labels: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: MN2PR05MB6766:EE_|MN6PR05MB10236:EE_
x-ms-office365-filtering-correlation-id: a68414ee-357f-4b06-d345-08dce2d99c72
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|38070700018
x-microsoft-antispam-message-info: =?us-ascii?Q?N8T4yB/PSKyYHSlijvLNzHSm+uOl3i8F1YMBIJM62QXdkkEAs3gcrKvyUTg5?=
 =?us-ascii?Q?l80FayQyTO2T2csOIPtYnOCNeMOTW7u2bVzOCtbSUeg9+3agFee9+6BKS3Iy?=
 =?us-ascii?Q?JwsBCZlnphxh/oX4+uDRoF67g5iYCbbzdKZosh9vlPR6JzncexuGFfoAgCwC?=
 =?us-ascii?Q?hhMOUtKL7Oq2DMYgXCXOEld8JXLJyrzpu7PQTX16YDsVVJSdXUC1ZW/gDA1v?=
 =?us-ascii?Q?zxt1JKboJyCuMSaAZA1FDGp/31BbJ8O22BKGKR/cFQ06GB3HfpNKz9WP2QMZ?=
 =?us-ascii?Q?D3z+csB8rOf6xJ05TKwOR0kuSxIfdsE0UpWy1fMG9GhoMvyyn2sGUHOtihKz?=
 =?us-ascii?Q?YAyNimD1RP9xjVPtzyekLu3sr9PVw6iAyd4VxO+lW+wA572o9eg2n39/RCjb?=
 =?us-ascii?Q?BGenlgTJkQYtZYmP2nhoPmrqCeprJkb+5ZT+DwV4eWcmJMx1DOvg5xt4o4qk?=
 =?us-ascii?Q?rbMtjkaUwbGSSvHj5+hpDRMsI66JwrQTIhcWSrsUd3jydV6RWw+6pdT1DQJs?=
 =?us-ascii?Q?zXQ+Nhs0+Z62RsXXOtvkq02Tt8rRZuFp1bVsvMxNjPSNE+egXs4pRmASkaOj?=
 =?us-ascii?Q?fddxfRjhBo2sucj2Q/9oyPqRKj9RZQSshEtUpj5BX5HzZtpZWrZdMMaZa2mm?=
 =?us-ascii?Q?vDdu0wfnDeu0/CZy9Dyg6x0zAgvmHHq80qn+fsYWjSdxq2lCOP6P55d1ag5s?=
 =?us-ascii?Q?jL8FYqStDzSBlmK5pKxZW2sSQ2psrOBRvgHae0A/F4xKliubctkMkSyYR1TF?=
 =?us-ascii?Q?BF8HbFQJSpXxjz3x9qgKPwcq/h55xuJbL9TSCvpW/EwJ4yq0QraNUyHb+iJ5?=
 =?us-ascii?Q?PxPw+tfamSR2J8cfXorwi1GFzt+Tf7rVc69vr4tF9G/xUMhDsfs1XRHto++R?=
 =?us-ascii?Q?OH7nf5jdCIpIZnFRC6C/A8sPzVst9MVjMSKpNEYgVZNr02+TyTF7pEPFBlTr?=
 =?us-ascii?Q?B6XvLipnkW7iCgQEmihUtY4EnuY6kPNu8x3o/jGDpXqtSfEG2jFp4TfpPV9A?=
 =?us-ascii?Q?wlDEvsmXQ/1n3czeNNY2cgZft7/oEEx4qKI/6HSG9/bwbhHU/TlNMZY76LLf?=
 =?us-ascii?Q?jGYbIcGRDZZHfv8GxRVkZ+OBnSEweYCV42TSKA+MQ0DgcWpm8tJTw6GIqm5M?=
 =?us-ascii?Q?JIqyBT2aHZEHD80NXvQBkyPPldE/Zba2xelGciOdNqO34LLL9hpdypWWXEFz?=
 =?us-ascii?Q?a6sjwrv/PDcyeu6jeXu3E3Im4UmXUIBA+A+Q7rf+mF+G2cj4sLYjuyCdsG//?=
 =?us-ascii?Q?z4gUSHdCTbPWdTnl2zFF7Xs+BAWFTJm/M5MOoWfY9A1e3CRJhTp3RkUMCykw?=
 =?us-ascii?Q?bYNj1IRpomtJrdA0kcfY+vJH/cdDd8+/ETWIK2wcZV03kQ=3D=3D?=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:MN2PR05MB6766.namprd05.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230040)(1800799024)(366016)(376014)(38070700018);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kCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: V0zHQobQAow4JRjfzPoRn7ZGHCMZZ3YJecsy4dpQISF6xB/7/kPS29Z4WVxnPQXFozKnUJ1E4n3dDguMfr90XRl02TI2yU1Jm0nncIZfMKgioOA8BE92B6OboRjlEpS6Zy4E7/iaii4nnywOq3/aLJAnr9wCynsG0MbyNopLM4BlDtHuVZNaR7odBvNbbrGbQhmQhBDC+LDxS8z+O+QW8A0TRPd54g2aEPCt6+khddXZUw90b+CGLGa32E88xv2b+bP70EUfiSdODYduGDJsBwQ0kCl/T1ptyCbdaDF+WQp7QXF9bjSDqTQnTo2ls/MYmLI58B660ALj0xGxtOrZj6rP+wat+G3y2W+gVRTvtaQwEh02lzsNjxQMvC7JjZF2F/34E2pa80YFfk9i+TAQU2zz569tJE9bkpfp6l6ZU3o3fHgDqwC7w4tuMJm1nvqu2S7xAxTBIGanc7IctgkWs/LH2eEJg/DoosqAIn2l5t7UsLVUOyxKfbpwwZUyiIWYrCXjOzKmGeB5pGlMQ4lTwsRx1FKim0sBj/d30d78h8AcJtfbyEaRkBMb3pE1BAKGEanzoIjnjz3vvDxd/++4dao9Uz4cMJ7+P43tIKVbAcXH0ax4d2o8VkKebNpo+tTD
X-OriginatorOrg: mathworks.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: MN2PR05MB6766.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a68414ee-357f-4b06-d345-08dce2d99c72
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2024 11:59:03.9734 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 99dd3a11-4348-4468-9bdd-e5072b1dc1e6
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: x/DAew7PN4OrIsPGYfNZyK1MIKDXKnO6EqFG7/+JcrykKbfI0c1AEmCQ3q7F/PEq4k7PAfTlPTYSDrMGf489qA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR05MB10236
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: mathworks.com
Content-Language: en-US
Content-Type: multipart/mixed;
 boundary="_004_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 73206
Cc: "73206 <at> debbugs.gnu.org" <73206 <at> debbugs.gnu.org>,
 "rpluim@HIDDEN" <rpluim@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--_004_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_
Content-Type: multipart/alternative;
	boundary="_000_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_"

--_000_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

Hi

Using "^$" or "^[[:blank:]]*$" is fine. The difference is very minor. Consi=
der foo.xml where the visibly "empty" line contains a single space and foo =
starts on the 1st column:

<foo>
  <!--
      bar

foo
  -->
</foo>

When using "^$" and you type tab on the foo line, you'll get the following =
where foo starts on the 2nd column:

<foo>
  <!--
      bar

 foo
  -->
</foo>

If you use "^[[:blank:]]*$, you'll get what I expected:

<foo>
  <!--
      bar

      foo
  -->
</foo>

However, if you select all and indent-region, C-M-\ on the original you'll =
get the expected result with either "^$" or "^[[:blank:]]*$ because nxml-mo=
de will pad out the space line. If the "empty" line truly blank (no spaces =
or tabs), then the two regex's behave identical.

I suggest for test cases, two versions of foo.xml where one version of it h=
as the empty line truly blank (no spaces or tabs) and the other version con=
tains a space in the "empty" line.

You can use the attached nxml-mode-indent-fix.el which overrides the broken=
 function to try things out on a stock Emacs, emacs -Q.

Thanks
John


________________________________
From: Stefan Kangas <stefankangas@HIDDEN>
Sent: Sunday, September 29, 2024 4:47 PM
To: Eli Zaretskii <eliz@HIDDEN>; John Ciolfi <ciolfi@HIDDEN>
Cc: rpluim@HIDDEN <rpluim@HIDDEN>; 73206 <at> debbugs.gnu.org <73206@debbu=
gs.gnu.org>
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent=
 correctly, nxml-mode.el

Eli Zaretskii <eliz@HIDDEN> writes:

> Stefan, does the patch with the regexp fix look correct to you?

If we want to "keep going back until we see a non-blank line", surely
the fragment should read:

    (while (looking-at "^$")
      (forward-line -1))

Since

    (looking-at "^[[:blank:]]*$")

will match both blank lines, and lines containing only blank space.

Which of the two do we want here?

I think it would also be good to add one or more tests here.


--_000_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_
Content-Type: text/html; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Hi</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Using &quot;^$&quot; or &quot;^[[:blank:]]*$&quot; is fine. The difference =
is very minor. Consider foo.xml where the visibly &quot;empty&quot; line co=
ntains a single space and foo starts on the 1<sup>st</sup>&nbsp;column:</di=
v>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&lt;foo&gt;</div>
<div style=3D"font-family: Consolas, Courier, monospace; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &lt;!--</div>
<div style=3D"font-family: Consolas, Courier, monospace; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; bar</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp;</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
foo</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp; --&gt;</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&lt;/foo&gt;</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
When using &quot;^$&quot; and you type tab on the foo line, you'll get the =
following where foo starts on the 2<sup>nd</sup>&nbsp;column:</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&lt;foo&gt;</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp; &lt;!--</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; bar</div>
<div style=3D"font-family: Consolas, Courier, monospace; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp;</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp;foo</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp; --&gt;</div>
<div class=3D"elementToProof" style=3D"font-family: Consolas, Courier, mono=
space; font-size: 12pt; color: rgb(0, 0, 0);">
&lt;/foo&gt;</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
If you use &quot;^[[:blank:]]*$, you'll get what I expected:</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Consolas, =
Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
&lt;foo&gt;</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&nbsp; &lt;!--</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; bar</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&nbsp;</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; foo</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&nbsp; --&gt;</div>
<div style=3D"margin: 0px; font-family: Consolas, Courier, monospace; font-=
size: 12pt; color: rgb(0, 0, 0);">
&lt;/foo&gt;</div>
<div class=3D"elementToProof" style=3D"margin: 0px; font-family: Aptos, Apt=
os_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-=
size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
However, if you select all and indent-region, C-M-\ on the original you'll =
get the expected result with either &quot;^$&quot; or &quot;^[[:blank:]]*$ =
because nxml-mode will pad out the space line. If the &quot;empty&quot; lin=
e truly blank (no spaces or tabs), then the two regex's behave
 identical.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
I suggest for test cases, two versions of foo.xml where one version of it h=
as the empty line truly blank (no spaces or tabs) and the other version con=
tains a space in the &quot;empty&quot; line.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
You can use the attached nxml-mode-indent-fix.el which overrides the broken=
 function to try things out on a stock Emacs, emacs -Q.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Thanks</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
John</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Stefan Kangas &lt;ste=
fankangas@HIDDEN&gt;<br>
<b>Sent:</b> Sunday, September 29, 2024 4:47 PM<br>
<b>To:</b> Eli Zaretskii &lt;eliz@HIDDEN&gt;; John Ciolfi &lt;ciolfi@mathw=
orks.com&gt;<br>
<b>Cc:</b> rpluim@HIDDEN &lt;rpluim@HIDDEN&gt;; 73206 <at> debbugs.gnu.org=
 &lt;73206 <at> debbugs.gnu.org&gt;<br>
<b>Subject:</b> Re: bug#73206: 28.2; xml comment with blank lines to do not=
 indent correctly, nxml-mode.el</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">Eli Zaretskii &lt;eliz@HIDDEN&gt; writes:<br>
<br>
&gt; Stefan, does the patch with the regexp fix look correct to you?<br>
<br>
If we want to &quot;keep going back until we see a non-blank line&quot;, su=
rely<br>
the fragment should read:<br>
<br>
&nbsp;&nbsp;&nbsp; (while (looking-at &quot;^$&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (forward-line -1))<br>
<br>
Since<br>
<br>
&nbsp;&nbsp;&nbsp; (looking-at &quot;^[[:blank:]]*$&quot;)<br>
<br>
will match both blank lines, and lines containing only blank space.<br>
<br>
Which of the two do we want here?<br>
<br>
I think it would also be good to add one or more tests here.<br>
<br>
</div>
</span></font></div>
</body>
</html>

--_000_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_--

--_004_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_
Content-Type: text/x-emacs-lisp; name=nxml-mode-indent-fix.el; 
	charset=WINDOWS-1252
Content-Description: nxml-mode-indent-fix.el
Content-Disposition: attachment; filename="nxml-mode-indent-fix.el";
	size=1327; creation-date="Wed, 02 Oct 2024 11:58:39 GMT";
	modification-date="Wed, 02 Oct 2024 11:59:03 GMT"
Content-Transfer-Encoding: base64

KGRlZnZhciB4bWx0b2stc3RhcnQpIDs7IGZyb20geG1sdG9rLmVsCihkZWZ1biBueG1sLWNvbXB1
dGUtaW5kZW50LWluLWRlbGltaXRlZC10b2tlbi1vdmVycmlkZSAocG9zIG9wZW4tZGVsaW0gY2xv
c2UtZGVsaW0pCiAgIlJldHVybiB0aGUgaW5kZW50IGZvciBhIGxpbmUgdGhhdCBzdGFydCBpbnNp
ZGUgYSB0b2tlbiB3aXRoIGRlbGltaXRlcnMuCk9QRU4tREVMSU0gYW5kIENMT1NFLURFTElNIGFy
ZSBzdHJpbmdzIGdpdmluZyB0aGUgb3BlbmluZyBhbmQgY2xvc2luZwpkZWxpbWl0ZXJzLiAgUE9T
IGlzIHRoZSBwb3NpdGlvbiBvZiB0aGUgZmlyc3Qgbm9uLXdoaXRlc3BhY2UgY2hhcmFjdGVyCm9m
IHRoZSBsaW5lLiAgVGhpcyBleHBlY3RzIHRoZSB4bWx0b2stKiB2YXJpYWJsZXMgdG8gYmUgc2V0
IHVwIGFzIGJ5CmB4bWx0b2stZm9yd2FyZCcuCkZpeDogaHR0cHM6Ly9kZWJidWdzLmdudS5vcmcv
Y2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTczMjA2IgogIChjb25kICgobGV0ICgoZW5kICgrIHBvcyAo
bGVuZ3RoIGNsb3NlLWRlbGltKSkpKQoJICAgKGFuZCAoPD0gZW5kIChwb2ludC1tYXgpKQoJCShz
dHJpbmc9IChidWZmZXItc3Vic3RyaW5nLW5vLXByb3BlcnRpZXMgcG9zIGVuZCkKCQkJIGNsb3Nl
LWRlbGltKSkpCgkgKGdvdG8tY2hhciB4bWx0b2stc3RhcnQpKQoJKChwcm9nbgoJICAgKGdvdG8t
Y2hhciBwb3MpCgkgICAoZm9yd2FyZC1saW5lIC0xKQogICAgICAgICAgICh3aGlsZSAobG9va2lu
Zy1hdCAiXltbOmJsYW5rOl1dKiQiKQoJICAgICAoZm9yd2FyZC1saW5lIC0xKSkKCSAgICg8PSAo
cG9pbnQpIHhtbHRvay1zdGFydCkpCgkgKGdvdG8tY2hhciAoKyB4bWx0b2stc3RhcnQgKGxlbmd0
aCBvcGVuLWRlbGltKSkpCgkgKHdoZW4gKGFuZCAoc3RyaW5nPSBvcGVuLWRlbGltICI8IS0tIikK
CQkgICAgKGxvb2tpbmctYXQgIiAiKSkKCSAgIChnb3RvLWNoYXIgKDErIChwb2ludCkpKSkpCgko
dCAoYmFjay10by1pbmRlbnRhdGlvbikpKQogIChjdXJyZW50LWNvbHVtbikpCgood2hlbiAodmVy
c2lvbjw9IGVtYWNzLXZlcnNpb24gIjI5IikKICA7OyBBc3N1bWUgaHR0cHM6Ly9kZWJidWdzLmdu
dS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTczMjA2IHdpbGwgYmUgZml4ZWQgaW4gRW1hY3Mg
MzAKICAoZXZhbC1hZnRlci1sb2FkICdueG1sLW1vZGUKICAgICcoYWR2aWNlLWFkZCAnbnhtbC1j
b21wdXRlLWluZGVudC1pbi1kZWxpbWl0ZWQtdG9rZW4KICAgICAgICAgICAgICAgICA6b3ZlcnJp
ZGUKICAgICAgICAgICAgICAgICAjJ254bWwtY29tcHV0ZS1pbmRlbnQtaW4tZGVsaW1pdGVkLXRv
a2VuLW92ZXJyaWRlKSkpCg==
--_004_MN2PR05MB67666D35B1FFBF2F60368DDBD1702MN2PR05MB6766namp_--





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.

Message received at 73206 <at> debbugs.gnu.org:


Received: (at 73206) by debbugs.gnu.org; 29 Sep 2024 20:49:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 29 16:49:25 2024
Received: from localhost ([127.0.0.1]:42266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sv0r7-0006Y0-Bb
	for submit <at> debbugs.gnu.org; Sun, 29 Sep 2024 16:49:25 -0400
Received: from mail-ed1-f48.google.com ([209.85.208.48]:57790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1sv0r5-0006X6-3P
 for 73206 <at> debbugs.gnu.org; Sun, 29 Sep 2024 16:49:23 -0400
Received: by mail-ed1-f48.google.com with SMTP id
 4fb4d7f45d1cf-5c88e6926e5so1076272a12.3
 for <73206 <at> debbugs.gnu.org>; Sun, 29 Sep 2024 13:48:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727642865; x=1728247665; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=63fLT4IpWytENbA8fY81OjRE3xWNYfGMyeH8X4kXfR0=;
 b=HhQRNqOS2GitOTMwPyYOlfpvE8+xvv8qAzScL2azeUzoTjpTM3UNOd/K3NsD1H4PWr
 BDMOoJsh198jGCqSidLEv382Jg4jGFtsUxufVxh5ktdxyKmONgW6FjxlQ9e8ZG7mAmww
 w+QDk/iQuJyEbPjKvz6jBhTBolf8oibrZSVdQXA93NFX4joo3eR3oq7mURQrcfmnSRED
 JoUoLNRDN+uaaWHj3D+Xz/xZgFCqeL8Onol+Zb4FQ/tdXiDVTpJI1ti8Sz+1eISjJRAz
 6kzzW4iU0UpuLNzO8CZra78EvxlXJ3efhehv7i97jculyRfj7SUtdFvMe6Hg7zEP1QrO
 sFgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727642865; x=1728247665;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=63fLT4IpWytENbA8fY81OjRE3xWNYfGMyeH8X4kXfR0=;
 b=GzExDYs92FeYxU/QZDDHL1qOXMipNbhsTkSP4YOS2NfhVP/4TmDwbPPuu7eWw59FEO
 Rd9mntvkQP0dU25orKeRw+1E0VqT0AraxDpirp2rFnrtptUrrN1yI2tXw5FeUmXhP0Lq
 v8QMdijFHgzmLFcOVEV9iBmGGp/91tQA+anNND1ynHFTI3g+G7eFjOwmhH2yS291MugY
 z7uf8FGeoJliQQmNcUjRX+V5pTiw+LTRYhbrADljRY0+vg5mWJnzU0AgtRunR+rQPmU9
 SyjNzMKL6CmDsVFOJ9JBW2Sfkj8en3OezIWjaqFAV9W8O+9uMYSOsA/0GDtC8w/oWXGq
 R7Aw==
X-Forwarded-Encrypted: i=1;
 AJvYcCWo6/PtBF0qST4IeFk4mfa+rW5ypSmcy2ejniXeRbOvPuB1wocjYyp+I4MB8hFp5OOYN1IgOw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YygKOxYyKa8SbNE1IbDiFNGxW2B5cec3IqaPyPlLRNxA1FQP8sp
 GQBnnVlGpBoHD6etUz4G+lzhr1iexvVnkmWfuV8Odh5UC/mGDwP4wKhmqWkRUPlTTyo9ku0M32D
 cQKmCm2vegpFnGLeX56a9e1pRll0=
X-Google-Smtp-Source: AGHT+IHSVMObhq3PRtO440bXpmUE+t6x+HHgDkIo9w2t4ZJ2iNthsC4ppIM8s1XFZ4gGLzKCQsg1K2PCcnHhu3OgEw0=
X-Received: by 2002:a05:6402:26c8:b0:5c5:b9bb:c250 with SMTP id
 4fb4d7f45d1cf-5c88248ee09mr9349057a12.0.1727642865338; Sun, 29 Sep 2024
 13:47:45 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 29 Sep 2024 13:47:45 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <86v7yg6u9x.fsf@HIDDEN>
References: <r9seu4vjvt.fsf@HIDDEN> <87h6akknhu.fsf@HIDDEN>
 <MN2PR05MB676630F8B5B626E5EDA991FCD1672@HIDDEN>
 <86v7yg6u9x.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sun, 29 Sep 2024 13:47:44 -0700
Message-ID: <CADwFkm=Uazbs5EeYQp__239-WUdgbFqpR3B8-3NGsg8qp2icYA@HIDDEN>
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
To: Eli Zaretskii <eliz@HIDDEN>, John Ciolfi <ciolfi@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.9 (/)
X-Debbugs-Envelope-To: 73206
Cc: 73206 <at> debbugs.gnu.org, rpluim@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Stefan, does the patch with the regexp fix look correct to you?

If we want to "keep going back until we see a non-blank line", surely
the fragment should read:

    (while (looking-at "^$")
      (forward-line -1))

Since

    (looking-at "^[[:blank:]]*$")

will match both blank lines, and lines containing only blank space.

Which of the two do we want here?

I think it would also be good to add one or more tests here.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.

Message received at 73206 <at> debbugs.gnu.org:


Received: (at 73206) by debbugs.gnu.org; 28 Sep 2024 08:46:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 28 04:46:29 2024
Received: from localhost ([127.0.0.1]:51740 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1suT5w-00051O-US
	for submit <at> debbugs.gnu.org; Sat, 28 Sep 2024 04:46:29 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1suT5v-00050k-0v
 for 73206 <at> debbugs.gnu.org; Sat, 28 Sep 2024 04:46:27 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1suT5L-0000bR-O9; Sat, 28 Sep 2024 04:45:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=oQAD/tzNwFnQYy9vTN98Tda38+TR39bkJSk+WIPFVg0=; b=GoaYP5RjCJ1ib/y0P/D7
 sKQR8Ofu1Wbhv6fvB9Zcl5f3H4q+53DjnFxk7hMky/trR7j435sEIgqVNPfYAUQjO3s8Tcz9l/KfP
 lB9H/tdUiBERc1ZIUN8Z1hpt81QpegAxLv36Mpxkfs1I9dWMfIzJEZbVE7OqGjHOtqnJKwKite+Di
 Yv1zhb6mZTaQXuTwCFEy1gWK8cYcS05EIEwvAsBtu6DBXGwkw+tO9yfBmG/KkG9RBiz8i2mG3nb4K
 5plkO7mW+h2okyQ9gWAaYYPxp3AVhbATOSLWia/otdT4vWBn6APkP3i/wV6sA8k0DQeCF/tmi8zXz
 wufy6HiquNp6Sg==;
Date: Sat, 28 Sep 2024 11:45:46 +0300
Message-Id: <86v7yg6u9x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: John Ciolfi <ciolfi@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <MN2PR05MB676630F8B5B626E5EDA991FCD1672@HIDDEN>
 (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#73206: 28.2;
 xml comment with blank lines to do not indent correctly, nxml-mode.el
References: <r9seu4vjvt.fsf@HIDDEN> <87h6akknhu.fsf@HIDDEN>
 <MN2PR05MB676630F8B5B626E5EDA991FCD1672@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-7
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 73206
Cc: 73206 <at> debbugs.gnu.org, rpluim@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan, does the patch with the regexp fix look correct to you?

> Date: Sun, 15 Sep 2024 12:08:17 +0000
> msip_labels: 
> From:  John Ciolfi via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Thanks for catching my typo and for moving the fix along.
> -----------------------------------------------------------------------------
> From: Robert Pluim <rpluim@HIDDEN>
> Sent: Friday, September 13, 2024 3:43 AM
> To: 73206 <at> debbugs.gnu.org <73206 <at> debbugs.gnu.org>
> Cc: John Ciolfi <ciolfi@HIDDEN>
> Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent correctly, nxml-mode.el 
>  
> >>>>> On Thu, 12 Sep 2024 13:53:26 -0400, John Ciolfi via "Bug reports for GNU Emacs, the Swiss army
> knife of text editors" <bug-gnu-emacs@HIDDEN> said:
> 
>     John> 1. Create foo.xml containing:
> 
>     John> <foo>
>     John>     <!--
>     John>         foo
> 
>     John> bar
>     --> 
>     John> </foo>
> 
>     John> Notice that we have a blank line in the xml comment.
> 
>     John> 2. Put the point on 'bar' and press TAB.
> 
>     John> Notice that the 'bar' line is not indented correctly.
> 
>     John> Solution
>     John> --------
> 
>     John> The problem is that in nxml-compute-indent-in-delimited-token, there
>     John> is a (forward-line -1) which assumes that the prior line is indented. In
>     John> this case the prior line is a blank line and thus doesn't have
>     John> indentation. After the (forward-line -1), we need to keep going back
>     John> until we see a non-blank line:
> 
>     John>           (forward-line -1)
>     John> +           (while (looking-at "^[:blank:]*$")
>     John> +          (forward-line -1))
>  
>     John> Attached is a patch for nxml-mode.el that fixes the issue. 
> 
> Your patch does the right thing, but for the wrong reasons. Regexp
> character classes only have meaning with a bracket expression, so what
> you˘re matching here is actually any lines containing zero or more of
> ':', 'b', 'l', 'a', 'n', or 'k'. IOW, you should use:
> 
>      (looking-at "^[[:blank:]]*$")
> 
> Robert
> -- 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.

Message received at 73206 <at> debbugs.gnu.org:


Received: (at 73206) by debbugs.gnu.org; 15 Sep 2024 12:08:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 15 08:08:40 2024
Received: from localhost ([127.0.0.1]:48551 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1spo3T-00005y-KC
	for submit <at> debbugs.gnu.org; Sun, 15 Sep 2024 08:08:40 -0400
Received: from us-smtp-delivery-120.mimecast.com ([170.10.133.120]:34177)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ciolfi@HIDDEN>) id 1spo3R-00005p-H4
 for 73206 <at> debbugs.gnu.org; Sun, 15 Sep 2024 08:08:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathworks.com;
 s=mimecast20180117; t=1726402104;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=1vqyvxS45Zj44JkxmMKV4tyGBrt1+NcRqhsNSZdJXSc=;
 b=KhngzJ16jCqvXATiRofeJtI4jPHqShm8cBFspq3XyQslyOXbBlDiNl85Octrn3ARVhcWXD
 BTir8KXLVEdn3JKoaNefXvfcRzt0TXeeZTXVs/8nfxHWZeAjwG5ogWpmzg/yhPFQyOoRaX
 uR4ehkmT7T5oTeXVnXRl3MbuGjcyCCM=
Received: from BYAPR05CU005.outbound.protection.outlook.com
 (mail-westusazlp17010006.outbound.protection.outlook.com [40.93.1.6]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-96-HPmCYuSbN1-F4VHIy6cRdg-2; Sun, 15 Sep 2024 08:08:22 -0400
X-MC-Unique: HPmCYuSbN1-F4VHIy6cRdg-2
Received: from MN2PR05MB6766.namprd05.prod.outlook.com (2603:10b6:208:185::15)
 by CH3PR05MB10028.namprd05.prod.outlook.com (2603:10b6:610:12a::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.22; Sun, 15 Sep
 2024 12:08:18 +0000
Received: from MN2PR05MB6766.namprd05.prod.outlook.com
 ([fe80::5ea6:b1eb:653c:426f]) by MN2PR05MB6766.namprd05.prod.outlook.com
 ([fe80::5ea6:b1eb:653c:426f%6]) with mapi id 15.20.7962.022; Sun, 15 Sep 2024
 12:08:17 +0000
From: John Ciolfi <ciolfi@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>, "73206 <at> debbugs.gnu.org"
 <73206 <at> debbugs.gnu.org>
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
Thread-Topic: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
Thread-Index: AQHbBTy3wtVaBrQozEqF93tHMuSqjrJVVsC4gANujs8=
Date: Sun, 15 Sep 2024 12:08:17 +0000
Message-ID: <MN2PR05MB676630F8B5B626E5EDA991FCD1672@HIDDEN>
References: <r9seu4vjvt.fsf@HIDDEN> <87h6akknhu.fsf@HIDDEN>
In-Reply-To: <87h6akknhu.fsf@HIDDEN>
Accept-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
msip_labels: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: MN2PR05MB6766:EE_|CH3PR05MB10028:EE_
x-ms-office365-filtering-correlation-id: 5a72c340-f0dc-4b08-8466-08dcd57f157b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700018
x-microsoft-antispam-message-info: =?iso-8859-7?Q?3Lt2v57ylYx+SJ69aB7bXNRWCdD1Z7+J1RiuueaY3sKCsYJOsHQBGGMVrf?=
 =?iso-8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A36U0+DbLJEnP0JEQNReW/tfzJ9RSAKDYPkNhj9l2z9wfObyPCVOpX4?=
 =?iso-8859-7?Q?H05m9CSE9D5AzAY/ab7WO0rMY9yrsQGkveWmM6snoGLGIgvibCBHiSEEH4?=
 =?iso-8859-7?Q?ZqWML2fK+tVul0IV6TBK/qklUIaKgM4qG9rnBCyCOeydCjFmzN+pZcixnN?=
 =?iso-8859-7?Q?3NSVGywJCaU1vzrBRFPVPbViGDky2w4U3f7Aj+4CAiV30XAb/el0FsWWSO?=
 =?iso-8859-7?Q?ytq3qceGeOiw+iF/wqF81I8IxvPkyGI99g3sDt9rf6yydRikqcY6r6/KID?=
 =?iso-8859-7?Q?M7YNrxsTRf6zdc3j9zKc4WQ4lBLdCoGuTcfuLXfpeHuwZMlJbgGdHjS0st?=
 =?iso-8859-7?Q?TDunbMO7ZF0ane7CAjCc6C86dm+rgpfznbWXc/pgTM7A1U7Blb0JWfWvrI?=
 =?iso-8859-7?Q?flLSyXC82QJyw1AvHEZJgTaUNp4YQvfrMeaXAZztfPwrqerB0ibNEhDlKi?=
 =?iso-8859-7?Q?d+guuC2t2l80sC7Y3TU6rrj9bc3YK4iQn2kl9qd+O8FXLQRNOkWa3Yc/oE?=
 =?iso-8859-7?Q?WtEPtCjQXZ9EPWUmxltTbTpsKlhaMS/R/MuK5A=3D=3D?=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:MN2PR05MB6766.namprd05.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1102
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?iso-8859-7?Q?YW5TZEnxSYrEjpqMKexHPE4mw/DrS9c6Kzk+5GPsqYQyVWs+IT/rNfu/AZ?=
 =?iso-8859-7?Q?6BmsJSQZq6jLwBhhZJW+RNoWlekBhy18AtepbZCrfEZGoxL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SJW0cbkp2QfjX3gc3ga2001YirS41Q3XRQ06y4zvMkrLkBKdvQydkCjTffj5X2dtM9Iucb2dTwY4Oq0jXgj9xOob0Tjbm9rOVZ/DnWgQEzRFFeSGINCKUkW4lLjO9xaKJUqxyG12I2icb0ykf4INqF6winaMJQTIb3fEUlZyOdj7hGIjcMSyXH0V5H2G+Eqg9InMyrhl58tyblxb1hRRJy0CZUFJSTRYGjon3yoerwp3+kbDVRuUyDWgXNGW64ocu6maZJS4Hbhjs1n0DCnayEtSwWMNSHpERPjJu1Qba1pCcThNpL/whVZhSVbYCAMLj3u7t/K2UGk+scpFHHRAukf87/LSyjUfuZ9+Ziauzy6iwloiH8slgJ38bR58vk/wg6qqmMdGU+XOHuuIXNVU2qCtOFMLV0EUcSJgdDvD9xEtBWREeAY8sZ0yHpGtk4IVMXIaR1C0V+7EfNfBVl/cNfQbPk6hI5m6xCve+35sSwlf6A6nrxMFKEH+z1t5134C/UfwZ6RZS3YBzsB
X-OriginatorOrg: mathworks.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: MN2PR05MB6766.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a72c340-f0dc-4b08-8466-08dcd57f157b
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2024 12:08:17.7394 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 99dd3a11-4348-4468-9bdd-e5072b1dc1e6
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: cihsb/hV1w1Mpb1Bue3NdjV/Om+tFDdQ36KFnn7JsyV6cFIO3Nv28I7FmHxsoG5TV0aQL5L685mAGRVpgToZvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR05MB10028
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: mathworks.com
Content-Language: en-US
Content-Type: multipart/alternative;
 boundary="_000_MN2PR05MB676630F8B5B626E5EDA991FCD1672MN2PR05MB6766namp_"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 73206
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--_000_MN2PR05MB676630F8B5B626E5EDA991FCD1672MN2PR05MB6766namp_
Content-Type: text/plain; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable

Thanks for catching my typo and for moving the fix along.
________________________________
From: Robert Pluim <rpluim@HIDDEN>
Sent: Friday, September 13, 2024 3:43 AM
To: 73206 <at> debbugs.gnu.org <73206 <at> debbugs.gnu.org>
Cc: John Ciolfi <ciolfi@HIDDEN>
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent=
 correctly, nxml-mode.el

>>>>> On Thu, 12 Sep 2024 13:53:26 -0400, John Ciolfi via "Bug reports for =
GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> sa=
id:

    John> 1. Create foo.xml containing:

    John> <foo>
    John>     <!--
    John>         foo

    John> bar
    -->
    John> </foo>

    John> Notice that we have a blank line in the xml comment.

    John> 2. Put the point on 'bar' and press TAB.

    John> Notice that the 'bar' line is not indented correctly.

    John> Solution
    John> --------

    John> The problem is that in nxml-compute-indent-in-delimited-token, th=
ere
    John> is a (forward-line -1) which assumes that the prior line is inden=
ted. In
    John> this case the prior line is a blank line and thus doesn't have
    John> indentation. After the (forward-line -1), we need to keep going b=
ack
    John> until we see a non-blank line:

    John>           (forward-line -1)
    John> +           (while (looking-at "^[:blank:]*$")
    John> +          (forward-line -1))

    John> Attached is a patch for nxml-mode.el that fixes the issue.

Your patch does the right thing, but for the wrong reasons. Regexp
character classes only have meaning with a bracket expression, so what
you=A2re matching here is actually any lines containing zero or more of
':', 'b', 'l', 'a', 'n', or 'k'. IOW, you should use:

     (looking-at "^[[:blank:]]*$")

Robert
--


--_000_MN2PR05MB676630F8B5B626E5EDA991FCD1672MN2PR05MB6766namp_
Content-Type: text/html; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
7">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Thanks for catching my typo and for moving the fix along.</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Robert Pluim &lt;rplu=
im@HIDDEN&gt;<br>
<b>Sent:</b> Friday, September 13, 2024 3:43 AM<br>
<b>To:</b> 73206 <at> debbugs.gnu.org &lt;73206 <at> debbugs.gnu.org&gt;<br>
<b>Cc:</b> John Ciolfi &lt;ciolfi@HIDDEN&gt;<br>
<b>Subject:</b> Re: bug#73206: 28.2; xml comment with blank lines to do not=
 indent correctly, nxml-mode.el</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">&gt;&gt;&gt;&gt;&gt; On Thu, 12 Sep 2024 13:53:26 =
-0400, John Ciolfi via &quot;Bug reports for GNU Emacs, the Swiss army knif=
e of text editors&quot; &lt;bug-gnu-emacs@HIDDEN&gt; said:<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; 1. Create foo.xml containing:<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; &lt;foo&gt;<br>
&nbsp;&nbsp;&nbsp; John&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--<br>
&nbsp;&nbsp;&nbsp; John&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 foo<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; bar<br>
&nbsp;&nbsp;&nbsp; --&gt; <br>
&nbsp;&nbsp;&nbsp; John&gt; &lt;/foo&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; Notice that we have a blank line in the xml com=
ment.<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; 2. Put the point on 'bar' and press TAB.<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; Notice that the 'bar' line is not indented corr=
ectly.<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; Solution<br>
&nbsp;&nbsp;&nbsp; John&gt; --------<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt; The problem is that in nxml-compute-indent-in-d=
elimited-token, there<br>
&nbsp;&nbsp;&nbsp; John&gt; is a (forward-line -1) which assumes that the p=
rior line is indented. In<br>
&nbsp;&nbsp;&nbsp; John&gt; this case the prior line is a blank line and th=
us doesn't have<br>
&nbsp;&nbsp;&nbsp; John&gt; indentation. After the (forward-line -1), we ne=
ed to keep going back<br>
&nbsp;&nbsp;&nbsp; John&gt; until we see a non-blank line:<br>
<br>
&nbsp;&nbsp;&nbsp; John&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp; (forward-line -1)<br>
&nbsp;&nbsp;&nbsp; John&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; (while (looking-at &quot;^[:blank:]*$&quot;)<br>
&nbsp;&nbsp;&nbsp; John&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; (forward-line -1))<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; John&gt; Attached is a patch for nxml-mode.el that fixes=
 the issue. <br>
<br>
Your patch does the right thing, but for the wrong reasons. Regexp<br>
character classes only have meaning with a bracket expression, so what<br>
you=A2re matching here is actually any lines containing zero or more of<br>
':', 'b', 'l', 'a', 'n', or 'k'. IOW, you should use:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; (looking-at &quot;^[[:blank:]]*$&quot;)<br>
<br>
Robert<br>
-- <br>
<br>
</div>
</span></font></div>
</body>
</html>

--_000_MN2PR05MB676630F8B5B626E5EDA991FCD1672MN2PR05MB6766namp_--





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.

Message received at 73206 <at> debbugs.gnu.org:


Received: (at 73206) by debbugs.gnu.org; 13 Sep 2024 07:44:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 13 03:44:28 2024
Received: from localhost ([127.0.0.1]:42370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sp0yi-0003Ll-EQ
	for submit <at> debbugs.gnu.org; Fri, 13 Sep 2024 03:44:28 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:61499)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1sp0yg-0003LV-ET
 for 73206 <at> debbugs.gnu.org; Fri, 13 Sep 2024 03:44:27 -0400
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-42cafda818aso17349605e9.2
 for <73206 <at> debbugs.gnu.org>; Fri, 13 Sep 2024 00:44:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1726213391; x=1726818191; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=ofIUnE0WtgOwZtPllazQ5OIB5/Q81BxV1kOTkSgaVNQ=;
 b=K2ITlYFdfW68QRWry05nTSjaBPCfFZVRc/3R7mrPqIGpQ/mRSgq8T7COV1vyrHpH+i
 +oMmDpXnAaolNG8EY9bj8GsgP8tTLTeSY19lHUClnel4aIhXKl49GhLVfLrHHZuiR6XJ
 gjXwu0yDzERCqdDk3U4cjEYdt0sl15XXhutk+s+q2eb7w0WXMe7JeQs9z3w2ZZhX/ZiF
 rCLMMR68vYVvHcdvxirkL61RJ1Wyt4rK3QsdUT/efKX+SSI/qnl/y/xvTskfqgJHzMGB
 fqDCF4dkOHSIABrSu+C764ierOLqSvDwLrf1HR6AAOyOTLIoAPyFcKDGmzBL+eCmC0mH
 D/1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726213391; x=1726818191;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=ofIUnE0WtgOwZtPllazQ5OIB5/Q81BxV1kOTkSgaVNQ=;
 b=GIGGfirkGl8rBTZ2dTldmRw3XdfeQfXlpwRC1xB6r5OAtVIa2eVgOJya5uMjTmdL+u
 CrMIkXG6H9PxCeJ5pe92d5kpGnRiLVjBXNvh5GgdW4/FgJj92y7/Ki/HCxvz4Q1aL5mN
 F1fDiUz2UsfMvkPLcQFNda2R9yRgewZNAT1XCFIfeDJtLKLI3EAQoZ8KdNG8U9xeTcZq
 wFuheEouxtLCTymMyUc7fD41t+qlnTF7Izv31HOuRbQhuyp0UfzvnjXE6xxapoaHgU1L
 dFq9NhuQSzR+I8kO9UQP4URbuGk7XcKkQCVXSR/XMdHngbrR/k8zkInkrQqAEY/A34Tc
 tDNQ==
X-Gm-Message-State: AOJu0YxZ4ZAgWPQRiCsT3zbjRp8v3aL421rbgiE8OD4ZuuCN1yYoCrni
 2WpBU5Bo46U6UlTI0gPAEvBtJAQXLwzC962Rf3eT80ivRqpTKNqo
X-Google-Smtp-Source: AGHT+IHCC/1RMyIRKAQ3Y8fcAvblYqP7D/k8cUh35e/z5opwtMxUYJLi1SYBOPo8LYdrtBBrXqAeMg==
X-Received: by 2002:a05:6000:401f:b0:371:7e3f:6cc with SMTP id
 ffacd0b85a97d-378c2cfec94mr3711706f8f.9.1726213391004; 
 Fri, 13 Sep 2024 00:43:11 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb51:b06c:5c59:1e31:5a35])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-378956650fdsm16139245f8f.25.2024.09.13.00.43.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 13 Sep 2024 00:43:10 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: 73206 <at> debbugs.gnu.org
Subject: Re: bug#73206: 28.2; xml comment with blank lines to do not indent
 correctly, nxml-mode.el
In-Reply-To: <r9seu4vjvt.fsf@HIDDEN> (John Ciolfi via's message of
 "Thu, 12 Sep 2024 13:53:26 -0400")
References: <r9seu4vjvt.fsf@HIDDEN>
Date: Fri, 13 Sep 2024 09:43:09 +0200
Message-ID: <87h6akknhu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 73206
Cc: ciolfi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Thu, 12 Sep 2024 13:53:26 -0400, John Ciolfi via "Bug reports for =
GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> sa=
id:

    John> 1. Create foo.xml containing:

    John> <foo>
    John>     <!--
    John>         foo

    John> bar
    -->=20
    John> </foo>

    John> Notice that we have a blank line in the xml comment.

    John> 2. Put the point on 'bar' and press TAB.

    John> Notice that the 'bar' line is not indented correctly.

    John> Solution
    John> --------

    John> The problem is that in nxml-compute-indent-in-delimited-token, th=
ere
    John> is a (forward-line -1) which assumes that the prior line is inden=
ted. In
    John> this case the prior line is a blank line and thus doesn't have
    John> indentation. After the (forward-line -1), we need to keep going b=
ack
    John> until we see a non-blank line:

    John>  	   (forward-line -1)
    John> +           (while (looking-at "^[:blank:]*$")
    John> +	     (forward-line -1))
=20
    John> Attached is a patch for nxml-mode.el that fixes the issue.=20

Your patch does the right thing, but for the wrong reasons. Regexp
character classes only have meaning with a bracket expression, so what
you=CA=BCre matching here is actually any lines containing zero or more of
':', 'b', 'l', 'a', 'n', or 'k'. IOW, you should use:

     (looking-at "^[[:blank:]]*$")

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Sep 2024 18:03:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 12 14:03:21 2024
Received: from localhost ([127.0.0.1]:41887 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sooA4-0000DQ-36
	for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 14:03:21 -0400
Received: from lists.gnu.org ([209.51.188.17]:33484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ciolfi@HIDDEN>) id 1soo2F-0008Du-6m
 for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 13:55:16 -0400
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 <ciolfi@HIDDEN>)
 id 1soo26-00011f-1K
 for bug-gnu-emacs@HIDDEN; Thu, 12 Sep 2024 13:55:06 -0400
Received: from us-smtp-delivery-120.mimecast.com ([170.10.129.120])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ciolfi@HIDDEN>)
 id 1soo22-0006eP-84
 for bug-gnu-emacs@HIDDEN; Thu, 12 Sep 2024 13:55:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathworks.com;
 s=mimecast20180117; t=1726163701;
 h=from:from:reply-to:reply-to:subject:subject:date:date:
 message-id:message-id:to:to:cc:mime-version:mime-version:
 content-type:content-type; bh=vB4EGaOyAEydtZcT6Xisu5N9OuISHXqAx+9Rne02hLI=;
 b=Z/UR+YTGqlOg87vBfCIcWha+BIR6zfWDFtczFj9zuOQ5TKMlkeH95cJbP7fggl8vfi3H+S
 g43biyQlf+aARUHFwsTSLQ+vimUZHZEsL8RwGF6EUo3fsBcPH66MSbp/Oyi2TpxzaYGXPP
 XkNd77qjmK8kHr+W/iWNIdRYxYh3dSA=
Received: from DM1PR04CU001.outbound.protection.outlook.com
 (mail-centralusazlp17010007.outbound.protection.outlook.com [40.93.13.7])
 by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-12-cWPxfctXN_21L25BxK1McQ-1; Thu, 12 Sep 2024 13:53:48 -0400
X-MC-Unique: cWPxfctXN_21L25BxK1McQ-1
Received: from DM6PR04CA0009.namprd04.prod.outlook.com (2603:10b6:5:334::14)
 by SN7PR05MB7757.namprd05.prod.outlook.com (2603:10b6:806:f6::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.18; Thu, 12 Sep
 2024 17:53:43 +0000
Received: from DS1PEPF0001709C.namprd05.prod.outlook.com
 (2603:10b6:5:334:cafe::4c) by DM6PR04CA0009.outlook.office365.com
 (2603:10b6:5:334::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.24 via Frontend
 Transport; Thu, 12 Sep 2024 17:53:43 +0000
X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is
 144.212.100.35) smtp.mailfrom=mathworks.com; dkim=none (message not signed)
 header.d=none;dmarc=fail action=oreject header.from=mathworks.com
Received: from exedge.mathworks.com (144.212.100.35) by
 DS1PEPF0001709C.mail.protection.outlook.com (10.167.18.106) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7918.13 via Frontend Transport; Thu, 12 Sep 2024 17:53:43 +0000
Received: from EX1901AH.mathworks.com (172.31.53.42) by
 EX19EDGE00AH.mathworks.com (172.31.187.34) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.1544.11; Thu, 12 Sep 2024 13:54:39 -0400
Received: from EX1901AH.mathworks.com (172.31.53.42) by EX1901AH.mathworks.com
 (172.31.53.42) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 12 Sep
 2024 13:53:26 -0400
Received: from mail-vif.mathworks.com (144.212.95.101) by
 EX1901AH.mathworks.com (172.31.53.42) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.1544.11 via Frontend Transport; Thu, 12 Sep 2024 13:53:26 -0400
Received: from ah-ciolfi-l.dhcp.mathworks.com (ah-ciolfi-l.dhcp.mathworks.com
 [172.21.82.138])
 by mail-vif.mathworks.com (8.14.7/8.14.7) with ESMTP id 48CHrQKO000971;
 Thu, 12 Sep 2024 13:53:26 -0400
Received: from ah-ciolfi-l.dhcp.mathworks.com (localhost [127.0.0.1])
 by ah-ciolfi-l.dhcp.mathworks.com (8.17.1.9/8.17.1.9/Debian-2+deb12u2) with
 ESMTP id 48CHrQ7h1859260; Thu, 12 Sep 2024 13:53:26 -0400
Received: (from ciolfi@localhost)
 by ah-ciolfi-l.dhcp.mathworks.com (8.17.1.9/8.17.1.9/Submit) id
 48CHrQ461859248; Thu, 12 Sep 2024 13:53:26 -0400
X-Authentication-Warning: ah-ciolfi-l.dhcp.mathworks.com: ciolfi set sender to
 ciolfi@HIDDEN using -f
From: John Ciolfi <ciolfi@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 28.2; xml comment with blank lines to do not indent correctly,
 nxml-mode.el
Date: Thu, 12 Sep 2024 13:53:26 -0400
Message-ID: <r9seu4vjvt.fsf@HIDDEN>
MIME-Version: 1.0
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS1PEPF0001709C:EE_|SN7PR05MB7757:EE_
X-MS-Office365-Filtering-Correlation-Id: e9d5b2e5-8d83-46d5-0361-08dcd353d793
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
 ARA:13230040|36860700013|1800799024|82310400026|376014
X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?hnI12EtSu7nH+YGTmTZ97JDMG26MtQsRUIcMuB803sp9/pAxE97R5/95alfN?=
 =?us-ascii?Q?4p3TssOvnZE78m62avEvBH6+K6n2lnuJtZorbogLiM+fN0EPoF89KW7oBRVg?=
 =?us-ascii?Q?QwGI+l/pwrh9RUe6ZYjq9/jjj4sajr1WyZdQcX+ztr73PI5gaxRFNMCFnpdW?=
 =?us-ascii?Q?MLRtBw2yMdU/iJ3ZLXCAnwnOCr4zzTnhh0Zxg993/sWq9qu70jwOymgC6CoO?=
 =?us-ascii?Q?5eIqBTynp1QTv/lBv9RzYSJ0+6asnlKA4cdIjg8vObyujtZ2l+xjt3RPLCZR?=
 =?us-ascii?Q?D5T2UosDbLp37twoNpx52IA3wrPJzoHhGaVZosM4PJG9XbdHXa57ETG5Imt3?=
 =?us-ascii?Q?MqsGF+MuUVT30ZU66NLnYGvLzntICdYNiSvGylUtefPZNQlqYumCb5iaiwNu?=
 =?us-ascii?Q?eukMUhoZYhiBtAxgsDsZMw4y4xmWQ/7G1ICjyL0XCp0rMGFDSxRQIDRd7nso?=
 =?us-ascii?Q?SL8BRv4BS85zCFCzIndCyNvaE7YGPal9QzG1cWnwHviEq42FW/1l9DnWY3m+?=
 =?us-ascii?Q?fBD9svFQ4mEcdp+gAacmljmGPQ+btDw+Bliu637/zozxm6iK9ufm6j7t9Mcw?=
 =?us-ascii?Q?gbsVKfmg6RyJgO+ioX1PEycQQRfX1m62YRyFYSHxg6smeU04b8vLBjkKJVw4?=
 =?us-ascii?Q?h+AcE4KWN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
 IPV:NLI; SFV:NSPM; H:exedge.mathworks.com; PTR:mxgw-ah.mathworks.com; CAT:NONE;
 SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT;
 SFP:1102
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: NAUaI/QMrG7tzGvuVj0DReHHRZT3DiZkYBxTP4IBHaO8PsTLXDM1pSzh1APZJvBwbfJXEwOa7+K1Y5GhOEjSkL3malWGu9XuHbf6PynaEDjcOXXE2/E5mvr68ZTyt4qDutIXmwtZYmS3jyLOh8lZh606schGV2fnk1guUFlJMpps0UWerkxbrqiag39GHO70TbLnFnBVpe6nWjmWDw5x9C0ZTKs8R5XXv1HJo+3nuFWHG3K39Y6pV6rhYndE2+GDavBDpC2ZnlaxOWIvQeD0cokA/E9MmfKbrguXGtspZvTf1mTv6Xo6QuB/wYVFbsqhkxlXsu0L/y1KnAPAvAMhsAiO0M8pMY6e3KKt8sPUGapCfMsFYEpfToaq1kYqNsmI1L52JW7A045AGbUpX3cT8wFly6AQirVlNVsBR43EdrW7XLxHNYsyblyLJnQO1GUhJql7sCd36r98TL2OpqlS8HWefOHw3nsDkn01AgaQOkRNOv/1Z/XeoxZ4y8hmpgzM3bxjWlRq68F+Im6kzZecibBoVf8RNsMnixI2g/t2/16BwfaiK7VmyHZ74vWcazKG+E6ozLrEaX2wABPar468ri+tyxfu7i6QD51tguvzMFQ=
X-OriginatorOrg: mathworks.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 17:53:43.0687 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e9d5b2e5-8d83-46d5-0361-08dcd353d793
X-MS-Exchange-CrossTenant-Id: 99dd3a11-4348-4468-9bdd-e5072b1dc1e6
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=99dd3a11-4348-4468-9bdd-e5072b1dc1e6; Ip=[144.212.100.35];
 Helo=[exedge.mathworks.com]
X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709C.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR05MB7757
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: mathworks.com
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=170.10.129.120; envelope-from=ciolfi@HIDDEN;
 helo=us-smtp-delivery-120.mimecast.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,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 12 Sep 2024 14:03:17 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: ciolfi@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable


1. Create foo.xml containing:

<foo>
    <!--
        foo

bar
    -->
</foo>

Notice that we have a blank line in the xml comment.

2. Put the point on 'bar' and press TAB.

Notice that the 'bar' line is not indented correctly.

Solution
--------

The problem is that in nxml-compute-indent-in-delimited-token, there
is a (forward-line -1) which assumes that the prior line is indented. In
this case the prior line is a blank line and thus doesn't have
indentation. After the (forward-line -1), we need to keep going back
until we see a non-blank line:

 =09   (forward-line -1)
+           (while (looking-at "^[:blank:]*$")
+=09     (forward-line -1))

Attached is a patch for nxml-mode.el that fixes the issue.=20

Thanks
John

In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cair=
o version 1.16.0)
 of 2024-06-25, modified by Debian built on x86-conova-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12101006
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:=
/usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share=
/emacs/site-lisp
 --with-sound=3Dalsa --without-gconf --with-mailutils
 --with-native-compilation --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:=
/usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share=
/emacs/site-lisp
 --with-sound=3Dalsa --without-gconf --with-mailutils
 --with-native-compilation --with-cairo --with-x=3Dyes
 --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2
 -ffile-prefix-map=3D/build/reproducible-path/emacs-28.2+1=3D. -fstack-prot=
ector-strong
 -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time
 -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 68059 5432)
 (symbols 48 6639 0)
 (strings 32 19490 1559)
 (string-bytes 1 664189)
 (vectors 16 13926)
 (vector-slots 8 297636 11873)
 (floats 8 22 31)
 (intervals 56 258 0)
 (buffers 992 10))


--=-=-=
Content-Type: text/x-diff; name=nxml-mode.el.patch; charset=WINDOWS-1252
Content-Disposition: inline; filename="nxml-mode.el.patch"
Content-Description: nxml-mode.el.patch
Content-Transfer-Encoding: quoted-printable

--- ./orig/nxml-mode.el=092024-09-12 09:10:46.580451579 -0400
+++ nxml-mode.el=092024-09-12 09:04:48.473571128 -0400
@@ -1522,6 +1522,8 @@
 =09((progn
 =09   (goto-char pos)
 =09   (forward-line -1)
+           (while (looking-at "^[:blank:]*$")
+=09     (forward-line -1))
 =09   (<=3D (point) xmltok-start))
 =09 (goto-char (+ xmltok-start (length open-delim)))
 =09 (when (and (string=3D open-delim "<!--")

--=-=-=--





Acknowledgement sent to ciolfi@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#73206; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.