unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Fabrice Niessen" <fni@missioncriticalit.com>
Cc: 12894-done@debbugs.gnu.org
Subject: bug#12894: 24.2.50; Auto refine all hunks in a diff
Date: Thu, 15 Nov 2012 09:44:19 -0500	[thread overview]
Message-ID: <jwvpq3fvshd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <804nkrp061.fsf@somewhere.org> (Fabrice Niessen's message of "Thu, 15 Nov 2012 12:37:10 +0100")

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





      reply	other threads:[~2012-11-15 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15 11:37 bug#12894: 24.2.50; Auto refine all hunks in a diff Fabrice Niessen
2012-11-15 14:44 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvpq3fvshd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=12894-done@debbugs.gnu.org \
    --cc=fni@missioncriticalit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).