From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Redisplay hook Date: Sun, 03 Jul 2016 06:27:44 +0300 Message-ID: <8360sns8nj.fsf@gnu.org> References: <577814F4.8060500@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1467516525 15648 80.91.229.3 (3 Jul 2016 03:28:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2016 03:28:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 03 05:28:44 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bJY5L-0002ac-2w for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2016 05:28:43 +0200 Original-Received: from localhost ([::1]:41041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJY5G-0007ou-UK for ged-emacs-devel@m.gmane.org; Sat, 02 Jul 2016 23:28:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJY4h-0007oo-Du for emacs-devel@gnu.org; Sat, 02 Jul 2016 23:28:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJY4d-0005xd-4t for emacs-devel@gnu.org; Sat, 02 Jul 2016 23:28:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJY4d-0005xR-1f; Sat, 02 Jul 2016 23:27:59 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3925 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bJY4b-00086F-Bb; Sat, 02 Jul 2016 23:27:57 -0400 In-reply-to: <577814F4.8060500@gmail.com> (message from =?utf-8?Q?Cl=C3=A9?= =?utf-8?Q?ment?= Pit--Claudel on Sat, 2 Jul 2016 15:24:36 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205102 Archived-At: > From: Clément Pit--Claudel > 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.