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: Sun, 12 Feb 2023 15:48:04 -0700 Message-ID: References: <86y1p4m9cg.fsf@mail.linkov.net> <86bklzs2su.fsf@mail.linkov.net> <86fsbbnlaq.fsf@mail.linkov.net> 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="39194"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61396@debbugs.gnu.org, rms@gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 23:49:20 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 1pRL9s-000A0B-OG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 23:49:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRL9h-0003ic-Qh; Sun, 12 Feb 2023 17:49:10 -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 1pRL9a-0003XA-O9 for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 17:49:02 -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 1pRL9a-0003P2-EC for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 17:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRL9a-0007v9-04 for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 17:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Samuel Wales Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 22:49:01 +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.167624209430357 (code B ref 61396); Sun, 12 Feb 2023 22:49:01 +0000 Original-Received: (at 61396) by debbugs.gnu.org; 12 Feb 2023 22:48:14 +0000 Original-Received: from localhost ([127.0.0.1]:47117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRL8o-0007tX-EV for submit@debbugs.gnu.org; Sun, 12 Feb 2023 17:48:14 -0500 Original-Received: from mail-lf1-f41.google.com ([209.85.167.41]:47078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRL8l-0007si-R9 for 61396@debbugs.gnu.org; Sun, 12 Feb 2023 17:48:13 -0500 Original-Received: by mail-lf1-f41.google.com with SMTP id bp15so16452702lfb.13 for <61396@debbugs.gnu.org>; Sun, 12 Feb 2023 14:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=P3TVbTh7xltJuH2pG4KZtmci46FjS+/IQiESUDDtCdk=; b=O4Bpea3+O6ekbrnJ3CcR7259e6WQz0/srrVcO6Llk2C+GC+F4Blv/IwsYhVYzbZVm1 D/qD9hqejghY8aQtSO374/GC1Gu46oUUohjs4mJ0VItyqtlrEapVkU7HO8GOWrZnZpl9 oDrwD1134+M/ltSlkeh+/jkjRttxkQPYU5afhjA7M2q3aQ2V9WGShKEB9lOxHoOLHx1K t8DmmAQJM12cgoy/Sw2MWN2oo7pepceiIVfFJTlVmj8eHdoOppA6KNNe7y7UKo3CotIK oX1x337P8EFhq3SrZxYXYwKU5yL/xS3BnVwv1shn0toHk7UoEArhWn/6bFH9sVzS2OiR bugA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=P3TVbTh7xltJuH2pG4KZtmci46FjS+/IQiESUDDtCdk=; b=b7mKWj/e3qIJcRXvx1apWYWUlGIMBHOu42fJY9+1GDybCNS1VlN8hprzj3euZlmrDd ffVRdc04O1eBJ9PoW6oGzW7T4WTyH3S59TvL8gjhkKO7eXaJhMK1sNKRurGg5YCklc8K sBj8lXtFoCT63NEsD2voAxVHzLIGAXAz8hefQpdfWjay1AJK8q5hnNPSoK1IVV7ZMFkp MMuQ7QTuFG3jeZTPUO10TH0KwOPtmfPbFZgNs4Gj9/lUnXRsR/2omlSAB6N/UmDcfwut VGh8hmopoRr0qicplOI7FntsG8zW48M2N1x7iQskfWNJ0NSMZxzIom3LGrmn7humwkTO ELkA== X-Gm-Message-State: AO0yUKUlNTrdQtORJjxVAWPnUO04zOFIHTQKUrHz0AwCw/9ipO1Eqnny w3MLzV/mUCKU9blbvxtm0oOUXQA+SnAfoJhFcuk= X-Google-Smtp-Source: AK7set9qBcSgvmd/bHQVCniQOALgt0tyEXyD2q1RpmUUGOegYdBU3YPH1NwIXAP8cT0zUyJD9RxTmPS0E662dkRQKwY= X-Received: by 2002:ac2:4891:0:b0:4cc:db38:d84e with SMTP id x17-20020ac24891000000b004ccdb38d84emr3306086lfc.180.1676242085652; Sun, 12 Feb 2023 14:48:05 -0800 (PST) Original-Received: by 2002:aa6:c266:0:b0:23b:5e81:46ba with HTTP; Sun, 12 Feb 2023 14:48:04 -0800 (PST) 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:255448 Archived-At: for purposes of showing what i mean, suppose you have approximately like: --- ... +++ ... @@ ... @@ -1 hmm -2 hi -3 +1 really? +2 there +3 for all good men [btw this is all merely an arbitrary quote from history from a diff tutorial.] now what does diff-mode do with this? it usually does a pretty good job. sometimes there are glitches. diff-mode leaves 1 2 3 characters alone. it uses diff-removed and diff-added for them. --- ... +++ ... @@ -104,3 +104,3 @@ -1 HMM -2 HI -3 +1 REALLY? +2 THERE +3 FOR ALL GOOD MEN this output is correct. hmm and really are different and hi and there are different. line 3 is special. the - and + moieties are different. but they are different specially. that is because in - there is an /absence/ of for all good men. diff-mode does not show absence. there is no marker saying "soiemthing is absent". in - for line 3 it is also special for the user interpretation. it could indicate that the line is entirely unique to A according to diff-mode. OR it could indicate that it is in both A and B but different in B like 1 and 2. this is ambiguous. an indicator reovs ambiguity. the idea is merely one thing: indicating absence. the same idea is true of a hypothetical opposite case where 3 in +, not -, lacks an indicator. can it be done? naturally, all of this is heuristic-ish to begin with, insofar as human interpretation is concerned. that's why we have difftastic and histogram and all that stuff. the solution -- indicators for absence -- will also be. that is ok. adjacency and blocks are not likely to be the solution. if it is elaborate or special-cased, then it is likely impractical. On 2/12/23, Samuel Wales wrote: > below. > > On 2/12/23, Juri Linkov wrote: >> But it seems that you want to check words on every line in the block >> for changes, and to categorize every line to three groups: > > i do not want what you described. > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com