GNU bug report logs -
#65380
[PATCH] Add command to copy contents in a diff-mode buffer
Previous Next
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
>> > 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.
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.