all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: Re: Diff could also show the changes within lines
Date: Mon, 19 Nov 2012 13:51:00 +0100	[thread overview]
Message-ID: <80sj85lpsb.fsf@somewhere.org> (raw)
In-Reply-To: 80a9uift32.fsf@somewhere.org

Hi Tom,

"Sebastien Vauban" wrote:
> Tom wrote:
>> Sebastien Vauban <wxhgmqzgwmuf@...> 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


  parent reply	other threads:[~2012-11-19 12:51 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 14:37 Diff could also show the changes within lines Tom
2012-10-05 14:39 ` Drew Adams
2012-10-05 14:47   ` Tom
2012-10-05 16:32   ` Doug Lewan
2012-10-05 15:09 ` chandan r
2012-10-05 14:57   ` Tom
2012-10-05 16:26     ` Tom
2012-10-05 18:11       ` Tom
     [not found]       ` <mailman.10388.1349460693.855.help-gnu-emacs@gnu.org>
2012-11-10  8:58         ` Sebastien Vauban
2012-11-10 15:30           ` Tom
2012-11-12 20:00             ` Oleksandr Gavenko
2012-11-13  8:45               ` Tom
     [not found]           ` <mailman.12687.1352561429.855.help-gnu-emacs@gnu.org>
2012-11-14 14:31             ` Sebastien Vauban
2012-11-14 18:03               ` Tom
     [not found]               ` <mailman.12981.1352916228.855.help-gnu-emacs@gnu.org>
2012-11-14 22:07                 ` Sebastien Vauban
2012-11-15  6:36                   ` Tom
     [not found]                   ` <mailman.13015.1352961428.855.help-gnu-emacs@gnu.org>
2012-11-15 10:04                     ` Sebastien Vauban
2012-11-15 10:15                       ` Tom
     [not found]                       ` <mailman.13023.1352974557.855.help-gnu-emacs@gnu.org>
2012-11-15 11:29                         ` Sebastien Vauban
2012-11-15 12:30                           ` Tom
     [not found]                           ` <mailman.13025.1352982671.855.help-gnu-emacs@gnu.org>
2012-11-15 15:20                             ` Sebastien Vauban
2012-11-15 16:32                               ` Tom
2012-11-16 15:30                                 ` Stefan Monnier
2012-11-16 16:40                                   ` Tom
     [not found]                                   ` <mailman.13097.1353084086.855.help-gnu-emacs@gnu.org>
2012-11-19 14:48                                     ` Stefan Monnier
     [not found]                               ` <mailman.13033.1352997200.855.help-gnu-emacs@gnu.org>
2012-11-15 18:17                                 ` Sebastien Vauban
2012-11-15 18:53                                   ` Tom
     [not found]                                   ` <mailman.13043.1353005666.855.help-gnu-emacs@gnu.org>
2012-11-15 21:34                                     ` Sebastien Vauban
2012-11-16 16:24                                       ` Tom
2012-11-19 12:51                                       ` Sebastien Vauban [this message]
2012-11-19 17:45                                         ` Tom
     [not found]     ` <mailman.10380.1349454390.855.help-gnu-emacs@gnu.org>
2012-10-06 13:10       ` Stefan Monnier
2012-10-07 14:10         ` Tom
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07 16:50 Sebastien Vauban
2014-02-08  4:58 ` Michael Heerdegen
     [not found] ` <mailman.14135.1391835521.10748.help-gnu-emacs@gnu.org>
2014-02-08 12:53   ` Sebastien Vauban
2014-02-10 15:55   ` Sebastien Vauban
2014-02-12 11:35     ` Michael Heerdegen
     [not found]     ` <mailman.14857.1392204947.10748.help-gnu-emacs@gnu.org>
2014-02-18 10:09       ` Sebastien Vauban
2014-02-18 11:01         ` Sebastien Vauban
2014-02-18 11:02           ` Sebastien Vauban
2014-02-18 16:07             ` Michael Heerdegen
     [not found]             ` <mailman.15440.1392739818.10748.help-gnu-emacs@gnu.org>
2014-02-18 19:01               ` Sebastien Vauban
2014-02-18 22:12                 ` Michael Heerdegen
     [not found]                 ` <mailman.15497.1392761564.10748.help-gnu-emacs@gnu.org>
2014-02-19 11:08                   ` Sebastien Vauban
2014-02-19 17:54                     ` Michael Heerdegen
2014-02-18 13:40           ` Stefan Monnier
2014-02-18 16:08             ` Michael Heerdegen
2014-02-18 16:04         ` Michael Heerdegen
2014-02-18 16:04         ` Michael Heerdegen
2014-02-18 16:05         ` Michael Heerdegen
2014-03-20 13:31       ` Sebastien Vauban
2014-03-21 11:46         ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80sj85lpsb.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=help-gnu-emacs-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.