From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer Date: Tue, 20 Aug 2024 14:36:58 +0300 Message-ID: <86le0rwhlx.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25934"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65380@debbugs.gnu.org, juri@linkov.net To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 20 13:37:40 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 1sgNBD-0006Xp-8X for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 13:37:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgNAw-0005k6-7j; Tue, 20 Aug 2024 07:37: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 1sgNAt-0005jd-NE for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:37:20 -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 1sgNAt-00076x-DR for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:37:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=MtgKaJvc2+8p5V+jRPeIhGo+44O5mZsJpuWMoFKwu8I=; b=ab83f533NChHNKQZZKobFVujym4ps1+O1rvqUIEDYjqYx1pTjDsQPpeZ+8st2if3d9DWVn+QEwrPIeagiTxviK3viQJAAOIq5ajmTs8mB2f79ylI5W5FrkcS7M7BY24vUDfRnW+f4gBSVVLAGUn6sCGGBKuSxbhLhZeCNvdRI+vQn5AWZSBwNtMc08dp4TeL8b8GQfhh+5NJ98kGf2U/CAIDcDhuE2nwKd+WG+6Far/3ZGa6xV6+k1PsgkDccMO83a0GMgCAbLB7jsjy+IJuDEklZDQJ3qC2ELlGgXHfB4SRBvQC/Rxrsg12442n3TT3KknAClA4plLT4o7hCwmUdw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgNBZ-0007Os-SZ for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 07:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2024 11:38:01 +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.172415387728433 (code B ref 65380); Tue, 20 Aug 2024 11:38:01 +0000 Original-Received: (at 65380) by debbugs.gnu.org; 20 Aug 2024 11:37:57 +0000 Original-Received: from localhost ([127.0.0.1]:59952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNBU-0007OX-H4 for submit@debbugs.gnu.org; Tue, 20 Aug 2024 07:37:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNBR-0007OE-1c for 65380@debbugs.gnu.org; Tue, 20 Aug 2024 07:37:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgNAc-00075s-L9; Tue, 20 Aug 2024 07:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MtgKaJvc2+8p5V+jRPeIhGo+44O5mZsJpuWMoFKwu8I=; b=OKeVa+ku2G9L h0GwPO3DxfR4iTlqbhnQIcSjplmy3AoG9xwHGlt2t4bGGmkvpSlVeTel2u8ptMP7s/Snq90SxB1AE emN88AC7emHCUVlPgUw1MvToeOpxek3DlnmBVywzQjqCfgzGB/47f59HF8Jiwlc0ZlM9Z8eRZxDEO pE3xz08jcU6ZRvURLMbNgY9M+m05xTd6sopDEhaAPnv+CWkuKGBF3Ngcs8eKxa/CLtO8cpr16kavO z1JiBc+UFSGlfSjfty9uII9Z8Hs7w0604yJGeeCn991GDFs7iaiwp14G/v+7IHFda9guJGu3/Ok4e xq99Xj7yowzR+ny+F2zKDw==; In-Reply-To: <87ed6kxq5j.fsf@posteo.net> (message from Philip Kaludercic on Mon, 19 Aug 2024 19:34:48 +0000) 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:290433 Archived-At: > 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. > 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. > +(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. > +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?