emacs-devel
[Top][All Lists]
Advanced

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

Re: Redisplay hook


From: Eli Zaretskii
Subject: Re: Redisplay hook
Date: Sun, 03 Jul 2016 06:27:44 +0300

> From: Clément Pit--Claudel <address@hidden>
> Date: Sat, 2 Jul 2016 15:24:36 -0400
> 
> Is there a standard way to run a function after each redisplay cycle?

No, not that I know of.

> The best I could come up with is the following:
> 
> (defun my-redisplay-hook (&rest args)
>   (message "Redisplayed; %S" args)
>   (set-window-redisplay-end-trigger (selected-window) 1))
> 
> (setq redisplay-end-trigger-functions '(my-redisplay-hook))
> (my-redisplay-hook)
> 
> It seems to work OK, but it relies on the obsolete 
> set-window-redisplay-end-trigger, and the deprecated variable 
> redisplay-end-trigger-functions:
> 
>   This variable is obsolete since 23.1;
>   use ‘jit-lock-register’ instead.
>   This variable may be risky if used as a file-local variable.
> 
> But I'm not sure how jit-lock-register-function can help here.

You don't say what do you want to accomplish with that hook, so it's
hard to give you advice.



reply via email to

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