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 12:10:01 +0000 Message-ID: <87y14rv1ie.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2522"; 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 14:11:06 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 1sgNhY-0000Qh-T2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 14:11:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgNhD-0007B0-P1; Tue, 20 Aug 2024 08:10:45 -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 1sgNgu-0007AD-ME for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 08:10:30 -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 1sgNgq-0003df-UH for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 08:10:22 -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=gsrpc6/NrAyuRldgqX63onVp9iyfsMvUX6bzThjp/10=; b=VZEvjvEQFI5SYV1fL/mZ1m9BbTvUz1e04CBqKo1CRLvkC6Do3biDKEg1THYC7nLXIXEP11Z0WmsKVzqY18FqxxEQvzdH8UhVtpSpRr198LllYl4MKcZeaPwmfwCqlEP9mF924h2p7Q/JYSxiRO1bRgE/GB9ZOapSK39VvfcuO6zB8CGPVQCt7Gh+pBz8QtM2uAKG1Thj9xmdSZtkUBas8u+lLnfQHKwv/90EXC7eltr974FullvSF9EIDsyFC0D1aAySDODU5R0FtnAG6mSS9D2z2dVi5s3hdlZC7eYNsO/66zdRQq91pHBb3YVjFQK3kdX7sDB2TKYlRxX2hu6SSQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgNhW-0008Md-Ft for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 08:11: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 12:11: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.172415585732141 (code B ref 65380); Tue, 20 Aug 2024 12:11:02 +0000 Original-Received: (at 65380) by debbugs.gnu.org; 20 Aug 2024 12:10:57 +0000 Original-Received: from localhost ([127.0.0.1]:59986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNhQ-0008MK-W6 for submit@debbugs.gnu.org; Tue, 20 Aug 2024 08:10:57 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:56793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNhN-0008M5-3X for 65380@debbugs.gnu.org; Tue, 20 Aug 2024 08:10:55 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 787ED240028 for <65380@debbugs.gnu.org>; Tue, 20 Aug 2024 14:10:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724155803; bh=bgcaXuIJX3r6lY+QeZod0tmLa+x01PqFSYZNVHhAJ7s=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Fev4wTv3dU3RNECI2FvozGwOIOr8XRbAGXVAmeuvojspEf9dDX/si5AiWI7NIx6oS ty2Q9RmJBiTc/YUX02HRMQ/pZwQK/zAOtcZn4c4BmiTE/bmEfQMaYTGznW6hAn1HNv 16qR2iuwPNAHIswAENr4VbJeHoxSw5fOrI4V3VegFm+FCoVkvVLld9X/oinfp/2TwN +3wP5f3+ucs+qEgiQAT+ECOXZOZ403Y+HHY+A3ILOc1d/9LSE401LuJVt1WVm5H2CZ hvJta1MgMj6y2X2MN5b0CFD02y1cnEi37jdOQYRLXqe3Clxc5yKDWx/zrwRkD7ywL/ yn1Ky8I19f56w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wp7ZL1R97z9rxQ; Tue, 20 Aug 2024 14:10:01 +0200 (CEST) In-Reply-To: <86le0rwhlx.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 20 Aug 2024 14:36:58 +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:290436 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: juri@linkov.net, 65380@debbugs.gnu.org >> Date: Mon, 19 Aug 2024 19:34:48 +0000 >> >> +*** New command 'diff-kill-ring-save' >> +This command copies out the modified contents out of a diff, without >> +having to apply it first. > > This could be reworded to make the effect of the command more clear. > For example: > > This command copies to the 'kill-ring' a region of text modified > according to diffs in the current buffer, but without applying the > diffs to the original text. Applied >> 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? ^^ >> +(defun diff-kill-ring-save (beg end &optional reverse) >> + "Save contents of the region between BEG and END akin to `kill-ring-save'. > > The first line should IMO say something to make it clear this command > uses diffs from the current buffer. OTOH, the reference to > `kill-ring-save' is much less important. So how about > > Save to `kill-ring' the result of applying diffs in region between BEG and END. I like it. >> +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? -- Philip Kaludercic on peregrine