From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer Date: Sun, 20 Aug 2023 12:47:53 -0700 Message-ID: <3bee8689-f8b7-117e-0165-34df01366901@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27468"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65380@debbugs.gnu.org To: Eli Zaretskii , Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 20 21:49:08 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 1qXoQ8-0006vx-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Aug 2023 21:49:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXoQ2-0000Fv-RM; Sun, 20 Aug 2023 15:49:02 -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 1qXoQ1-0000Fn-Be for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 15:49:01 -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 1qXoQ1-0004u8-3O for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 15:49:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXoQ2-0005Lo-H0 for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 15:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2023 19:49: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.169256088520356 (code B ref 65380); Sun, 20 Aug 2023 19:49:02 +0000 Original-Received: (at 65380) by debbugs.gnu.org; 20 Aug 2023 19:48:05 +0000 Original-Received: from localhost ([127.0.0.1]:54891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXoP6-0005ID-Qg for submit@debbugs.gnu.org; Sun, 20 Aug 2023 15:48:05 -0400 Original-Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]:61826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXoP5-0005HB-8S for 65380@debbugs.gnu.org; Sun, 20 Aug 2023 15:48:03 -0400 Original-Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1ba5cda3530so1784695fac.3 for <65380@debbugs.gnu.org>; Sun, 20 Aug 2023 12:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692560875; x=1693165675; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=IEdZtrrb1ii5krXVho9+1Q7TrX/92u7u/pqZiNW2x8Q=; b=W4+QujR8qNI0XuxtcLgs/9ftAtm8KcGKla8k5um8xy8LuuqIZDSDNbZsbcrUkGEgsg 8b3Uuej0joGuje6ejqQDJQRSBjDYDAdcSANpD/cfaDfWQ2nzMnyA0lTYvrgCooyiCXse k9yZKWAGcU+YIDZn6/b3oSCOcCZZ9H9PxrogOoy7XyzIoyieC706ZF8kxUscjw3X7tA3 6rFzfZDdcXfTRAuiAUp9YniOi7hrWUK51vdhT2YBwPI+jSGXdMtUJay0SRTtRS0s1y00 ZF7lEiHl9PsZ7rkUfAdmZTMOIX7tWzh6a8sNH4qxg+4DBG1bQ6H02a+u/vab73Ox419h oSuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692560875; x=1693165675; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IEdZtrrb1ii5krXVho9+1Q7TrX/92u7u/pqZiNW2x8Q=; b=gmSeU64PeE8kAKVCjo1XJhwb0oUl6yszyvlXn4wHQ35StZoJpOuiCy+wWhBb2qkXJx SozNl1ktS/WHrHFZDuwG0vyeud2UYvpKtKva3MZggjKA9fjPJkq+NKsSQytXniIE9ATr 1+AqW4zvaOt+5NE2lF+k/eRL78MW1ktlj1RW+3jKB8mA2pYkc5FeJOi4ya/JMjfyLsRW 2IJ0bFdrgIxPDGafNNGDLgThFh7d9UNqnci2z4xkRaYMT9SqIDzpoMO8xa1/wBuWq3HW Z0vqiWnBKftxZk6l5TvaBJdk/WEwQjprblibKR1est9z6rGPjmMiHD5nzeO2bSSbsHpA tlww== X-Gm-Message-State: AOJu0YzMtGYnjsxAjAPRHA0aU16+BFjc13xNYeIqwXHLKo1Jo7RbGDYL wHmkEhkYevfF7oBBID4wzD5RWdILpK8= X-Google-Smtp-Source: AGHT+IFUKeLy5WJIoWvIHq6NoZqh58/jN1joW1OOo5CwLHxQq8Rb0tecn+8wxviGRguuVa1LwpjCVg== X-Received: by 2002:a05:6870:d28d:b0:1c8:baa5:a50f with SMTP id d13-20020a056870d28d00b001c8baa5a50fmr7435097oae.27.1692560875365; Sun, 20 Aug 2023 12:47:55 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id rm4-20020a17090b3ec400b0026094c23d0asm4812250pjb.17.2023.08.20.12.47.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Aug 2023 12:47:54 -0700 (PDT) Content-Language: en-US In-Reply-To: <83r0nyyhlz.fsf@gnu.org> 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:268030 Archived-At: On 8/19/2023 12:09 PM, Eli Zaretskii wrote: > I'd like to hear from more people who will find this useful enough to > have in Emacs. My first thought was that this is something you should > keep as your local extension, but maybe I'm mistaken. Based on my understanding of the current implementation, I would *not* find this useful, and instead I'd propose a couple of different ways to handle this. First, the original message says, "rectangular selection might be possible, but that behaves differently when the text is yanked". I've been bitten by that a few times in the past, and I'd much rather a general solution to that problem instead. Some way of yanking a rectangular selection as though it were a normal region (or some way to put the rectangular selection on the normal kill ring) would be great, and would solve this in a more-general way. Then, for example, you could use the same command to copy the contents of a diff *or* to copy a commented-out block of code without the comment introducers. Something like: ;; (defun hello () ;; "Say hello." ;; (message "Hello")) If I could select a rectangle around the actual code to copy it, excluding the leading ";; ", that would be useful (occasionally, at least). Second, for the diff case in particular, I'd rather have a command that copies the added or unchanged lines, and *skips* the removed lines. (As far as I can tell, the proposed implementation copies the removed lines as well.) Then I could actually yank this into my destination and it would work. Copying the removed lines would mean I need to go and remove them manually, only now I've lost the "-" indicator that tells me which lines are removed.