GNU bug report logs - #18128
Diff-mode doesn't refine hunks automatically

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Mon, 28 Jul 2014 14:00:02 UTC

Severity: wishlist

Tags: fixed

Merged with 12747, 16798, 21744

Found in versions 23.4, 24.5

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 18128 <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: 18128 <at> debbugs.gnu.org
Subject: Re: Should be done as part of the font-lock
Date: Fri, 04 Nov 2016 00:54:17 -0700
[Message part 1 (text/plain, inline)]
I currently use the following to do auto refining: (modified from
http://emacs.stackexchange.com/a/28321/2755 )

    (defun my-diff-refine-all ()
    "Refine all diffs."
    (interactive)
    (save-excursion
        (goto-char (point-min))
        (ignore-errors
            (diff-beginning-of-hunk t))
        (ignore-errors
            (while (not (eobp))
            (diff-refine-hunk)
            (diff-hunk-next)))))
    (defun my-diff-hunks-highlight-all ()
    "Highlight all hunks in diff-mode."
    (add-hook 'font-lock-mode-hook #'my-diff-refine-all t t))
    (add-hook 'diff-mode-hook 'my-diff-hunks-highlight-all)

Not sure whether it is possible to merge into Emacs after some
adjustment.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 7 years and 5 days ago.

Previous Next


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