From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: Diff could also show the changes within lines Date: Thu, 15 Nov 2012 22:34:57 +0100 Organization: Sebastien Vauban Message-ID: <80a9uift32.fsf@somewhere.org> References: <87txu9arc8.fsf@gmail.com> <80d2zlvnos.fsf@somewhere.org> <80vcd8l0h4.fsf@somewhere.org> <80zk2j3kkf.fsf@somewhere.org> <80obizp4fv.fsf@somewhere.org> <808va3p0ia.fsf@somewhere.org> <80d2zej3kd.fsf@somewhere.org> <80lie2vigu.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353015315 17189 80.91.229.3 (15 Nov 2012 21:35:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 21:35:15 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Nov 15 22:35:26 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 1TZ75o-00048S-07 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Nov 2012 22:35:24 +0100 Original-Received: from localhost ([::1]:48575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ75d-0005jJ-Ir for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Nov 2012 16:35:13 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!news2.arglkargh.de!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Injection-Info: mx04.eternal-september.org; posting-host="5da807328d6a3351ee2b595083918cf6"; logging-data="2877"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX18sZt4voWuKU3jGt+609qmN" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:+3KtBthtqiyRae7ahgIvyccDR3A= sha1:mYft2af5Xs/qdEeVoDHiIF3dAXQ= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:195391 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:87714 Archived-At: Tom, Tom wrote: > Sebastien Vauban writes: >> >> And the results of the jury are: >> - it works for the refining of *all* hunks > > Cool. I think the last hunk is actually processed twice, once when you call > the refine function explicitly and once when the timer mentioned in the bug > report explanation kicks in. But it's not a big deal, probably does not add > a noticable delay. > >> - it does not work wrt the position of the cursor, that is it's at the end >> of the buffer... > > I have no idea what causes this. You can try adding a (goto-char > (point-min)) call to the end of the refine all function Did not work. > or if it does not work then you can try using a null timer for this, so it > is called after the command is finished, and hopefully after that code is > finished which moves the cursor: > > (run-at-time 0.0 nil (lambda () (goto-char (point-min)))) Like this? --8<---------------cut here---------------start------------->8--- (defun my/diff-refine-all-hunks () (interactive) (condition-case nil (save-excursion (goto-char (point-min)) (while (not (eobp)) (diff-hunk-next) (diff-refine-hunk))) (error nil)) (run-at-time 0.0 nil (lambda () (goto-char (point-min))))) --8<---------------cut here---------------end--------------->8--- Yep! This does work perfectly: all hunks refined, and pointer at beginning of buffer... Thanks a lot for your more than precious help! Best regards, Seb -- Sebastien Vauban