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: Sat, 19 Aug 2023 15:45:13 +0000 Message-ID: <87jztrvxx2.fsf@posteo.net> References: <87wmxrwe6h.fsf@posteo.net> <83o7j3z4wm.fsf@gnu.org> <87pm3jwboc.fsf@posteo.net> <83lee7z3xs.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="2264"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65380@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 19 17:46:17 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 1qXO9Z-0000Pu-LB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Aug 2023 17:46:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXO9M-0004hq-I2; Sat, 19 Aug 2023 11:46:04 -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 1qXO9K-0004hF-Lw for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 11:46:02 -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 1qXO9K-0008Oi-D2 for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 11:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXO9K-0002kG-Lv for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 11:46: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: Sat, 19 Aug 2023 15:46: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.169245992910508 (code B ref 65380); Sat, 19 Aug 2023 15:46:02 +0000 Original-Received: (at 65380) by debbugs.gnu.org; 19 Aug 2023 15:45:29 +0000 Original-Received: from localhost ([127.0.0.1]:52143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXO8m-0002jP-I1 for submit@debbugs.gnu.org; Sat, 19 Aug 2023 11:45:29 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:37589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXO8h-0002j2-Bx for 65380@debbugs.gnu.org; Sat, 19 Aug 2023 11:45:26 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EBC08240101 for <65380@debbugs.gnu.org>; Sat, 19 Aug 2023 17:45:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692459916; bh=iQxwLhDaCKysTVnSOgFqwaZCbDE13WiM/1tauMMoe60=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=SjfxWT6s7D2DLirdbUanriwKl561wqPhZ9oCYF4kupdFjkdj8dZgQofHcME9A6BE6 +rNZ+IepqwxpuHqSJHswjnBTyP+KeudnyeH7w0PGx6bpNkKK7eamg9fD5a3+c84tEL Jen0YY+lzzlAw+kToOKNErNGu5zcU/+92mcxBDdblPD7TTcPkPorCudC3AuX3O6tv2 kkw92FbyHNVL6bcpz9H/dbzxM3qF9ojBhg9XgOhvix2faep4JnmsE5BCAY6gMfmIKr 4cxDAP/B2vI6jzrnThHfU+88lx/pkTfHebV5VQqJ0YjrvhdGW6FnrCiky3yq4ubVQH 7qg8pLM7bHT5A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RSjk313r5z9rxH; Sat, 19 Aug 2023 17:45:14 +0200 (CEST) In-Reply-To: <83lee7z3xs.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Aug 2023 14:06:55 +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 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:267885 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: 65380@debbugs.gnu.org >> Date: Sat, 19 Aug 2023 10:48:03 +0000 >> >> Eli Zaretskii writes: >> >> > Please tell more about the use cases where this would be useful. I >> > couldn't understand that from the patch itself. >> >> A simple example is where someone sends me a patch with a Elisp function >> I'd like to evaluate. If I can't or don't want to apply the patch right >> now, I can use `diff-kill-ring-save' to copy the function without the >> leading "+" into my scratch buffer and evaluate it there. > > But diffs don't necessarily show the entire body/ies of function(s), > they show just part of them. So this seems to be useful only in a > very small subset of cases? In theory yes, but as I mentioned in my first message, it comes up surprisingly often, at least to the degree that I think it would be something nice to have in general. If you think the current implementation is too primitive, one could extend it to check if the region is a subregion of a hunk, and handle that appropriately.