unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Paul Nelson <ultrono@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 72866@debbugs.gnu.org
Subject: bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions
Date: Wed, 04 Sep 2024 15:01:23 +0200	[thread overview]
Message-ID: <87h6avtvx8.fsf@gmail.com> (raw)
In-Reply-To: <CAOA-32OmGc8zZ_yhnG0EY8vXhLU4HVLCvDt641kOMNd0jV=Ttw@mail.gmail.com> (Paul Nelson's message of "Wed, 4 Sep 2024 09:30:58 +0200")

>>>>> On Wed, 4 Sep 2024 09:30:58 +0200, Paul Nelson <ultrono@gmail.com> said:

    Paul> Many thanks for your suggestion.  I agree that this is a more elegant
    Paul> approach, which also admits a simpler implementation.  I've attached
    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 <ultrono@gmail.com>
    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} prefix)
    Paul> +from buffer A to buffer B@.  Ediff saves the old contents of buffer 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 contents 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} prefix)
    Paul> +from buffer A to the merge buffer.  The old contents of this region 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
 
    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} prefix)
    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 old
    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 added to 'dbus-call-method'
    Paul>  and 'dbus-call-method-asynchronously' to allow the user to interactively
    Paul>  authorize the invoked D-Bus method (e.g., via polkit).
 
    Paul> ++++
    Paul> +** Ediff's copy commands now apply to all changes with 'C-u' prefix.
    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>  \f
    Paul>  * Changes in Emacs 31.1 on Non-Free Operating Systems
 
    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ʼve
ever been tempted to change it from `C-u' :-))

Eli, does this change need a copyright assigment? I donʼt see
'ultrono@gmail.com' in the git logs anywhere.

Robert
-- 





  reply	other threads:[~2024-09-04 13:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  6:03 bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions Paul Nelson
2024-08-31 10:32 ` Eli Zaretskii
2024-09-01  6:59   ` Paul Nelson
2024-09-02 10:32     ` Robert Pluim
2024-09-04  7:30       ` Paul Nelson
2024-09-04 13:01         ` Robert Pluim [this message]
2024-09-04 13:10           ` Eli Zaretskii
2024-09-04 13:20             ` Paul Nelson
2024-09-11  8:46               ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6avtvx8.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=72866@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ultrono@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).