From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions Date: Wed, 04 Sep 2024 15:01:23 +0200 Message-ID: <87h6avtvx8.fsf@gmail.com> References: <86le0dasp9.fsf@gnu.org> <8734miuz05.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 72866@debbugs.gnu.org To: Paul Nelson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 04 15:03:33 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 1slpfZ-0005T0-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Sep 2024 15:03:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slpf2-0006uY-Fh; Wed, 04 Sep 2024 09:03:00 -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 1slpf1-0006pG-A3 for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 09:02:59 -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 1slpf1-0007Sx-1H for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 09:02:59 -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=slTDWSrmiThy/fIDe/Klc8CadkleY6SfbbyZdClSpSI=; b=RaVrnx7sHJNLXC6SHj344TDDIXFXEOJ9BflwDv0UbHRJfSRJCucN1mbVPim+lo1sRFROhCL3arT4262ogOttyEZ87yDMpSYyOGPJr4xJEbOxxJ0xEMpBSPWOi5+9c4RazvlAWLOdD0mPLH/yi4QL5ug0wADLWxRNFygjoToOCFcsfgPgIe5obDATIgFEg7nHYGBD2T7Xe0X/8ozSLYrV9Vq8PwIu4lvXOieQxVcYEVZ+ReNlgp4J07W7fD17oy3bD6CPw1l/N0a2zVK5lOMYq7JzubBYPt15miRTOYO2/ePESzLvJROoIuzHcjwHJLGJQxvPXV8/1QM50KUZsxQIuA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1slpg2-0000g3-J6 for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 09:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Sep 2024 13:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72866 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72866-submit@debbugs.gnu.org id=B72866.17254550182565 (code B ref 72866); Wed, 04 Sep 2024 13:04:02 +0000 Original-Received: (at 72866) by debbugs.gnu.org; 4 Sep 2024 13:03:38 +0000 Original-Received: from localhost ([127.0.0.1]:33842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slpfd-0000fI-Jw for submit@debbugs.gnu.org; Wed, 04 Sep 2024 09:03:38 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:57563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slpfa-0000ev-UK for 72866@debbugs.gnu.org; Wed, 04 Sep 2024 09:03:35 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42bbbff40bbso45569085e9.2 for <72866@debbugs.gnu.org>; Wed, 04 Sep 2024 06:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725454885; x=1726059685; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=slTDWSrmiThy/fIDe/Klc8CadkleY6SfbbyZdClSpSI=; b=nWGYPUDZUZxN45R02qaUrOCH9tVox9IeBPuaJYaW1c12ZEgImjpT5KXronfsGZURxC RWw88hKp6l6Y09jJ1Wbm0iC0aOzy+O3x5TW/iyo9RWoZaiiPVvQLlUgB52gV9U+3wuHD TLDHBk3nNHBMdIhRfk8i1cIud4lBgUQAnV0DbCsHLVMm05G+Edkt5dFVDTC38Z1f9aYS oyn6G5/wCKN9kQt/Ei/MTf6CYF8XisjHQrRcOzIXVA6B3sW3kdyFPLWktkxeWCIlCcGR LRqSzp3wIbISdec0fEDRxqxaaqL8Rgz0PKf4BVVFOPYARspFbUhYESUSq/9HbFRF2Jho 0NGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725454885; x=1726059685; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=slTDWSrmiThy/fIDe/Klc8CadkleY6SfbbyZdClSpSI=; b=w4L9+vLiHvvXeJbFvqCsomabhqyLicS4sV7hzVBgsNkc/fC4wUETcneIgewye41aE9 LVS9IvOOZzW+6wtJborK3SxVInopJebuhWEBH/D8C7mHqOKVmRANQKeovQ8Q57IDLOPR tS4zviY7nDPLCRM6S48DnC+x1YW/dEMOMSMGwMkbNUnuxFZnZIPpFmHUx+W6HjjhZiJ0 K7O6TpnXcOdm7VBCzE/9DzSMYhkte4IWOikovA7TGPUXZSj3OuXxfSa9+BjgW2nVBLqT JxZa92IXkUw+0Y/lqfUBZ9YcPDAawKfsGDNSZjbnN0qO58VvuKrXPRsVbkpBn/czFPUG j7VQ== X-Forwarded-Encrypted: i=1; AJvYcCUPfweAk/aFuDtdQsTE+/wsu7Ev9bJtuj8z7CrgJCey+g90g0j8Pjr18pa5zDo86hJP1wwp2w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzmO1wzBPhpl9/qMHp4u2nELyghQXRRhzFoKDsLJKPJhkeawo7j jji0a9UMvAKB6C8BcUirNq23HFMvZom0SUB627iE9ocBs/wdb0NSAAbx0g== X-Google-Smtp-Source: AGHT+IEuC5UWsoKLtT+Q6qYVUdaQFAwPAqYu9etu4hDZm43nD2d13/oxmIYoTYDKRjWgNyprQ7UFbQ== X-Received: by 2002:a05:600c:46c9:b0:42b:8a35:1acf with SMTP id 5b1f17b1804b1-42bbb436e9amr119444335e9.25.1725454884745; Wed, 04 Sep 2024 06:01:24 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb51:58a0:797d:5a6f:fa4f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42c88c624f7sm62202955e9.39.2024.09.04.06.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 06:01:24 -0700 (PDT) In-Reply-To: (Paul Nelson's message of "Wed, 4 Sep 2024 09:30:58 +0200") 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:291199 Archived-At: >>>>> On Wed, 4 Sep 2024 09:30:58 +0200, Paul Nelson sa= id: Paul> Many thanks for your suggestion. I agree that this is a more ele= gant Paul> approach, which also admits a simpler implementation. I've attac= hed Paul> my revised patch. Any further feedback welcome. Minor comments below Paul> Thanks, best, Paul> Paul Paul> From 91ade3effdbf19b7d8793020a1c31a4ff791a58d Mon Sep 17 00:00:00= 2001 Paul> From: Paul Nelson Paul> Date: Wed, 4 Sep 2024 09:24:25 +0200 Paul> Subject: [PATCH] Add Ediff feature for copying all differences Paul> * lisp/vc/ediff-util.el (ediff-diff-to-diff): With universal Paul> prefix, copy all differences. Paul> * doc/misc/ediff.texi (Quick Help Commands): Paul> * etc/NEWS: (Lisp Changes in Emacs 31.1): Document the new Paul> feature. Paul> --- Paul> doc/misc/ediff.texi | 26 ++++++++++++++------------ Paul> etc/NEWS | 16 ++++++++++++++++ Paul> lisp/vc/ediff-util.el | 29 +++++++++++++++++------------ Paul> 3 files changed, 47 insertions(+), 24 deletions(-) Paul> diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi Paul> index 749025c870b..6afb38e3fae 100644 Paul> --- a/doc/misc/ediff.texi Paul> +++ b/doc/misc/ediff.texi Paul> @@ -489,15 +489,16 @@ Quick Help Commands Paul> @item a Paul> @kindex a Paul> @emph{In comparison sessions:} Paul> -Copies the current difference region (or the region specified as= the prefix Paul> -to this command) from buffer A to buffer B@. Paul> -Ediff saves the old contents of buffer B's region; it can Paul> -be restored via the command @kbd{rb}, which see. Paul> +Copies the current difference region (or the region specified as= the Paul> +prefix to this command, or @emph{all} regions with @kbd{C-u} pre= fix) Paul> +from buffer A to buffer B@. Ediff saves the old contents of buf= fer B's Paul> +region; it can be restored via the command @kbd{rb}, which see. 'numerical prefix' maybe? Although that part of the text is not new. Paul> @emph{In merge sessions:} Paul> -Copies the current difference region (or the region specified as= the prefix Paul> -to this command) from buffer A to the merge buffer. The old con= tents of Paul> -this region in buffer C can be restored via the command @kbd{r}. Paul> +Copies the current difference region (or the region specified as= the Paul> +prefix to this command, or @emph{all} regions with @kbd{C-u} pre= fix) Paul> +from buffer A to the merge buffer. The old contents of this reg= ion in Paul> +buffer C can be restored via the command @kbd{r}. Similarly here Paul> @item b Paul> @kindex b Paul> @@ -511,11 +512,12 @@ Quick Help Commands =20 Paul> @item ab Paul> @kindex ab Paul> -Copies the current difference region (or the region specified as= the prefix Paul> -to this command) from buffer A to buffer B@. This (and the next= five) Paul> -command is enabled only in sessions that compare three files Paul> -simultaneously. The old region in buffer B is saved and can be = restored Paul> -via the command @kbd{rb}. Paul> +Copies the current difference region (or the region specified as= the Paul> +prefix to this command, or @emph{all} regions with @kbd{C-u} pre= fix) Paul> +from buffer A to buffer B@. This (and the next five) command is= enabled Paul> +only in sessions that compare three files simultaneously. The o= ld Paul> +region in buffer B is saved and can be restored via the command Paul> +@kbd{rb}. and here. Paul> @item ac Paul> @kindex ac Paul> Copies the difference region from buffer A to buffer C@. Paul> diff --git a/etc/NEWS b/etc/NEWS Paul> index f10f9ae4d65..a6db0c96288 100644 Paul> --- a/etc/NEWS Paul> +++ b/etc/NEWS Paul> @@ -121,6 +121,22 @@ A new ':authorizable t' parameter has been a= dded to 'dbus-call-method' Paul> and 'dbus-call-method-asynchronously' to allow the user to inter= actively Paul> authorize the invoked D-Bus method (e.g., via polkit). =20 Paul> ++++ Paul> +** Ediff's copy commands now apply to all changes with 'C-u' pre= fix. Paul> +The Ediff copy commands, bound to 'a', 'b', 'ab', etc., now copy= all Paul> +changes when supplied with a universal prefix argument via 'C-u': Paul> + Paul> +- 'C-u a' copies all changes from buffer A to buffer B (in 2-way= diff) Paul> + or to buffer C (in 3-way diff or merge). Paul> +- 'C-u b' copies all changes from buffer B to buffer A (in 2-way= diff) Paul> + or to buffer C (in 3-way diff or merge). Paul> +- 'C-u a b' copies all changes from buffer A to buffer B. Paul> +- 'C-u b a' copies all changes from buffer B to buffer A. Paul> +- 'C-u a c' copies all changes from buffer A to buffer C. Paul> +- 'C-u b c' copies all changes from buffer B to buffer C. Paul> +- 'C-u c a' copies all changes from buffer C to buffer A. Paul> +- 'C-u c b' copies all changes from buffer C to buffer B. Paul> + You should add an '** Ediff' section to 'Changes in Specialized Modes and Packages in Emacs 31.1' and put this change there. Paul> Paul> * Changes in Emacs 31.1 on Non-Free Operating Systems =20 Paul> diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el Paul> index 597d8a5e643..c2cdf7d4e5e 100644 Paul> --- a/lisp/vc/ediff-util.el Paul> +++ b/lisp/vc/ediff-util.el Paul> @@ -1891,7 +1891,7 @@ ediff-diff-at-point Paul> (defun ediff-diff-to-diff (arg &optional keys) Paul> "Copy buffer-X'th difference region to buffer Y (X,Y are A, B,= or C). Paul> With numerical prefix argument ARG, copy the difference specified Paul> -in the arg. Paul> +in the arg. With prefix `C-u', copy all differences. In docstrings `C-u' is written `\\[universal-argument]' (not that I=CA=BCve ever been tempted to change it from `C-u' :-)) Eli, does this change need a copyright assigment? I don=CA=BCt see 'ultrono@gmail.com' in the git logs anywhere. Robert --=20