[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Diff could also show the changes within lines

From: Tom
Subject: Re: Diff could also show the changes within lines
Date: Mon, 19 Nov 2012 17:45:20 +0000 (UTC)
User-agent: Loom/3.14 (

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

I don't use Gnus, but from your decription it seem this line

(run-at-time 0.0 nil (lambda () (goto-char (point-min)))))

causes the problem. It is executed after the current command is
finished and I guess Gnus puts back the cursor to the summary
buffer, so this delayed (goto-char (point-min)) is executed

An obvious fix is to execute the delayed goto-char only if 
the cursor is in a diff buffer after the command, that is
don't do it in the Gnus summary buffer:

(run-at-time 0.0 nil (lambda ()
                       (if (eq major-mode 'diff-mode)
                           (goto-char (point-min)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]