GNU bug report logs - #5352
diff-jump-to-old-file inverts hunk application as well

Previous Next

Package: emacs;

Reported by: Michael Orlitzky <michael <at> orlitzky.com>

Date: Mon, 11 Jan 2010 06:34:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Orlitzky <michael <at> orlitzky.com>
Cc: 5352 <at> debbugs.gnu.org
Subject: bug#5352: diff-jump-to-old-file inverts hunk application as well
Date: Mon, 09 May 2022 16:32:11 +0200
Michael Orlitzky <michael <at> orlitzky.com> writes:

> The custom diff-jump-to-old-file causes a reversal of the traditional
> diff/patch behavior present in Emacs <= 22. From diff-mode.el, it seems
> sort of intentional that this is the case; nevertheless, the new
> behavior does not strike me as useful. From diff-mode.el:
>
> (defun diff-apply-hunk (&optional reverse)
>   "Apply the current hunk to the source file and go to the next.
>   By default, the new source file is patched, but if the variable
>   `diff-jump-to-old-file' is non-nil, then the old source file is
>   patched instead (some commands, such as `diff-goto-source' can change
>   the value of this variable when given an appropriate prefix argument).
>
> Why should the default be to patch the new file, which is by definition
> already patched? Take for example,

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think the logic here is when you have a diff that's been partially
applied, so that the "new" file isn't literally the one you've already
applied the patch to.

In that case, you usually want to apply the hunk to the new file, and
not the old one.

In any case, the current behaviour has been in place for a decade, so I
think it's too late to change it now (because that would break things
for people that's used to the direction it works in now).

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 9 days ago.

Previous Next


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