From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith Waclena Newsgroups: gmane.emacs.help Subject: Re: fine differences for entire diff in diff mode Date: Fri, 06 Jul 2018 11:06:07 -0500 Message-ID: References: Reply-To: keith@lib.uchicago.edu NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530897449 27295 195.159.176.226 (6 Jul 2018 17:17:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2018 17:17:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Samuel Wales Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 06 19:17:24 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUMF-0006z1-ID for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 19:17:23 +0200 Original-Received: from localhost ([::1]:59015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUOM-0003hX-J8 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 13:19:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbTtm-000268-2q for help-gnu-emacs@gnu.org; Fri, 06 Jul 2018 12:47:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbTth-0003Ni-T1 for help-gnu-emacs@gnu.org; Fri, 06 Jul 2018 12:47:57 -0400 Original-Received: from jfcl.lib.uchicago.edu ([128.135.53.49]:45172) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbTth-0003NO-OB for help-gnu-emacs@gnu.org; Fri, 06 Jul 2018 12:47:53 -0400 Original-Received: from keith by jfcl.lib.uchicago.edu with local (Exim 4.91) (envelope-from ) id 1fbTFH-0005qm-RZ; Fri, 06 Jul 2018 11:06:07 -0500 In-Reply-To: (Samuel Wales's message of "Tue, 19 Jun 2018 13:02:28 -0700") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 128.135.53.49 X-Mailman-Approved-At: Fri, 06 Jul 2018 13:16:05 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117375 Archived-At: Samuel Wales 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)