npostavs@users.sourceforge.net writes: > Dima Kogan writes: > >> Hi. I'm open to suggestions. The goal was to retain the previous logic >> for any existing code, but to provide improved user-facing behavior. Ack! So this is what happens when you submit a patch, and then talk about it more than 2 years later. Turns out preserving compatibility with existing code wasn't my goal at all. Rather, the goal was to avoid an infinite loop that results if (diff-hunk-next) unconditionally uses the new logic: diff-hunk-next calls diff--wrap-navigation calls diff-bounds-of-hunk calls diff-beginning-of-hunk calls diff-hunk-next > it looks like interactiveness is not what you actually care about. > You could do something like this instead: > > (defun diff-hunk-next (&optional count skip-hunk-start) > "Go to the next COUNT'th hunk" > (interactive (list (prefix-numeric-value current-prefix-arg) t)) > (diff--wrap-navigation > skip-hunk-start > "next hunk" > 'diff--internal-hunk-next > diff-hunk-header-re > (lambda () (goto-char (car (diff-bounds-of-hunk)))) > count)) > > Then instead of (call-interactively 'diff-hunk-next) you can just do > (diff-hunk-next nil t) Yes. Agreed. Revised patch attached. I'll try to respond to any comments quickly so that we all can remember what this is about.