GNU bug report logs - #12894
24.2.50; Auto refine all hunks in a diff

Previous Next

Package: emacs;

Reported by: "Fabrice Niessen" <fni <at> missioncriticalit.com>

Date: Thu, 15 Nov 2012 11:39:02 UTC

Severity: normal

Tags: notabug

Found in version 24.2.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 12894-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Fabrice Niessen" <fni <at> missioncriticalit.com>
Cc: 12894-done <at> debbugs.gnu.org
Subject: Re: bug#12894: 24.2.50; Auto refine all hunks in a diff
Date: Thu, 15 Nov 2012 09:44:19 -0500
tags 12894 notabug
thanks

> ;; enable Diff Auto Refine mode (highlight the changes with better
> ;; granularity)
> (defun my/diff-refine-all-hunks ()
>   (interactive)
>   (condition-case nil
>       (save-excursion
>         (goto-char (point-min))
>         (while (not (eobp))
>           (diff-hunk-next)))
>     (error nil)))

The fact that my/diff-refine-all-hunks does not call diff-refine-hunk is
a good indication that your code is at least brittle, since it relies on
some side-effect of diff-hunk-next.

What you're seeing is that diff-hunk-next's use of diff-refine-hunk is
only meant for interactive use, so all it does is schedule
diff-refine-hunk to be run "at the end of the current command".


        Stefan




This bug report was last modified 12 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.