Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Diff could also show the changes within lines

Received: by 10.66.73.7 with SMTP id h7mr141405pav.6.1352982672431;
        Thu, 15 Nov 2012 04:31:12 -0800 (PST)
Path: 6ni82927pbd.1!nntp.google.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: Tom <adatgyu...@gmail.com>
Newsgroups: gnu.emacs.help
Subject: Re: Diff could also show the changes within lines
Date: Thu, 15 Nov 2012 12:30:49 +0000 (UTC)
Lines: 31
Approved: help-gnu-em...@gnu.org
Message-ID: <mailman.13025.1352982671.855.help-gnu-emacs@gnu.org>
References: <loom.20121005T163605-672@post.gmane.org>
	<87txu9arc8.fsf@gmail.com>
	<loom.20121005T165541-721@post.gmane.org>
	<loom.20121005T182234-640@post.gmane.org>
	<mailman.10388.1349460693.855.help-gnu-emacs@gnu.org>
	<80d2zlvnos.fsf@somewhere.org>
	<mailman.12687.1352561429.855.help-gnu-emacs@gnu.org>
	<80vcd8l0h4.fsf@somewhere.org>
	<mailman.12981.1352916228.855.help-gnu-emacs@gnu.org>
	<80zk2j3kkf.fsf@somewhere.org>
	<mailman.13015.1352961428.855.help-gnu-emacs@gnu.org>
	<80obizp4fv.fsf@somewhere.org>
	<mailman.13023.1352974557.855.help-gnu-emacs@gnu.org>
	<808va3p0ia.fsf@somewhere.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1352982672 25765 208.118.235.17 (15 Nov 2012 12:31:12 GMT)
X-Complaints-To: action@cs.stanford.edu
To: help-gnu-em...@gnu.org
Envelope-to: help-gnu-em...@gnu.org
X-Injected-Via-Gmane: http://gmane.org/
X-Gmane-NNTP-Posting-Host: sea.gmane.org
User-Agent: Loom/3.14 (http://gmane.org/)
X-Loom-IP: 94.21.222.119 (Opera/9.80 (Windows NT 6.1) Presto/2.12.388
	Version/12.10)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: help-gnu-em...@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
	<mailto:help-gnu-emacs-requ...@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-em...@gnu.org>
List-Help: <mailto:help-gnu-emacs-requ...@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-requ...@gnu.org?subject=subscribe>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> 
> Last thing: can you post your complete chunk of code regarding this? I mean
> with your additional check which calls the automatic highlighting of hunks
> only if the diff is below a certain size? Thanks a lot...

It's quite straightforward:


(add-hook 'diff-mode-hook 'my-diff-stuff)


(defun my-diff-stuff ()
  (unless (or (eq this-command 'dvc-diff) ; does not work with DVC
              (eq this-command 'dvc-generic-refresh)
              (> (buffer-size) 20000))
    (my-refine-all-diff-hunks)))


(defun my-refine-all-diff-hunks ()
  (interactive)
  (condition-case nil      
      (save-excursion
        (goto-char (point-min))
        (while (not (eobp))
          (diff-hunk-next)))
    (error nil)))