From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#61396: diff mode could distinguish changed from deleted lines Date: Wed, 13 Sep 2023 01:31:21 +0300 Message-ID: <85f73356-3a11-c76c-dd9a-f2dc1f6ef504@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23667"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 61396@debbugs.gnu.org To: Stefan Monnier , Samuel Wales Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 13 00:32:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qgBvs-0005s4-6Z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Sep 2023 00:32:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgBvL-0001Do-Vn; Tue, 12 Sep 2023 18:32:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgBvK-000187-DX for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 18:31:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgBvK-0006O6-4y for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 18:31:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgBvO-00085s-HA for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 18:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61396 X-GNU-PR-Package: emacs Original-Received: via spool by 61396-submit@debbugs.gnu.org id=B61396.169455790131085 (code B ref 61396); Tue, 12 Sep 2023 22:32:02 +0000 Original-Received: (at 61396) by debbugs.gnu.org; 12 Sep 2023 22:31:41 +0000 Original-Received: from localhost ([127.0.0.1]:60253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgBv3-00085J-0N for submit@debbugs.gnu.org; Tue, 12 Sep 2023 18:31:41 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgBuy-000852-FR for 61396@debbugs.gnu.org; Tue, 12 Sep 2023 18:31:39 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 58FB05C011C; Tue, 12 Sep 2023 18:31:26 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 12 Sep 2023 18:31:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694557886; x=1694644286; bh=/A0zUtLunHfrXVfjlTJhRaBdrGzP6Qep1wj +I9jg3y8=; b=prqlYGNcWYd36VNW60faEWaRiX/5pTgaZpG8BjFx2co66LgVdd0 M2M40qDf0ZZ0S/iuHA88nXY9GyqkD4qu/ODq4OovEPBxYp+lXSkUjP/aT6NVR1fj Ti1U9j03jN09atftvczaSyDXqZzaNEirfhcNajSqXL1DsNPHMrDKiQFG9miW45W5 uVSfhMujRJ0gMU6Fgisexk2QUNBFT1E1nkCoTpC3v+4Aph2q/6FvIwudLBVrLUtq mNYyVZJYte7UZJ9dM2nR1k5iE5OdXDaocg/E5lzrzz9YSGEWG2KZeGl5mYu86+PQ CQWxLQuy76RT68MiP16xzFYz1FwMSv8sTeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694557886; x=1694644286; bh=/A0zUtLunHfrXVfjlTJhRaBdrGzP6Qep1wj +I9jg3y8=; b=FM81a80/I+TyzadF0/kXVUFqr6EYm52h9saZwx5oHUbqDSZ9Hcf yZEDcfSz3rdw7ia2xLkmgG1proQHH9c3U1QYbWIwwgPACyWFTOPbk7o8MHJTU8ZR CvOqSk/SooHbKc/h9lTELm0D5CwRBdskYz27TBN3s4ni3Sq/timyPbMHHTW4XBsV Mt9Z19w8FU9uvE1taDpbPFjCuH7xTlB2b7rPixGVrwNRCBSh1M3ulUuAiudvjl0C 89aYZTU/4sIts5pvAAsKKHU2bUdTGR7zqhkU6Pt5H0AX9sJg+cptIq7QfVgE/ye9 T5DcaThTtAyh3wx9lolf/BOI9awoQNFbb5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeijedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 18:31:24 -0400 (EDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270228 Archived-At: On 13/09/2023 01:11, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: >> - First, `diff -u` (contrary to `diff -c`) does not distinguish between >> `removed/added` and `modified` lines. And `diff-mode` currently inherits >> this weakness. I think there's a good case to be made for >> highlighting the "truly added" and "truly removed" lines differently >> from those that are modified. >> I'd argue that a "logical" choice would be to highlight them the same >> way as those parts highlighted by `diff-refine-hunk` >> (i.e. `diff-refine-removed` and `diff-refine-added`) since that's how >> refinement would highlight them if we were to ask it to. > The patch below does that for the case of unified diffs. > I kind of like the result. > It's not quite ready for prime time, but I'd be interested to hear what > other people think about it. Not quite ready indeed: the new option is unused (implied to be t, I guess). Just a single piece of feedback: I get where the idea is coming from (and it's good in theory), but I'm not loving the added bright spots of color where there previously were just toned down lighter backgrounds. If it were indicated differently somehow (though I'm not sure how), perhaps I'd like it more. As it is, though, the added value (quite minor since it's easy to see which hunk is "pure addition" already) doesn't seem to balance out the inconvenience.