From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer Date: Tue, 20 Aug 2024 16:23:09 +0000 Message-ID: <87ttffupsi.fsf@posteo.net> References: <87wmxrwe6h.fsf@posteo.net> <83o7j3z4wm.fsf@gnu.org> <87pm3jwboc.fsf@posteo.net> <83lee7z3xs.fsf@gnu.org> <87jztrvxx2.fsf@posteo.net> <83r0nyyhlz.fsf@gnu.org> <86o7j2qgmc.fsf@mail.linkov.net> <83cyzhwpcj.fsf@gnu.org> <87a5ultvuy.fsf@posteo.net> <83a5ulwos6.fsf@gnu.org> <87fs4bgwuj.fsf@posteo.net> <83fs4btiw1.fsf@gnu.org> <871q2n152u.fsf@posteo.net> <87frr1zw6i.fsf@posteo.net> <864j7hzviv.fsf@gnu.org> <87bk1pztsr.fsf@posteo.net> <861q2lzp70.fsf@gnu.org> <87ed6kxq5j.fsf@posteo.net> <86le0rwhlx.fsf@gnu.org> <87y14rv1ie.fsf@posteo.net> <86bk1nwdcj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30487"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65380@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 20 18:24:38 2024 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 1sgRew-0007m6-Gh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 18:24:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgRee-0005OG-W2; Tue, 20 Aug 2024 12:24:21 -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 1sgRed-0005O6-Je for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 12:24:19 -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 1sgRed-0001rT-Ag for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 12:24:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Sb1+CRErS2hWb2SvveNtz3Sy7A8YfwKQv/5MLWmP1Aw=; b=J62gPWtlJVABK/5+AKwixsNgRHl79lVetcsZYVqx1keh4lnu37noOsnhNLzy0AH5fwvpOqOgxQ71Egh7z8fmyawcFFqSIzbxsZ8pzxjny/DdUe3OjRgiae0KkBTSAW0L/kw5rLk9LH7zw3wTlWexJLJ/+laSGBgT37LwfvHbeXQFTaxAbBrLzTqJ9CY2KlyZbl1fGIz7nHqXO4ZvAdmA1KGmcx8HVB2HWjigJjVCatrNF7x5dy7zx5dFI95Pyw/92WoxKjqgIWKStRyrocEJ/T2pBlzpUKaWKYvuouAq/7D6Do+3reD7cmg4/qhXBfeV6oR9ELCjLgs8+VZ6TT7Rcw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgRfK-0007NV-CL for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2024 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65380-submit@debbugs.gnu.org id=B65380.172417104628274 (code B ref 65380); Tue, 20 Aug 2024 16:25:02 +0000 Original-Received: (at 65380) by debbugs.gnu.org; 20 Aug 2024 16:24:06 +0000 Original-Received: from localhost ([127.0.0.1]:33589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgReP-0007Ly-Mu for submit@debbugs.gnu.org; Tue, 20 Aug 2024 12:24:06 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgReM-0007LR-AU for 65380@debbugs.gnu.org; Tue, 20 Aug 2024 12:24:04 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E0AE5240029 for <65380@debbugs.gnu.org>; Tue, 20 Aug 2024 18:23:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724170991; bh=rlFYmmKlo44OlVedbOO05jNPsApbYIlM1hadxAXWr+o=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Z8xCYsL4Frec2vTnvEkksJYSh995PocsOoYhBBe8CsKNVzIbRgCK4TD74VVeQvR7C LV3MH4DUxmXqcyzCYLwT8Qo0uKYYI0xnH5AE6s44ap6PPaXhYXj8ZnnkJETxIHKmcr 1TUgXOlxL36LnsnjatZJp+ITHKMnsC7m/9aHO7i+/cW+xGynpGqXP3JmvA90wDQJj+ Gc84iSkDiI4i2X4xxw/PfMAqElfU4PbEIBH/Tx3eCybfKshC3vCXkFYcuAE//CSHsZ jHsBAHxS21vMF8gVdkoiGFOlJ4NwRm03COujHlrfFx64OM+2wXgdKJUuZFXANjHvoh 2LG8tB/wqWrPw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WpFBQ5Mstz9rxD; Tue, 20 Aug 2024 18:23:10 +0200 (CEST) In-Reply-To: <86bk1nwdcj.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Aug 2024 16:09:00 +0300") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt 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:290456 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: juri@linkov.net, 65380@debbugs.gnu.org >> Date: Tue, 20 Aug 2024 12:10:01 +0000 >> >> Eli Zaretskii writes: >> >> >> If the selected range extends a hunk, the >> >> +commands attempts to look up and copy the text between from the >> >> +referenced file. ^^^^^^^^^^^^^^^^^ >> > >> > Something is missing (or redundant) in this sentence. >> >> How about "the text in between from". Does that sound better? >> ^^ > > If that's what you mean, I suggest "the text in-between the hunks". Stole that idea :) >> >> +By default the command will copy the text that applying the diff would >> >> +produce, along with the text between hunks. If REVERSE is non-nil, or >> >> +the command was invoked with a prefix argument, copy the deleted text." >> > >> > The "deleted text" part here is unclear: who or what deletes text and >> > what text is deleted? >> >> I want to express that it copies the parts of the diff, that the >> changeset removes (lines beginning with "-"). So perhaps "... copy the text >> removed in the diff" would be better? > > I think "copy the text removed by the diffs", and perhaps say > explicitly that those are the lines in the hunks preceded with "-". According to `diff-font-lock-keywords' diff-mode also supports the "<" syntax for removed parts of a hunk (I believe this comes from RCS?). Then again, I would assume that the structure and contents of a diff should be familiar to anyone using diff-mode seriously enough to be interested in a command like this one? -- Philip Kaludercic on peregrine