help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Diff could also show the changes within lines


From: Michael Heerdegen
Subject: Re: Diff could also show the changes within lines
Date: Wed, 19 Feb 2014 18:54:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

"Sebastien Vauban" <sva-news@mygooglest.com>
writes:

> > In any case, the ugly solution of using an idle timer should always
> > work.  Not very cool, but also not worse than doing it manually.
>
> If you're talking of things such as:
>
>     (add-hook 'gnus-article-prepare-hook
>               (lambda ()
>                 (run-at-time 0.0 nil 'my--diff-make-fine-diffs-if-necessary)))
>
>     (add-hook 'gnus-article-mode-hook
>               (lambda ()
>                 (run-at-time 0.0 nil 'my--diff-make-fine-diffs-if-necessary)))
>
> I've tried them both with no success either...
>
> One question I've for the last 2 cases is "where is point?" when those
> functions are run?  If they're in the summary buffer, no luck for me, or
> will it be moved to the buffer where the hook is supposed to be applied?

You mean "which buffer is current?" (every buffer has a `point').  It's
easy: when the timer fires, there's no change of current buffer - there
is no environment restored or so.  The given function is called with the
given args - that's all.  Whatever buffer may be current then.

I would wrap your call in `gnus-with-article-buffer', and also use an
idle timer (`run-with-idle-timer').  If
`my--diff-make-fine-diffs-if-necessary' really works when called
explicitly, it should also work when called by the timer with the right
buffer current after Gnus has finished preparing the buffer.

Regards,

Michael.




reply via email to

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