all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65380@debbugs.gnu.org, Philip Kaludercic <philipk@posteo.net>
Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer
Date: Sun, 20 Aug 2023 19:30:03 +0300	[thread overview]
Message-ID: <86o7j2qgmc.fsf@mail.linkov.net> (raw)
In-Reply-To: <83r0nyyhlz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Aug 2023 22:09:12 +0300")

>> > 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.
>
> 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.

Sometimes it's useful to copy the plain text from the diff
without applying the patch.  Regarding the implementation, there is
the function 'diff-hunk-text', but it's limited to one hunk only.
So another variant would be to extend 'diff--filter-substring'
that conditionally could modify the kill-ring-save filter
depending on a new customizable variable.
Although for some strange reason, the filter is not applied
when using the region.  I think this is a bug, or at least
a misfeature.





  parent reply	other threads:[~2023-08-20 16:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19  9:53 bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer Philip Kaludercic
2023-08-19 10:00 ` Philip Kaludercic
2023-08-20  0:59   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-20  7:52     ` Philip Kaludercic
2023-08-19 10:46 ` Eli Zaretskii
2023-08-19 10:48   ` Philip Kaludercic
2023-08-19 11:06     ` Eli Zaretskii
2023-08-19 15:45       ` Philip Kaludercic
2023-08-19 19:09         ` Eli Zaretskii
2023-08-19 19:30           ` Philip Kaludercic
2023-08-19 21:01           ` Sean Whitton
2023-08-19 22:49           ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-20  0:41           ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-20 16:30           ` Juri Linkov [this message]
2023-08-20 18:17             ` Eli Zaretskii
2023-08-20 18:24               ` Philip Kaludercic
2023-08-20 18:29                 ` Eli Zaretskii
2023-08-22 11:06                   ` Philip Kaludercic
2023-08-22 11:29                     ` Eli Zaretskii
2023-08-20 19:47           ` Jim Porter
2023-08-20 20:13             ` Gregory Heytings
2023-08-20 20:45               ` Jim Porter
2023-08-20 21:29                 ` Gregory Heytings
2023-08-20 22:21                   ` Jim Porter
2023-08-20 22:31                     ` Gregory Heytings
2023-08-20 23:39                       ` Gregory Heytings
2023-08-21  0:34                         ` Jim Porter

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

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

  git send-email \
    --in-reply-to=86o7j2qgmc.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=65380@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=philipk@posteo.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.