[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation
From: |
Dima Kogan |
Subject: |
bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation |
Date: |
Wed, 07 Sep 2016 00:14:56 -0700 |
User-agent: |
mu4e 0.9.17; emacs 25.1.1 |
npostavs@users.sourceforge.net writes:
> Dima Kogan <dima@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