GNU bug report logs - #75884
29.4; Dash character "-" appears as diff when it is the leading character in a line in a patch

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; Severity: minor; Reported by: Husain Alshehhi <husain@HIDDEN>; dated Mon, 27 Jan 2025 03:41:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 75884) by debbugs.gnu.org; 8 Feb 2025 21:14:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 16:14:59 2025
Received: from localhost ([127.0.0.1]:41704 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tgsAE-0005Gw-Mg
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2025 16:14:58 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:47366)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1tgsAA-0005GZ-SC
 for 75884 <at> debbugs.gnu.org; Sat, 08 Feb 2025 16:14:56 -0500
DKIM-Signature: a=rsa-sha256;
 b=Fo5qalLFSPVo+CjttUTS06kohsfRfnzPKBU4YbX4TgOv/rlpxwUtQFoioFdsks/zuppnG+oES+me+/RCNlpHM20sEuhYm9Sw/ULBSOpKKUwhYjyD1n6Cc57Av9oR18TZKuVNGc1PL4ZAlAuIj8nkRdVH6WcPlQ91RHJevfD9hr9X781532glvG5yILebZ3Fs/VXAMAkNrgoWaraZhm1sW6Fo0lmlwjeIY8zws27Waz7qJ7u37IlGkRexqyNbEZJUSOQhDnyluQnis3K07YtlNN6S2grSoV1ZRGrqQFUQ6Qp1nLK4BkOguOse7CujoOItFcBlwynoxn3YkPZQZiM3AQ==;
 s=purelymail2; d=spwhitton.name; v=1;
 bh=thC0dzlgZbh4QqWcC0Ndd2t8Nwg1+F2Y9jRpGyhthgQ=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=ZG2hLpJIJ2TPvzBJ7U6vw/bMUMjuemddXDMrqRVq9QT+ZbvhXpIQZq9pek6Y8JobBL9iXTbJaS86aPumzZV3XRaTavHwQ0GXre5bsLcPVeoqMOOP3Ss2pHydUXVx5T4eUEIaro4otx3LBNRRvfu8jzxHdIRb8FjdG+t6BKnPUXA00g3mxQwh3aSrjCfI59lTVvAKk9FhFC6mPYZS27kH9WFnRILSlyElxaYkcdPZqhCpeUQRCvcoFh9uQeLoiKfs6IflVxuXap3SZ2eGxF+3UiDvLISFN05jWzAv0xdG9AlhYZmhuO9JAot0T/T5xxUpNMRiGjVAaBadD9Iz3wsr9w==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=thC0dzlgZbh4QqWcC0Ndd2t8Nwg1+F2Y9jRpGyhthgQ=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 75884 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1515758124; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sat, 08 Feb 2025 21:14:45 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id 2C3CB7E087E; Sat,  8 Feb 2025 21:14:44 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
In-Reply-To: <875xlkuy3c.fsf@HIDDEN> (Juri Linkov's message of "Sat, 
 08 Feb 2025 19:58:23 +0200")
References: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN>
 <86r0483hom.fsf@HIDDEN> <8734go1uyt.fsf@HIDDEN>
 <875xlkuy3c.fsf@HIDDEN>
Date: Sat, 08 Feb 2025 21:14:44 +0000
Message-ID: <87frkoyw8r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75884
Cc: Husain Alshehhi <husain@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 75884 <at> debbugs.gnu.org
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 (-)

Hello,

On Sat 08 Feb 2025 at 07:58pm +02, Juri Linkov wrote:

>> For patches generated by git, indeed, anything before the first hunk
>> should not be fontified as though it were a patch.
>>
>> Similarly we should look for a "-- " line at the end of the message and
>> treat it as an e-mail signature.
>
> Completely agree.
>
>> But one question I immediately have is how much of this is Git-specific.
>> Is there some specification of the unified diff format anywhere?
>>
>> Could there be non-Git unidifed diffs this would break?
>
> There is already some Git-specific code in diff-mode that depends
> on 'diff-buffer-type' being equal to 'git' such as in
> 'diff-prev-line-if-patch-separator'.  This could be used
> also to exclude font-locking from header (anything until
> the first line , i.e. `(re-search-forward "^diff --git" nil t)`)
> and footer (anything after `(looking-at "^-- $")`).

Okay.  Then I think we know what is needed here.

-- 
Sean Whitton




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

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


Received: (at 75884) by debbugs.gnu.org; 8 Feb 2025 18:04:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 13:04:53 2025
Received: from localhost ([127.0.0.1]:41354 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tgpCH-0001bd-JG
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2025 13:04:53 -0500
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:45347)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tgpCE-0001bI-Ux
 for 75884 <at> debbugs.gnu.org; Sat, 08 Feb 2025 13:04:52 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 801E24445B;
 Sat,  8 Feb 2025 18:04:40 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
In-Reply-To: <8734go1uyt.fsf@HIDDEN>
Organization: LINKOV.NET
References: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN>
 <86r0483hom.fsf@HIDDEN> <8734go1uyt.fsf@HIDDEN>
Date: Sat, 08 Feb 2025 19:58:23 +0200
Message-ID: <875xlkuy3c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefvdeklecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledrleeirdeltdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledrleeirdeltddphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeehpdhrtghpthhtohepjeehkeekgeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegumhhithhrhiesghhuthhovhdruggvvhdprhgtphhtthhopehhuhhsrghinhesrghlshhhvghhhhhirdhiohdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 75884
Cc: Husain Alshehhi <husain@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 75884 <at> debbugs.gnu.org
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.7 (-)

> For patches generated by git, indeed, anything before the first hunk
> should not be fontified as though it were a patch.
>
> Similarly we should look for a "-- " line at the end of the message and
> treat it as an e-mail signature.

Completely agree.

> But one question I immediately have is how much of this is Git-specific.
> Is there some specification of the unified diff format anywhere?
>
> Could there be non-Git unidifed diffs this would break?

There is already some Git-specific code in diff-mode that depends
on 'diff-buffer-type' being equal to 'git' such as in
'diff-prev-line-if-patch-separator'.  This could be used
also to exclude font-locking from header (anything until
the first line , i.e. `(re-search-forward "^diff --git" nil t)`)
and footer (anything after `(looking-at "^-- $")`).




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

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


Received: (at 75884) by debbugs.gnu.org; 8 Feb 2025 12:28:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 07:28:57 2025
Received: from localhost ([127.0.0.1]:39012 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tgjxA-000615-QO
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2025 07:28:57 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:58350)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1tgjx7-00060k-H1
 for 75884 <at> debbugs.gnu.org; Sat, 08 Feb 2025 07:28:55 -0500
DKIM-Signature: a=rsa-sha256;
 b=eJesyoWZ8z/2CiVEoZl/T3LZz/oRkkshXjipvqQnfRt6KrpuRAqf5PBon/suxy5dS+Hk6DK4OtjQh3hlYxAZyIVy9wmZaMq8kriWVcL/vWOCb3J5F4hK3N5lN0RDkYkAMRe6Q1SCMb7Q6+g6XerJmmwvYPzl0DD46thWUFZvlWBm6eNgAKlSCl0tJ4DeCRyA9TiVVda+k1J23vvue9kN5LFx5xlz47rsXz0nZjBcQX5S5tBCA8WEe7ogGwI7adBWAAEqtvBDTcRU/S7oQtvThVn/JlCNhYnGKR3aC7OCAcFO4REOBldMeFLXB2o+V17es5fppgkjVxq/RgJ2jHuj1g==;
 s=purelymail2; d=spwhitton.name; v=1;
 bh=l2flADKO0NZxbFjMTt//7+0b1yq2pLvGK+TIbLy58wE=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=QQufNBoz6X4dcrMps7eRq6YfGBRmENPMpoCJWThR2sVBq93hjL126rxk0TiX+gilFWECLXM0cVH96/AOVzVlHhArfRIiPi+UoIVUBvTK9YMPxU2sKZrucGlwfD/PHtFhX4LEOQX7qMzdjGlc2Mmbc2a770N2ujRRwUv6DMHTyemWeT7uV9LCpP6jrwUiTPZI+VQVE552vJKJPaZCw2WZzaXryjXP6ifVf/p5gSVJ8t618a8ejLVO7GE6CoOHeamQpLQZfNWzfupgoIZk0b9Podxu6ISafYaAr9kG3ULdIO9hG/xjqCcrZox6oMGqbvoELb45SwoAHrqb6AhfKMc8sw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=l2flADKO0NZxbFjMTt//7+0b1yq2pLvGK+TIbLy58wE=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 75884 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1493055302; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sat, 08 Feb 2025 12:28:44 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id DB0A47E1CDF; Sat,  8 Feb 2025 12:28:42 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
In-Reply-To: <86r0483hom.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 08 Feb
 2025 11:32:41 +0200")
References: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN>
 <86r0483hom.fsf@HIDDEN>
Date: Sat, 08 Feb 2025 12:28:42 +0000
Message-ID: <8734go1uyt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75884
Cc: Husain Alshehhi <husain@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>,
 75884 <at> debbugs.gnu.org, Juri Linkov <juri@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 (-)

Hello,

On Sat 08 Feb 2025 at 11:32am +02, Eli Zaretskii wrote:

>> Date: Sun, 26 Jan 2025 21:39:35 -0600
>> From: Husain Alshehhi <husain@HIDDEN>
>>
>> diff-mode does not handle a patch very well. In particular, if a patch
>> contains the commit message, and if the commit message contains a dash
>> character "-" at the beginning of a line, diff-mode interprets this as a
>> diff rather than part of the commit message.
>>
>> To replicate this bug: copy the following in a file (e.g. test.patch),
>> open it in diff-mode, and you will see that the line "- unordered lists"
>> shows up in `diff-indicator-removed' face:
>
> I also see the final "--" line in that face, FWIW.
>
> Dmitry, Juri, Sean: any comments or suggestions?

For patches generated by git, indeed, anything before the first hunk
should not be fontified as though it were a patch.

Similarly we should look for a "-- " line at the end of the message and
treat it as an e-mail signature.

But one question I immediately have is how much of this is Git-specific.
Is there some specification of the unified diff format anywhere?

Could there be non-Git unidifed diffs this would break?

-- 
Sean Whitton




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

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


Received: (at 75884) by debbugs.gnu.org; 8 Feb 2025 09:33:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 04:33:34 2025
Received: from localhost ([127.0.0.1]:38544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tghDR-000616-J2
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2025 04:33:34 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:34460)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tghDN-00060p-Vc
 for 75884 <at> debbugs.gnu.org; Sat, 08 Feb 2025 04:33:31 -0500
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 1tghDH-00008e-F6; Sat, 08 Feb 2025 04:33:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=j03hQQTSrU9tfxLjd8/BrcPYWyzxZP+ThVIz5ITiywk=; b=r2649AmB9Wni
 izfYgWS50aij5Ut5H8H84uzrj9hsq2D6h7LfJTrlfJkvAF8jkyngsCWdoUyaz9OQjk8p6yYRTzlxq
 QeA8fIDyOulr6g5H0YaDGeBIwSPCiSQhaT7mXo7DVVQzE2+wA7S7M4wy7KeBcHQxh3lhuXO6HWQUq
 X0O5zI2ZUUpk/ms2uAdzlf/UsJqqsYa4DTIbxtgNOyn9ZJoSCzFLI52ob7S7NHcv/H8US3Bo/hPNF
 3SYxIXfbuJjZKt3IKiNRvZrWz8RmOP47OORZVeij9HZ/A7lA1DY41kR52KKCnYkUwf0vmyqX71lJ9
 IYbGf41EYReZtqE8geZjAA==;
Date: Sat, 08 Feb 2025 11:32:41 +0200
Message-Id: <86r0483hom.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Husain Alshehhi <husain@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>,
 Juri Linkov <juri@HIDDEN>, Sean Whitton <spwhitton@HIDDEN>
In-Reply-To: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN> (message from
 Husain Alshehhi on Sun, 26 Jan 2025 21:39:35 -0600)
Subject: Re: bug#75884: 29.4;
 Dash character "-" appears as diff when it is the leading character
 in a line in a patch
References: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 75884
Cc: 75884 <at> debbugs.gnu.org
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 (---)

> Date: Sun, 26 Jan 2025 21:39:35 -0600
> From: Husain Alshehhi <husain@HIDDEN>
> 
> diff-mode does not handle a patch very well. In particular, if a patch
> contains the commit message, and if the commit message contains a dash
> character "-" at the beginning of a line, diff-mode interprets this as a
> diff rather than part of the commit message.
> 
> To replicate this bug: copy the following in a file (e.g. test.patch),
> open it in diff-mode, and you will see that the line "- unordered lists"
> shows up in `diff-indicator-removed' face:

I also see the final "--" line in that face, FWIW.

Dmitry, Juri, Sean: any comments or suggestions?

> 
> --8<---------------cut here---------------start------------->8---
> From: me@HIDDEN
> Date: Thu, 01 Jan 2025 00:00:00 -0000
> Subject: [PATCH] Adding a comment
> 
> This is a commit to test emacs mode for displaying dash "-" character
> such as:
> 
> - unordered lists        << This will be displayed as a diff.
> - with multiple items    << So will this.
> 
> Emacs shows unordered lists as part of the diff because they start with
> "-".
> ---
>   main.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/main.c b/main.c
> index 5df43ae..43b62fa 100644
> --- a/main.c
> +++ b/main.c
> @@ -1,4 +1,5 @@
>   int main() {
> +  // adding a comment.
>     printf("hello world");
>     return 0;
>   }
> -- 
> 
> 2.47.1
> --8<---------------cut here---------------end--------------->8---
> 
> See
> https://lists.gnu.org/archive/html/help-gnu-emacs/2025-01/msg00229.html
> for reference.
> 
> 
> In GNU Emacs 29.4 (build 2, x86_64-suse-linux-gnu, GTK+ Version 3.24.43,
> cairo version 1.18.2)
> System Description: openSUSE Tumbleweed
> 
> Configured using:
>   'configure --disable-build-details --without-pop --with-mailutils
>   --with-native-compilation --without-hesiod --with-gameuser=:games
>   --with-kerberos --with-kerberos5 --with-file-notification=inotify
>   --with-modules --enable-autodepend --prefix=/usr
>   --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
>   --localstatedir=/var --sharedstatedir=/var/lib
>   --libexecdir=/usr/libexec --with-file-notification=yes
>   --libdir=/usr/lib64
>   --enable-locallisppath=/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
>   --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
>   --with-gif --with-png --with-rsvg --with-dbus --with-webp --with-xft
>   --with-imagemagick --without-gpm --with-x-toolkit=gtk3 --with-pgtk
>   --with-toolkit-scroll-bars --x-includes=/usr/include
>   --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo
>   --with-xwidgets --build=x86_64-suse-linux --with-dumping=pdumper
>   'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
>   -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
>   -fstack-clash-protection -Werror=return-type -flto=auto -g
>   -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS
>   -DGLIB_DISABLE_DEPRECATION_WARNINGS -pipe -Wno-pointer-sign
>   -Wno-unused-variable -Wno-unused-label -fno-optimize-sibling-calls
>   -DPDMP_BASE='\''"emacs-wayland"'\''' LDFLAGS=-Wl,-O2'
> 
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
> IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
> NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3
> THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
> 
> Important settings:
>    value of $LC_NUMERIC: POSIX
>    value of $LANG: en_US.UTF-8
>    value of $XMODIFIERS: @im=local
>    locale-coding-system: utf-8-unix
> 
> Major mode: Article
> 
> Minor modes in effect:
>    org-roam-db-autosync-mode: t
>    global-git-commit-mode: t
>    magit-auto-revert-mode: t
>    shell-dirtrack-mode: t
>    global-corfu-mode: t
>    corfu-mode: t
>    vertico-mode: t
>    which-key-mode: t
>    override-global-mode: t
>    tooltip-mode: t
>    global-eldoc-mode: t
>    show-paren-mode: t
>    electric-indent-mode: t
>    mouse-wheel-mode: t
>    file-name-shadow-mode: t
>    global-font-lock-mode: t
>    font-lock-mode: t
>    buffer-read-only: t
>    column-number-mode: t
>    line-number-mode: t
>    transient-mark-mode: t
>    auto-composition-mode: t
>    auto-encryption-mode: t
>    auto-compression-mode: t
> 
> Load-path shadows:
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat hides 
> /usr/share/emacs/site-lisp/compat
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-29 hides 
> /usr/share/emacs/site-lisp/compat-29
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-28 hides 
> /usr/share/emacs/site-lisp/compat-28
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-27 hides 
> /usr/share/emacs/site-lisp/compat-27
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-26 hides 
> /usr/share/emacs/site-lisp/compat-26
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-25 hides 
> /usr/share/emacs/site-lisp/compat-25
> /home/husain/.emacs.d/elpa/transient-20230919.2146/transient hides 
> /usr/share/emacs/29.4/lisp/transient
> /home/husain/.emacs.d/elpa/jsonrpc-1.0.24/jsonrpc hides 
> /usr/share/emacs/29.4/lisp/jsonrpc
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package hides 
> /usr/share/emacs/29.4/lisp/use-package/use-package
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-lint 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-lint
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-jump 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-jump
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-diminish
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-delight 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-delight
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-core 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-core
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-bind-key
> /home/husain/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides 
> /usr/share/emacs/29.4/lisp/use-package/bind-key
> /home/husain/.emacs.d/elpa/eglot-1.17/eglot hides 
> /usr/share/emacs/29.4/lisp/progmodes/eglot
> /home/husain/.emacs.d/elpa/eldoc-1.15.0/eldoc hides 
> /usr/share/emacs/29.4/lisp/emacs-lisp/eldoc
> 
> Features:
> (mailalias mailclient dabbrev mm-archive misearch multi-isearch shadow
> bbdb-message emacsbug mule-util smiley gnus-cite message-view-patch
> mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable
> textsec-check gnus-bcklg gnus-async sort gnus-ml disp-table
> cello-light-theme ef-cherie-theme ef-themes consult nndraft nnmh
> nnmaildir bbdb-gnus nnnil gnus-agent gnus-srvr gnus-score score-mode
> nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
> dig nntp gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
> dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
> gnus-int gnus-range gnus-win org-roam-protocol org-protocol
> org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
> org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
> org-roam-compat org-roam org-capture org-attach emacsql-sqlite
> emacsql-sqlite-common emacsql emacsql-compiler elfeed-show elfeed-search
> vc-git vc-dispatcher elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
> elfeed-lib url-queue xml-query erc-goodies erc iso8601 erc-backend
> erc-networks erc-common erc-compat erc-loaddefs bbdb-mua bbdb-com bbdb
> bbdb-site timezone gnus nnheader range org-noter org-noter-djvu
> org-noter-nov nov recentf tree-widget shr pixel-fill kinsoku url-file
> svg xml esxml-query dom org-noter-pdf org-noter-core pdf-tools cus-edit
> cus-load wid-edit pdf-view magit-bookmark bookmark pp jka-compr
> pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif ledger-mode
> ledger-check ledger-texi ledger-test ledger-sort ledger-report
> ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
> ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
> ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
> esh-io esh-arg esh-module esh-groups esh-util files-x ledger-context
> ledger-commodities ledger-regex scad-mode ox-gfm htmlize ob-latex ox-odt
> rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
> nxml-ns nxml-enc xmltok nxml-util ox-md ox-latex ox-icalendar ox-html
> table ox-ascii ox-publish ox org-habit org-agenda org-element
> org-persist xdg org-id org-refile org ob ob-tangle ob-ref ob-lob
> ob-table org-macro org-src ob-comint org-pcomplete org-list org-footnote
> org-faces org-entities noutline outline ob-emacs-lisp org-table org-keys
> org-loaddefs find-func avl-tree ol oc ob-exp ob-core org-cycle org-fold
> org-fold-core org-compat ob-eval org-version org-macs link-hint
> goto-addr avy cal-menu calendar cal-loaddefs ediff ediff-merg ediff-mult
> ediff-wind ediff-diff ediff-help ediff-init ediff-util git-link
> magit-submodule magit-blame magit-stash magit-reflog magit-bisect
> magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
> magit-sequence magit-notes magit-worktree magit-tag magit-merge
> magit-branch magit-reset magit-files magit-refs magit-status magit
> magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
> smerge-mode diff diff-mode git-commit log-edit message sendmail
> yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
> rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
> rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
> mail-utils gmm-utils mailheader pcvs-util add-log magit-core
> magit-autorevert autorevert filenotify magit-margin magit-transient
> magit-process with-editor time-date shell pcomplete server magit-mode
> transient magit-git magit-base magit-section format-spec cursor-sensor
> crm dash edmacro kmacro sqlformat reformatter go-mode find-file ffap
> thingatpt etags fileloop generator xref project scala-mode
> scala-mode-prettify-symbols scala-mode-imenu scala-mode-map
> scala-mode-fontlock scala-mode-indent scala-mode-paragraph
> scala-mode-syntax scala-mode-lib typescript-mode cc-mode cc-fonts
> cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
> compile text-property-search comint ansi-osc ring yaml-mode ansi-color
> exec-path-from-shell corfu orderless vertico compat diminish which-key
> use-package use-package-ensure use-package-delight use-package-diminish
> use-package-bind-key bind-key use-package-core finder-inf comp comp-cstr
> warnings icons rx cl-extra help-mode ispell bbdb-autoloads
> corfu-autoloads diminish-autoloads ef-themes-autoloads eglot-autoloads
> eldoc-autoloads elfeed-autoloads emacs-everywhere-autoloads
> embark-consult-autoloads consult-autoloads embark-autoloads
> exec-path-from-shell-autoloads f-autoloads ggtags-autoloads
> git-link-autoloads go-mode-autoloads htmlize-autoloads jsonrpc-autoloads
> ledger-mode-autoloads link-hint-autoloads marginalia-autoloads
> markdown-mode-autoloads magit-autoloads git-commit-autoloads
> modus-themes-autoloads nov-autoloads orderless-autoloads
> org-noter-autoloads org-roam-autoloads magit-section-autoloads
> emacsql-autoloads ox-gfm-autoloads pdf-tools-autoloads request-autoloads
> scad-mode-autoloads scala-mode-autoloads show-font-autoloads
> sqlformat-autoloads reformatter-autoloads standard-themes-autoloads
> tablist-autoloads transient-autoloads treemacs-autoloads
> posframe-autoloads ht-autoloads hydra-autoloads pfuture-autoloads
> ace-window-autoloads avy-autoloads s-autoloads dash-autoloads
> typescript-mode-autoloads use-package-autoloads bind-key-autoloads
> vertico-autoloads w3m-load w3m-autoloads which-key-autoloads
> with-editor-autoloads info compat-autoloads yaml-mode-autoloads
> auctex-autoloads tex-site package browse-url url url-proxy url-privacy
> url-expand url-methods url-history url-cookie generate-lisp-file
> url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
> eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
> bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc delsel lpr
> easy-mmode pcase iso-transl tooltip cconv eldoc paren electric uniquify
> ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
> pgtk-win term/common-win pgtk-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 nadvice seq simple cl-generic indonesian philippine
> 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 abbrev obarray oclosure
> cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
> files window text-properties overlay sha1 md5 base64 format env
> code-pages mule custom widget keymap hashtable-print-readable backquote
> threads xwidget-internal dbusbind inotify dynamic-setting
> system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
> make-network-process native-compile emacs)
> 
> Memory information:
> ((conses 16 1306461 97685)
>   (symbols 48 47318 18)
>   (strings 32 522080 13600)
>   (string-bytes 1 26474941)
>   (vectors 16 262284)
>   (vector-slots 8 3657817 148039)
>   (floats 8 1262 501)
>   (intervals 56 4819 450)
>   (buffers 984 34))
> 
> 
> 
> 




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

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


Received: (at submit) by debbugs.gnu.org; 27 Jan 2025 03:40:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 26 22:40:14 2025
Received: from localhost ([127.0.0.1]:58637 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tcFyv-0004EN-UR
	for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 22:40:14 -0500
Received: from lists.gnu.org ([2001:470:142::17]:60062)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <husain@HIDDEN>)
 id 1tcFyt-00048m-Ac
 for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 22:40:12 -0500
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 <husain@HIDDEN>)
 id 1tcFyW-0002Mk-5X
 for bug-gnu-emacs@HIDDEN; Sun, 26 Jan 2025 22:39:54 -0500
Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <husain@HIDDEN>)
 id 1tcFyR-0005un-Sq
 for bug-gnu-emacs@HIDDEN; Sun, 26 Jan 2025 22:39:47 -0500
Received: from phl-compute-09.internal (phl-compute-09.phl.internal
 [10.202.2.49])
 by mailfout.stl.internal (Postfix) with ESMTP id 8DC751140192
 for <bug-gnu-emacs@HIDDEN>; Sun, 26 Jan 2025 22:39:37 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-09.internal (MEProxy); Sun, 26 Jan 2025 22:39:37 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alshehhi.io; h=
 cc:content-transfer-encoding:content-type:content-type:date:date
 :from:from:in-reply-to:message-id:mime-version:reply-to:subject
 :subject:to:to; s=fm1; t=1737949177; x=1738035577; bh=JUXUJcFQhG
 CqQzx5hkVIY81Dh1usUOKUsYix63eAtTk=; b=ICqYTt16OlCeOH4oD177Nc2Jp5
 VXM+bFv/Jd8QkewnkBv8oSO39jbJRidP5aiqzrunnBjgwkEnb+WQSlsPgbAKYDnN
 0sBLLQ3+0Ojw5WKUG1WGNmqaB4S0nsPa/TH7tePGG9vwRvUlWchkX5Tp4aXtbGB7
 eRMWoXRgb5lzE+GGIK0mymxQkIbUIEkEXjKr0g0fGya6Dm1YlECqRGR4860nQ7rG
 dwHEqswFjtgQJinglGeqAxbY2Nth2eq0S3uCMHnSwj3KWHbOylWw4ZqYdM23Wq/J
 SkHFGOC6FIu16qSz25NjzZ5KU1M+1Wtd6uMNphQi0ZjROfwWiCThwICPjmDA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:message-id:mime-version:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
 1737949177; x=1738035577; bh=JUXUJcFQhGCqQzx5hkVIY81Dh1usUOKUsYi
 x63eAtTk=; b=NZHnHTveiaknRyDmLl2JGvHcRkUrqNVn+z352z3hS9YgEXnZ+tT
 5YfTmctJg4BSbDVykUSuNKcxiXVpbDvmtyYvWXXHsYIv38LqXtA7pUUE1Fam4FDF
 Q/wKwa2skQm+cmIawIyctsg78pBtak43g4ESo9+pQKXA/p6KOHXrClUjNsSfx2DV
 ky3KBEmLWtynMkYy0ANyYMoirC+pkn8vNanlcSu0ZWgYAIoyeyl12jtibSEoVAgN
 UuV6MLNQ1WK43Lj6Ibz9O5DZ8GAWnSnqKFMVcEVlejvPoQsVNca4zv00IDY8XS6P
 1jimJM/U++AFIeCDVEYs5jtzJnZqzN+3YwA==
X-ME-Sender: <xms:-f-WZx63PF7O6fM2ihDhuw9jz0vkAG-NUp2Ee5DTpeEy8K12VZue6g>
 <xme:-f-WZ-4H_ccCKbWaTSCZ_YqndwiUFL9e2eB3VcNqlbJh-fZ5fKpSoPt4aZcDsHY3G
 QoaLLLZYCI7A3OjF1g>
X-ME-Received: <xmr:-f-WZ4eMpCZ0tRBH13GXeUpFSWthAtDPWYif5fwrp7dXOr8bgT-OcVoyC8uz51_lD9UVJ69E8c-EJMbwxf5m1ouiF8-32Kie_zIgiv3VJpPXMVBO9-hI0VJ94nM>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedguddvuddvucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
 pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff
 ggfgfvuffhtgfgsehtjeertddtvdejnecuhfhrohhmpefjuhhsrghinhcutehlshhhvghh
 hhhiuceohhhushgrihhnsegrlhhshhgvhhhhihdrihhoqeenucggtffrrghtthgvrhhnpe
 ejffekkeelffejteetleduveevleevudfhveeigefhffekteegudfgtefhgeejkeenucff
 ohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh
 epmhgrihhlfhhrohhmpehhuhhsrghinhesrghlshhhvghhhhhirdhiohdpnhgspghrtghp
 thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsghughdqghhnuhdqvg
 hmrggtshesghhnuhdrohhrgh
X-ME-Proxy: <xmx:-f-WZ6KLqC1lc-rGLCa1G5jVl__zgrFBgb5Q3BIObkmGd71I-0qi1g>
 <xmx:-f-WZ1LE0k8sk4vj-5SjJNgkafGCmm55ijBVPhTHQNbPmfpAxOnh2Q>
 <xmx:-f-WZzzfnfELA0Fl2gRvYb-I4aBxoDVsuF3EhI_xHq8UR0W5UnGglQ>
 <xmx:-f-WZxKGtfw7Ig8bqa2_nJZ6cijDxhCwER-OlCucLXlfyTF-olcHeg>
 <xmx:-f-WZzipNHlluifbCykiH_AvMvqoCaNRSVaTLkrwigD01ZGmoWkDIfbI>
Feedback-ID: ic2a949cb:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <bug-gnu-emacs@HIDDEN>; Sun, 26 Jan 2025 22:39:36 -0500 (EST)
Message-ID: <8d75daa2-a997-4cae-9a38-38003fa78877@HIDDEN>
Date: Sun, 26 Jan 2025 21:39:35 -0600
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: bug-gnu-emacs@HIDDEN
Subject: 29.4; Dash character "-" appears as diff when it is the leading
 character in a line in a patch
Content-Language: en-US
From: Husain Alshehhi <husain@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=202.12.124.146; envelope-from=husain@HIDDEN;
 helo=fout-b3-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: submit
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: -0.4 (/)

diff-mode does not handle a patch very well. In particular, if a patch
contains the commit message, and if the commit message contains a dash
character "-" at the beginning of a line, diff-mode interprets this as a
diff rather than part of the commit message.

To replicate this bug: copy the following in a file (e.g. test.patch),
open it in diff-mode, and you will see that the line "- unordered lists"
shows up in `diff-indicator-removed' face:

--8<---------------cut here---------------start------------->8---
From: me@HIDDEN
Date: Thu, 01 Jan 2025 00:00:00 -0000
Subject: [PATCH] Adding a comment

This is a commit to test emacs mode for displaying dash "-" character
such as:

- unordered lists        << This will be displayed as a diff.
- with multiple items    << So will this.

Emacs shows unordered lists as part of the diff because they start with
"-".
---
  main.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/main.c b/main.c
index 5df43ae..43b62fa 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,5 @@
  int main() {
+  // adding a comment.
    printf("hello world");
    return 0;
  }
-- 

2.47.1
--8<---------------cut here---------------end--------------->8---

See
https://lists.gnu.org/archive/html/help-gnu-emacs/2025-01/msg00229.html
for reference.


In GNU Emacs 29.4 (build 2, x86_64-suse-linux-gnu, GTK+ Version 3.24.43,
cairo version 1.18.2)
System Description: openSUSE Tumbleweed

Configured using:
  'configure --disable-build-details --without-pop --with-mailutils
  --with-native-compilation --without-hesiod --with-gameuser=:games
  --with-kerberos --with-kerberos5 --with-file-notification=inotify
  --with-modules --enable-autodepend --prefix=/usr
  --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
  --localstatedir=/var --sharedstatedir=/var/lib
  --libexecdir=/usr/libexec --with-file-notification=yes
  --libdir=/usr/lib64
  --enable-locallisppath=/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
  --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
  --with-gif --with-png --with-rsvg --with-dbus --with-webp --with-xft
  --with-imagemagick --without-gpm --with-x-toolkit=gtk3 --with-pgtk
  --with-toolkit-scroll-bars --x-includes=/usr/include
  --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo
  --with-xwidgets --build=x86_64-suse-linux --with-dumping=pdumper
  'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
  -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
  -fstack-clash-protection -Werror=return-type -flto=auto -g
  -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS
  -DGLIB_DISABLE_DEPRECATION_WARNINGS -pipe -Wno-pointer-sign
  -Wno-unused-variable -Wno-unused-label -fno-optimize-sibling-calls
  -DPDMP_BASE='\''"emacs-wayland"'\''' LDFLAGS=-Wl,-O2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
   value of $LC_NUMERIC: POSIX
   value of $LANG: en_US.UTF-8
   value of $XMODIFIERS: @im=local
   locale-coding-system: utf-8-unix

Major mode: Article

Minor modes in effect:
   org-roam-db-autosync-mode: t
   global-git-commit-mode: t
   magit-auto-revert-mode: t
   shell-dirtrack-mode: t
   global-corfu-mode: t
   corfu-mode: t
   vertico-mode: t
   which-key-mode: t
   override-global-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   buffer-read-only: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat hides 
/usr/share/emacs/site-lisp/compat
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-29 hides 
/usr/share/emacs/site-lisp/compat-29
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-28 hides 
/usr/share/emacs/site-lisp/compat-28
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-27 hides 
/usr/share/emacs/site-lisp/compat-27
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-26 hides 
/usr/share/emacs/site-lisp/compat-26
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-25 hides 
/usr/share/emacs/site-lisp/compat-25
/home/husain/.emacs.d/elpa/transient-20230919.2146/transient hides 
/usr/share/emacs/29.4/lisp/transient
/home/husain/.emacs.d/elpa/jsonrpc-1.0.24/jsonrpc hides 
/usr/share/emacs/29.4/lisp/jsonrpc
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package hides 
/usr/share/emacs/29.4/lisp/use-package/use-package
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-lint 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-lint
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-jump 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-jump
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-diminish
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-delight 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-delight
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-core 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-core
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-bind-key
/home/husain/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides 
/usr/share/emacs/29.4/lisp/use-package/bind-key
/home/husain/.emacs.d/elpa/eglot-1.17/eglot hides 
/usr/share/emacs/29.4/lisp/progmodes/eglot
/home/husain/.emacs.d/elpa/eldoc-1.15.0/eldoc hides 
/usr/share/emacs/29.4/lisp/emacs-lisp/eldoc

Features:
(mailalias mailclient dabbrev mm-archive misearch multi-isearch shadow
bbdb-message emacsbug mule-util smiley gnus-cite message-view-patch
mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable
textsec-check gnus-bcklg gnus-async sort gnus-ml disp-table
cello-light-theme ef-cherie-theme ef-themes consult nndraft nnmh
nnmaildir bbdb-gnus nnnil gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
dig nntp gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range gnus-win org-roam-protocol org-protocol
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
org-roam-compat org-roam org-capture org-attach emacsql-sqlite
emacsql-sqlite-common emacsql emacsql-compiler elfeed-show elfeed-search
vc-git vc-dispatcher elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
elfeed-lib url-queue xml-query erc-goodies erc iso8601 erc-backend
erc-networks erc-common erc-compat erc-loaddefs bbdb-mua bbdb-com bbdb
bbdb-site timezone gnus nnheader range org-noter org-noter-djvu
org-noter-nov nov recentf tree-widget shr pixel-fill kinsoku url-file
svg xml esxml-query dom org-noter-pdf org-noter-core pdf-tools cus-edit
cus-load wid-edit pdf-view magit-bookmark bookmark pp jka-compr
pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif ledger-mode
ledger-check ledger-texi ledger-test ledger-sort ledger-report
ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util files-x ledger-context
ledger-commodities ledger-regex scad-mode ox-gfm htmlize ob-latex ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-md ox-latex ox-icalendar ox-html
table ox-ascii ox-publish ox org-habit org-agenda org-element
org-persist xdg org-id org-refile org ob ob-tangle ob-ref ob-lob
ob-table org-macro org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp org-table org-keys
org-loaddefs find-func avl-tree ol oc ob-exp ob-core org-cycle org-fold
org-fold-core org-compat ob-eval org-version org-macs link-hint
goto-addr avy cal-menu calendar cal-loaddefs ediff ediff-merg ediff-mult
ediff-wind ediff-diff ediff-help ediff-init ediff-util git-link
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff diff-mode git-commit log-edit message sendmail
yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor time-date shell pcomplete server magit-mode
transient magit-git magit-base magit-section format-spec cursor-sensor
crm dash edmacro kmacro sqlformat reformatter go-mode find-file ffap
thingatpt etags fileloop generator xref project scala-mode
scala-mode-prettify-symbols scala-mode-imenu scala-mode-map
scala-mode-fontlock scala-mode-indent scala-mode-paragraph
scala-mode-syntax scala-mode-lib typescript-mode cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
compile text-property-search comint ansi-osc ring yaml-mode ansi-color
exec-path-from-shell corfu orderless vertico compat diminish which-key
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core finder-inf comp comp-cstr
warnings icons rx cl-extra help-mode ispell bbdb-autoloads
corfu-autoloads diminish-autoloads ef-themes-autoloads eglot-autoloads
eldoc-autoloads elfeed-autoloads emacs-everywhere-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
exec-path-from-shell-autoloads f-autoloads ggtags-autoloads
git-link-autoloads go-mode-autoloads htmlize-autoloads jsonrpc-autoloads
ledger-mode-autoloads link-hint-autoloads marginalia-autoloads
markdown-mode-autoloads magit-autoloads git-commit-autoloads
modus-themes-autoloads nov-autoloads orderless-autoloads
org-noter-autoloads org-roam-autoloads magit-section-autoloads
emacsql-autoloads ox-gfm-autoloads pdf-tools-autoloads request-autoloads
scad-mode-autoloads scala-mode-autoloads show-font-autoloads
sqlformat-autoloads reformatter-autoloads standard-themes-autoloads
tablist-autoloads transient-autoloads treemacs-autoloads
posframe-autoloads ht-autoloads hydra-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads s-autoloads dash-autoloads
typescript-mode-autoloads use-package-autoloads bind-key-autoloads
vertico-autoloads w3m-load w3m-autoloads which-key-autoloads
with-editor-autoloads info compat-autoloads yaml-mode-autoloads
auctex-autoloads tex-site package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc delsel lpr
easy-mmode pcase iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-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 nadvice seq simple cl-generic indonesian philippine
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 abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1306461 97685)
  (symbols 48 47318 18)
  (strings 32 522080 13600)
  (string-bytes 1 26474941)
  (vectors 16 262284)
  (vector-slots 8 3657817 148039)
  (floats 8 1262 501)
  (intervals 56 4819 450)
  (buffers 984 34))




Acknowledgement sent to Husain Alshehhi <husain@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#75884; 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: Tue, 11 Feb 2025 07:30:01 UTC

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