help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fine differences for entire diff in diff mode


From: Keith Waclena
Subject: Re: fine differences for entire diff in diff mode
Date: Fri, 06 Jul 2018 11:06:07 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Samuel Wales <samologist@gmail.com> writes:

> i know that i can do fine differences for a hunk.
>
> is there a command to do fine differences for the entire buffer?
>
> thanks.

I wanted the same thing and couldn't find it, so I wrote this:

(defun kw-diff-highlights ()
  "Plow through all the hunks in this diff, which has the side-effect of 
refining
the micro-differences in each."
  (save-excursion
    (goto-char (point-min))
    (let ((pr (make-progress-reporter "Refining diff hunks... ")))
      (condition-case err
          (while t                      ; loop exited when diff-hunk-next 
raises an error at EOB
            (progress-reporter-update pr)
            (diff-hunk-next))
        (user-error nil)
        (error (message "kw-diff-highlights: unexpected error: %S" err)))
      (progress-reporter-done pr))))

(add-hook 'diff-mode-hook 'kw-diff-highlights)


--
Keith Waclena / Arch Linux / OCaml / M-x / ATKQJ / YASD / gc'e'a' / \clef treble
http://www.lib.uchicago.edu/keith/    gpg 5DA89C7DECA0D55A
n.p.: I'll Make You Sorry (Screaming Females)



reply via email to

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