GNU bug report logs - #17544
24.3; [PATCH] Improved diff-mode navigation/manipulation

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Dima Kogan <dima <at> secretsauce.net>
To: npostavs <at> users.sourceforge.net
Cc: Eli Zaretskii <eliz <at> gnu.org>, Andreas Schwab <schwab <at> linux-m68k.org>, 17544 <at> debbugs.gnu.org
Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation
Date: Mon, 12 Sep 2016 20:56:22 -0700
npostavs <at> users.sourceforge.net writes:

> Dima Kogan <dima <at> secretsauce.net> writes:
c>
>>
>>> 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.





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.