[Top][All Lists]

[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: Mon, 12 Sep 2016 20:56:22 -0700
User-agent: mu4e 0.9.17; emacs 25.1.1

address@hidden writes:

> Dima Kogan <address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]