From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.help Subject: Re: Diff could also show the changes within lines Date: Sat, 10 Nov 2012 15:30:04 +0000 (UTC) Message-ID: References: <87txu9arc8.fsf@gmail.com> <80d2zlvnos.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1352561432 24314 80.91.229.3 (10 Nov 2012 15:30:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 15:30:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 16:30:42 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXD17-0004tf-Un for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 16:30:42 +0100 Original-Received: from localhost ([::1]:52486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXD0y-0005Bq-K5 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 10:30:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXD0r-0005Bf-2M for help-gnu-emacs@gnu.org; Sat, 10 Nov 2012 10:30:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXD0n-00048w-V6 for help-gnu-emacs@gnu.org; Sat, 10 Nov 2012 10:30:24 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:39215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXD0n-00048j-Om for help-gnu-emacs@gnu.org; Sat, 10 Nov 2012 10:30:21 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TXD0s-0004k2-Eb for help-gnu-emacs@gnu.org; Sat, 10 Nov 2012 16:30:26 +0100 Original-Received: from 94-21-223-166.pool.digikabel.hu ([94.21.223.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2012 16:30:26 +0100 Original-Received: from adatgyujto by 94-21-223-166.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2012 16:30:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.21.223.166 (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-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87628 Archived-At: Sebastien Vauban writes: > > I'd like to get that feature as well. However, the above code causes me > 2 problems: > > - only the last hunk is getting refined, both in VC dir's buffer, or when > reading (with Gnus) an email with a patch file in it; > Currently I use this code added to the diff mode hook: (defun my-refine-all-diff-hunks () (interactive) (condition-case nil (save-excursion (goto-char (point-min)) (while (not (eobp)) (diff-hunk-next))) (error nil))) It works well for me, it highlights the changes in all hunks automatically. I use it only for diffing before checkin. But. It works only because the VC mercurial implementation calls the backend synchronously. In case of DVC it doesn't work for me, because DVC calls the backend asynchronously, so when the diff hook is run the output is not there yet and I did not find a hook which is called when the async diff command is finished You may want to check how the diff output is produced in your use cases. If it is done asynchronously then the diff hook is not a suitable place to call the highlighting code from.