GNU bug report logs -
#17544
24.3; [PATCH] Improved diff-mode navigation/manipulation
Previous Next
Reported by: Dima Kogan <lists <at> dima.secretsauce.net>
Date: Wed, 21 May 2014 15:00:05 UTC
Severity: normal
Tags: patch
Found in version 24.3
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
Message #26 received at 17544 <at> debbugs.gnu.org (full text, mbox):
npostavs <at> users.sourceforge.net writes:
> Dima Kogan <dima <at> secretsauce.net> writes:
>
>>
>>> and the whole issue of testing called-interactively-p that goes with
>>> it. Can you explain?
>>
>> I'm guessing the interactivity checking in diff-hunk-next and
>> diff-hunk-prev was intended to keep scripts working as before. Again, it
>> has been too long to remember specifically.
>
> IMO, it would make more sense to just define your new commands directly,
> something like:
>
> (defun diff-hunk-next-command (&optional count)
> "<A useful description goes here>."
> (interactive "p")
> (let ((start (point)))
> (let ((hunk-bounds (diff-bounds-of-hunk)))
> (goto-char (car hunk-bounds)))
> (diff-hunk-next count)
> (when (not (looking-at diff-hunk-header-re))
> (goto-char start)
> (user-error "No next hunk"))))
>
> And then just give the *binding* of `diff-hunk-next' to
> `diff-hunk-next-command'. No need to make a higher order wrapper
> function just for defining 2 functions.
I've no problems with this. If I address this and the other comments, we
can talk about merging this?
Thanks
This bug report was last modified 8 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.