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.help Subject: delete lines with overlays [workaround to diff mode] Date: Mon, 28 Aug 2023 22:32:53 -0700 Message-ID: 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="33645"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 29 07:34:09 2023 Return-path: Envelope-to: geh-help-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 1qarMf-0008Xc-OQ for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 29 Aug 2023 07:34:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qarLu-0002GF-1z; Tue, 29 Aug 2023 01:33:22 -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 1qarLY-0001xC-J0 for help-gnu-emacs@gnu.org; Tue, 29 Aug 2023 01:33:00 -0400 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qarLV-0002FO-HF for help-gnu-emacs@gnu.org; Tue, 29 Aug 2023 01:33:00 -0400 Original-Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-500a3c014d8so1257770e87.0 for ; Mon, 28 Aug 2023 22:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693287174; x=1693891974; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=9te4f7YOWjUhenjdxNCtkUfjDoYBM5Pma2YwVuJcFmw=; b=Rih0KTn19QXzPrr4KCb7x66k4B0Sh5hBOiI6AlstSuuGodlfG7RbL2bC/79mmFBAMs d33V47deC4GHCWUnXUSM436fIb136Y9BehlPRBssqMsfl7EpkRbdi23slpEKOtOkrL4+ yu9JpT62xrvlDTP2BsTUhNPIhcsgjoUb5Wq0WjXVKETS0fI2TEiNheMzSVwdAgPQWkwD +CDYkgMFcZpu9yBuSbfNJqA8tFBoqlTv3rWx6ApykmtxBPMWmIXLV22TRGByj9cwN5fS 19XrQyRDdzkOwySuMn0XlFz9d0m55b6is7JWeO9Hou8CuGI3UHJmZIkmLhWjXkUcjUvo EduQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693287174; x=1693891974; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9te4f7YOWjUhenjdxNCtkUfjDoYBM5Pma2YwVuJcFmw=; b=bHl1aMKUOe1CBt0VoI36xNMiTTW+RqF1BWTWZf0683HNiFeiETdXzYCl+idJT9X2eV hN9EMlDZoqUaiW+SyV2B44iNEmpjHNaLfCvg+AdFPCepPD7Xq+LFEw8DJZxaHo3zqQaN dhV6rFBO1Vcuumb4REzP1Qpfxo2SlsvwJSeDa0g25Ccrfd9TJmo9NIX1HGDTL4j8qFuS eSL9X54nnA0LBtZ/FH/pWdEqEdz/WKxJKtpWecUOmHlrtbtmZvN5iSM2XC0zey5puRxT XkEtbdpY/FzGlKOAQlmR+tT8POGMp++e8LphIPyZ939RL1/N6uH1+iQ8lei42t743z0W uj3A== X-Gm-Message-State: AOJu0YzReFW+VWNSVGfC83u0Gm7XDejBnwYlxTPujsG1qSa4NdpZUlAB RUan0bczL7PQ8cRysa8Zif3KqVpPSI7NoZyqy/6x7iguvV/dFK69 X-Google-Smtp-Source: AGHT+IFUrWsLvaBLBv9lCh1pKW2h0h3DdqhSznty+OBUIxXT481OM0eKGJbFvcDT32A2MPpKu9J/MzqDbR6kaZ+maT8= X-Received: by 2002:a05:6512:4890:b0:500:87e5:207b with SMTP id eq16-20020a056512489000b0050087e5207bmr13299718lfb.6.1693287173940; Mon, 28 Aug 2023 22:32:53 -0700 (PDT) Original-Received: by 2002:aa6:ca0a:0:b0:272:37a9:8c91 with HTTP; Mon, 28 Aug 2023 22:32:53 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=samologist@gmail.com; helo=mail-lf1-x136.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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145011 Archived-At: i have been struggling with this and working on this description for many years. hoping for a command that can delete all lines starting with "-" that contain overlays. rationale: diff mode does not distinguish DELETED lines in A (i.e. -) from lines in A that have more text ADDED somewhere in their B version (i.e. +). thus, those lines are ambiguous. they might 1) have been accidentally deleted, or they might 2) merely be the shorter version of the line that has text in the other polarity. the converse is also true if you swap A and B. the result is that i cannot tell if lines are missing in A by looking only at the - lines; i have to search through all of the + lines also, in order to determine whehter, instead, text was added. this applies to A lines that have no overlays. if they have an overlay for TEXT, then i know that it is not a deleted line. also, sometimes a refilled paragraph or so will have overlays on the - at BOL and presumably are not deleted. i filed a bug on this, to request e.g. a marker like ^ or something to show in any diff mode - or + line where text is exists in the opposite polarity (e.g. + if it is a - line or - if it is a + line). bug#61396: diff mode could distinguish changed from deleted lines here is an example from that bug report: [edit: the caret is an indicator here, not part of the example text.] === so basically, -this is a line that ^looks deleted, but it is changed ... +this is a line that REALLY looks deleted, but it is changed what is not indicated for the user is at the ^. i woul dlike it if diff mode if possible showed that text was deleted there. this allows you to look at only the - line and know that it is not a deleted line, possibly even mistakenly, but rather is part of a cange set, namely it and the + version of hte same line. this would reduce user confusion considerably. === i do not know if this is fixable in diff mode. however, i thought of a so-so but still useful workaround. the workaround would be to have a command that can delete lines with overlays in A (i.e. -). then the REMAINING lines are the ambiguous lines and can be inspected without distraction. they are either deleted or got changed. the problem is that i don't know how to program such a command. i guess it would take a c-u to delete + lines with overlays instead of - lines with overlays. (a better solution is as follows, but i assme it is too difficult. it sure would be for me. that is a command that internally removes overlays for purposes of comparison and searches for "+" lines that are otherwise equal to the "-" line. if such a dual line is found, then deletes those "-" lines.)