GNU bug report logs - #65380
[PATCH] Add command to copy contents in a diff-mode buffer

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sat, 19 Aug 2023 09:55:01 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 65380 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer
Date: Tue, 20 Aug 2024 14:36:58 +0300
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: juri <at> linkov.net,  65380 <at> 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?




This bug report was last modified 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.