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.75.164 with SMTP id d4mr5464109paw.10.1352561429973;
        Sat, 10 Nov 2012 07:30:29 -0800 (PST)
Path: 6ni73279pbd.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: Sat, 10 Nov 2012 15:30:04 +0000 (UTC)
Lines: 36
Approved: help-gnu-em...@gnu.org
Message-ID: <mailman.12687.1352561429.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>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1352561429 19084 208.118.235.17 (10 Nov 2012 15:30:29 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.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-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=utf-8
Content-Transfer-Encoding: 8bit

Sebastien Vauban <wxhgmqzgwmuf@...> 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.