From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.bugs Subject: bug#61396: diff mode could distinguish changed from deleted lines Date: Wed, 8 Mar 2023 14:14:50 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10833"; mail-complaints-to="usenet@ciao.gmane.io" To: 61396@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 08 22:15:42 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 1pa18Q-0002fa-CN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Mar 2023 22:15:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pa17q-0003BW-7i; Wed, 08 Mar 2023 16:15:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pa17n-0003B9-3v for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2023 16:15:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pa17m-0007sv-GJ for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2023 16:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pa17l-000501-TA for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2023 16:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Samuel Wales Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 21:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61396 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167831010019199 (code B ref -1); Wed, 08 Mar 2023 21:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Mar 2023 21:15:00 +0000 Original-Received: from localhost ([127.0.0.1]:50333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa17j-0004za-JJ for submit@debbugs.gnu.org; Wed, 08 Mar 2023 16:14:59 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:55880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa17h-0004zS-Ge for submit@debbugs.gnu.org; Wed, 08 Mar 2023 16:14:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pa17h-0003AG-AW for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2023 16:14:57 -0500 Original-Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pa17e-0007rS-UT for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2023 16:14:56 -0500 Original-Received: by mail-lj1-x230.google.com with SMTP id y14so17995028ljq.4 for ; Wed, 08 Mar 2023 13:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678310092; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=dfiR6mU+fbte9AWOPRb+x28aWsRAyzk3mtvz1qirLCQ=; b=TErKM346zws8JfYg05b254Mmr30PNQcR9LBbAM6UBzVacFLHsngduZ5OtVqwp+1GK6 uGTa346HlpRJShcBXZMXGWxS6ThikwaYnRWSSEOciMZyW7KzJEBTDjZmQYAlqTP0EMJw lBoOhsIrUfBj2ztlRsnFSS1VW+F3Qo2Fbd0n+r7ejRslGMzKP6wz++FvH7+Wg+ZRdhw8 BmvLCh7OP/U3UAKpWXwmpCQtvnelUx9CeYXAoe1VuxPLIq2OOK7UYzh2N7tbnxhpb2II Y5HywSQnMMQON8iDYpF3yjndBMcB1SAMRIGITy1GK8FHomkBqOmOPRuMJZqNDOsjZKM/ 3A3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678310092; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dfiR6mU+fbte9AWOPRb+x28aWsRAyzk3mtvz1qirLCQ=; b=Q//3fm7gH1OMKlNkLKhWdnUqLwv95EEsCglca9vWW/N+bpeyHEs9siFqjnGrJCvoE8 afn5IToEB42uVtCFnfKVCmF3nABm8bFyk+upZ4O09Abtv2KY5Bbm7yN+fwxwBRIHxQSz sST2KDd/vM2ZFqOFE9df0lwZruyO7uoXEPe44ilIvDf7eUTSpml6OpTO3bB8ykhvhKTZ Yw5IzJIwoQegzooWvDOY0m8M+Q4ImUyaDKpJ+n0Ndpcqs091lhTiBfR5DjHk/b966NhW 0EnaocDyB0PpYDTc+e8M4qGU4QnUZg6ZnMhhyDhilW8tr/plgGNI5AR+ilPI1Zepb5p3 SP1g== X-Gm-Message-State: AO0yUKW8Y6Moi+3JmyrldwAF+h5YWjESnd5SagJIcwc4t6CAi5Qrbr7e aO2cTBgDL1Vyla3FSL5E1YvYnHRu2J+yjbl9sKelo+woDtEy0Q== X-Google-Smtp-Source: AK7set9mORSkxPH7HpY4Fw3LCBfvXW1zCw161RSpIVCb1DzVfnLZbTRuFY/0LXOwXQYVcxpkyESK/Ad+9Vj15M0Qjvk= X-Received: by 2002:a2e:a48e:0:b0:298:7006:c2c9 with SMTP id h14-20020a2ea48e000000b002987006c2c9mr1075133lji.3.1678310091934; Wed, 08 Mar 2023 13:14:51 -0800 (PST) Original-Received: by 2002:aa6:ca07:0:b0:24f:57d9:a46d with HTTP; Wed, 8 Mar 2023 13:14:50 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=samologist@gmail.com; helo=mail-lj1-x230.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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-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:257567 Archived-At: this problem is highly noticeable for me. i am thinking just a thin vertical bar for removed text would be possible and work well. there is something i do that makes the problem even more noticeable. imagine you want to improve the diff for human consumption as follows. you keep the top --- +++ and first @@ lines. then you group by polarity. what i mean by group by polarity is, you sort by - or + but not by anything else. that is, you put all - lines before + lines, but you do not change the sequence of lines within - or +. this might sound strange but it makes for much better understandability in many cases. glitches that show up in normal diff-mode are often removed. it is a highly useful diff viewing experience, but of course is useless for patches and so on. doing this takes all the diff hunks and smushes them together. deliberately. you can look at - and know whether you have deleted anything. but because of this bug, you don't know whether it is a true deletion, or whether you added something to the line in + unless you also look at +. this is in principle fixable. however, you do not need to do this to notice the problem. a big hunk will have this problem also in many cases. On 2/9/23, Samuel Wales wrote: > in diff mode, with diff -u, if a line in A was added to > in B, you can't tell by looking at the A version whether it was > =deleted= in B or =changed= from A to B. you have to > manually find it in B and then compare. here is an example: > > -now is the time > +now is the time FOR ALL GOOD MEN > > the - line is in del face. there is no indication on that > line that the line is not deleted. > > if the lines are separated sufficiently, it is not obvious > to the user whether it is a line that was deleted, or, as > above, added to. the del face is therefore ambiguous and can be > potentially misleading to the user. > > === > > the only thing that tells you non-confusingly that A was > changed, or where, is if you look at B. > > this is not practical when there are many lines. > > a fix is to have a different face for changed lines. i > suggest a muted bg face. another fix is to stick a colored > marker INDICATOR in A where changes in B exist. > > -now is the time^ > +now is the time FOR ALL GOOD MEN > > where ^ is a colored marker -- actually just a changed bg > for the newline in this case would work, but i don't think > emacs supports that. > > thank you. > > -- > The Kafka Pandemic > > A blog about science, health, human rights, and misopathy: > https://thekafkapandemic.blogspot.com > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com