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: Samuel Wales
Subject: Re: fine differences for entire diff in diff mode
Date: Fri, 6 Jul 2018 14:33:40 -0700

thank you!

it looks like you even did error handling and progress report.


On 7/6/18, Keith Waclena <keith@lib.uchicago.edu> wrote:
> 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)
>


-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.



reply via email to

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