From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Redisplay hook Date: Sun, 3 Jul 2016 20:05:17 -0400 Message-ID: <5779A83D.6020201@gmail.com> References: <577814F4.8060500@gmail.com> <8360sns8nj.fsf@gnu.org> <57789637.8020204@gmail.com> <83twg7qi5t.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CCWwIlfuJjGmKh9fJjgm4mhSrWAEwJc3d" X-Trace: ger.gmane.org 1467590792 26738 80.91.229.3 (4 Jul 2016 00:06:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2016 00:06:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 04 02:06:15 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 1bJrOv-0000OM-67 for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2016 02:06:13 +0200 Original-Received: from localhost ([::1]:44558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJrOu-0008I6-D3 for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2016 20:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJrOE-0008Hs-P7 for emacs-devel@gnu.org; Sun, 03 Jul 2016 20:05:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJrOC-0005XN-38 for emacs-devel@gnu.org; Sun, 03 Jul 2016 20:05:29 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.75]:54443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJrO6-0005WS-6C; Sun, 03 Jul 2016 20:05:22 -0400 Original-Received: from [18.189.1.110] ([18.189.1.110]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MCqdn-1bBIwt1NBb-009eH2; Mon, 04 Jul 2016 02:05:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <83twg7qi5t.fsf@gnu.org> X-Provags-ID: V03:K0:Ho9U1MBdZdRIxAx8Tp5O4uiypo2iE4Mo2pPXF8Nmf5t9+kD0b70 Lxy4VlPm3ZSsRSwxVzh8hc5rKATd3TCLjhyBYizOLBVPH33jCoTqduQuTVgkgA4g+aEsTa5 QZEkL8VpPJMA5efqzeJDdLLv++hA63YYNeVOLmwFz9C7QBJc85X/5eEcoAQEeCOG/Mmt4W4 Czta2Flsevq8ofwWYts9w== X-UI-Out-Filterresults: notjunk:1;V01:K0:1gSvBCEmMuI=:ookA8wVlZfuvgIcRqbYT38 I3d3t2PgyArVFgAWl5ploqV2/1kvKat34MaSF77/4Znh3DjsIZikY0deEpI5pYD8TWC5X/3q8 6t7hKj5sOwDj310W+BvKVuOEHWXGu1HDhHFvXc27jKoN4vxocgg8G33htlXmZWkRotJbPcvsD PfiffJCe+3BIH8Z6BULlwYSngKPapZWZneqPWRJu8te2k5jyi1Ktn+kaMy1ABA7kZvvq/qUZT 27eyVmM9aG9XuRQCmRv2CU8/mIPBqEQa08+VzYAnVB1ZugUnwCgabdMT/7S/zndgvdRBMi413 5yDC/3/N7TxQrA+D/+2qWkuAbDdCF/Vnr7lqrW0mguZyl2WiKuVkKbYfFUDX3owN9MXjrRdrX KP7WB4aXvIpdkPVh4vZLzJuO7SyRc4vCpiCk0nx4jcPA+UH3cGrKjZNFROL1PMWd+994cWIVi T1BhSJfYTWr4ls1uy5PlJbjb9GdnL0ZpMW9SE1R+J7bEojunlWa70GXCfEFNqkqH1MZHOMr9k Wg2Ov6M2B/J3qwog7Z5JmnvwwXR4y00ogdZ15P41h8qQBdv7N+hvmNF4B3Dxqw3cDADwXRHyR 06b5W+avwg9/pwvhq7uzMB/KKUpvVUusrKEqJfk82/wLx7NKqKpJXgMk8U1isjW6FQ7kkpjgn SMkP5HYpfUXHzexrnMVRQFHOFj0Rt5AtaPJCYwlKrxfrAI0260jOX/Ukmgxz63dMO+yk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.75 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:205123 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CCWwIlfuJjGmKh9fJjgm4mhSrWAEwJc3d Content-Type: multipart/mixed; boundary="JCem2LFqrc8tfP30Ldpn13MgrjrswDEj5" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Eli Zaretskii Cc: emacs-devel@gnu.org Message-ID: <5779A83D.6020201@gmail.com> Subject: Re: Redisplay hook References: <577814F4.8060500@gmail.com> <8360sns8nj.fsf@gnu.org> <57789637.8020204@gmail.com> <83twg7qi5t.fsf@gnu.org> In-Reply-To: <83twg7qi5t.fsf@gnu.org> --JCem2LFqrc8tfP30Ldpn13MgrjrswDEj5 Content-Type: multipart/mixed; boundary="------------010407010704060906010807" This is a multi-part message in MIME format. --------------010407010704060906010807 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-07-03 03:45, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Cl=C3=A9ment Pit--Claudel >> Date: Sun, 3 Jul 2016 00:36:07 -0400 >> >> It's true :) I'd like to make screencasts (gifs) by saving a picture o= f an Emacs window or frame after each redisplay (I tried a number of prog= rams that record screencasts, but they all gave disappointing results; by= saving a picture (and a timestamp) after each redisplay, I might get muc= h better results). >=20 > As a temporary measure, try calling your code from the function > update_end (you will have to modify the C sources for that). Thanks for the pointer. I applied the attached patch, and it works very n= icely. Could we refine it into a proper feature and apply it to master? O= r are there reasons against a post-display hook? > I think such an application needs to hook into the GUI system, not > into Emacs. That's because, at least on X, AFAIK Emacs doesn't > necessarily flush the queue of X commands each time it finishes > redisplay, so you may be disappointed by the results anyway. It actually works very nicely :) Out of luck, maybe? In any case, I've up= loaded a screencast generated by saving a screenshot at the end of each r= edisplay cycle to http://web.mit.edu/cpitcla/www/emacs-screencast.gif . L= et me know what you think! It behaves nicely wrt, for example, the pulsin= g of xref-find-definition or the animations of M-x butterfly. Cheers, Cl=C3=A9ment. --------------010407010704060906010807 Content-Type: text/x-diff; name="0001-Add-a-post_display_hook.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Add-a-post_display_hook.patch" =46rom c9cfc3e17b5bddb3a19951344da8d1c947d56643 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Cl=3DC3=3DA9ment=3D20Pit--Claudel?=3D Date: Sun, 3 Jul 2016 19:58:35 -0400 Subject: [PATCH] Add a post_display_hook --- src/xterm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index 9fb19a1..f8e3ef0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1230,8 +1230,11 @@ x_update_end (struct frame *f) XFlush (FRAME_X_DISPLAY (f)); unblock_input (); #endif -} =20 + block_input (); + run_hook(Qpost_redisplay_hook); + unblock_input (); +} =20 /* This function is called from various places in xdisp.c whenever a complete update has been performed. */ @@ -12739,6 +12742,12 @@ With MS Windows or Nextstep, the value is t. */= ); #endif =20 DEFSYM (Qmodifier_value, "modifier-value"); + DEFSYM (Qpost_redisplay_hook, "post-redisplay-hook"); + + DEFVAR_LISP ("post-redisplay-hook", Vpost_redisplay_hook, + doc: /* Hook run at end of redisplay. */); + Vpost_redisplay_hook =3D Qnil; + DEFSYM (Qalt, "alt"); Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); DEFSYM (Qhyper, "hyper"); --=20 2.9.0 --------------010407010704060906010807-- --JCem2LFqrc8tfP30Ldpn13MgrjrswDEj5-- --CCWwIlfuJjGmKh9fJjgm4mhSrWAEwJc3d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXeag9AAoJEPqg+cTm90wj/BYP/j1B8/SkLgk/0pGnagz8Jb4o DXI8D3yK071YSCAy3v62XRG+3ZaMjRZuTGNtBki81IUOZQCGi+MPQm/PPpBM2IGs fuH6lhTD2xpgzqXS/a7Tl//IUSnIYiOhklMCcNED2sXD0sFj/t7KPw0VHECCNFC/ JP2wL+PMzJUfZY7dIM7pzGriKIOAl8uqJY5BZ+aObr9vSofrLyPgc69QOSkYwpi8 pCb7vJyo2UK2xUn2jKljiTWWnBra2tCB+FFPv9eqQJFyaMwXMqz7uQ4F7iKyKXJC U7q5Pwsn56ZoMDv3LwPsWLAg0dTUjV5il1fS2izeveDbeU3eY1ew+C0W/QFg2BgJ Qp6TqzpiCDXzzv3ncJI3hTAaKxUl/iACEtb/I8QcTUs8XxTNWAeAGTW3tzE5hGz7 mOJYm6rUPshBA6BQD5stEmkd0lNEjSpcPqdsaJXA2+ZYdoBleMnwDYsbuSG3Lo0G rBtGuOeErFgE39TVZvX7zmb1KG620B6SZAng4pq2DBZWallq25+7P96BR4IkxJN9 G4T6OBB0y2cc4l845KP7vIt4gw6rqSTA88k39Vp51SI6bG+EZ7qmuA+Ug762bgb+ WcchyBX2eNeJGrivh27b5H5tBfnfs5bbWSuYjqO/S9q4xjy7VErC9GxtedezQr3g KXfUg7Ycc5qKFiGdWvkP =9iau -----END PGP SIGNATURE----- --CCWwIlfuJjGmKh9fJjgm4mhSrWAEwJc3d--