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: Mon, 19 Nov 2012 13:51:00 +0100 Organization: Sebastien Vauban Message-ID: <80sj85lpsb.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> <80a9uift32.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353329715 9786 80.91.229.3 (19 Nov 2012 12:55:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2012 12:55: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 Mon Nov 19 13:55: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 1TaQsn-0004eV-Gx for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Nov 2012 13:55:25 +0100 Original-Received: from localhost ([::1]:58819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaQsd-0007SO-4f for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Nov 2012 07:55:15 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 88 Injection-Info: mx04.eternal-september.org; posting-host="368fa3c7dc5c1bbe516391bd65bd1ab2"; logging-data="1060"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX183szZpO29m3DfZ1qkO+zQd" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:zTTNtY8hvHbkipYB+Svp7CV7D4M= sha1:tF9/481j5K7b5f6MCw83Q07YqLg= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:195458 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:87781 Archived-At: Hi Tom, "Sebastien Vauban" wrote: > Tom wrote: >> Sebastien Vauban writes: >>> >>> And the results of the jury are: > > (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))))) > > Yep! This does work perfectly: all hunks refined, and pointer at beginning of > buffer... > > Thanks a lot for your more than precious help! After a couple of days using this, I've observed a very tricky collateral damage in Gnus... Let's assume I have received 5 mails: --8<---------------cut here---------------start------------->8--- * 18 Sun 14:25 0.2k Foo Mail #1 Hello 18 Sun 14:25 0.4M Bar Mail #2 How are you? 18 Sun 17:58 6.9k Baz Mail #3 [diff] Fix bug 18 Sun 18:06 4.1k Baz Mail #4 [diff] Fix doc 18 Sun 18:27 3.1k Baz Mail #5 I've done it --8<---------------cut here---------------end--------------->8--- * = position of the cursor ... and I want first to read the 3rd one. I position the cursor on that one... --8<---------------cut here---------------start------------->8--- 18 Sun 14:25 0.2k Foo Mail #1 Hello 18 Sun 14:25 0.4M Bar Mail #2 How are you? * 18 Sun 17:58 6.9k Baz Mail #3 [diff] Fix bug 18 Sun 18:06 4.1k Baz Mail #4 [diff] Fix doc 18 Sun 18:27 3.1k Baz Mail #5 I've done it --8<---------------cut here---------------end--------------->8--- ... press RET, get a new buffer created on the mid-right pane, and read it. --8<---------------cut here---------------start------------->8--- * 18 Sun 14:25 0.2k Foo Mail #1 Hello | 18 Sun 14:25 0.4M Bar Mail #2 How are you? | 18 Sun 17:58 6.9k Baz Mail #3 [diff] Fix bug | (contents of 3rd email) 18 Sun 18:06 4.1k Baz Mail #4 [diff] Fix doc | 18 Sun 18:27 3.1k Baz Mail #5 I've done it | --8<---------------cut here---------------end--------------->8--- Then, as I always do, I simply press "n" to read the "next one" (4th)... but Gnus displays me the 1st one! Why? Because the cursor has been positioned on the first line of my *summary* buffer (on the left), after displaying the contents of the "Fix bug" email (on the right). Why? Because diff-mode is called (as that email contains a diff), and some some effect -- which I don't understand -- is that *the cursor is repositioned onto the first line of the summary buffer* (while the code is supposed to be executed in the other window, the one with the *contents* of the mail). So, here, to reproduce the problem, I have to: - have emails with diffs in them (otherwise, diff-mode won't be called) - skip reading the first email (so that, clicking "n" does open the "next" unread email... from the current cursor position, which is wrong here...) I know describing a dynamic behavior is not obvious per email. So, did you understand the description of the problem, at least? Do you understand why this is occurring, or have some helpful ideas? Best regards, Seb -- Sebastien Vauban