From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Use cases for post-redisplay hooks Date: Sun, 10 Jul 2016 23:34:05 -0400 Message-ID: References: <577A9156.9070007@gmail.com> <5782C967.8020905@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468208077 16804 80.91.229.3 (11 Jul 2016 03:34:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2016 03:34:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 11 05:34:29 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 1bMRzI-0008Oe-MG for ged-emacs-devel@m.gmane.org; Mon, 11 Jul 2016 05:34:28 +0200 Original-Received: from localhost ([::1]:57701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRzH-0006oJ-Qq for ged-emacs-devel@m.gmane.org; Sun, 10 Jul 2016 23:34:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRzC-0006nn-2i for emacs-devel@gnu.org; Sun, 10 Jul 2016 23:34:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMRz6-0005wR-3P for emacs-devel@gnu.org; Sun, 10 Jul 2016 23:34:21 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRz5-0005w8-Sy for emacs-devel@gnu.org; Sun, 10 Jul 2016 23:34:16 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bMRz2-0008KI-OP for emacs-devel@gnu.org; Mon, 11 Jul 2016 05:34:12 +0200 Original-Received: from 69-165-156-121.dsl.teksavvy.com ([69.165.156.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jul 2016 05:34:12 +0200 Original-Received: from monnier by 69-165-156-121.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jul 2016 05:34:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-156-121.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:qx/Te7jWZuQfSpOJqBaOJBphtXM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:205534 Archived-At: > Summarizing the current discussion: > > (1) Is still valid, though Richard did suggest that we could have Emacs take > the screenshots itself. It would indeed be a useful feature to have, though > it is partly orthogonal, and seems non-trivial to implement. Richard also > suggested special casing this feature and implementing only that instead > of a post-display-hook. > > (2) Does not sound like it would benefit significantly from such a hook (but > I may have missed something). > > (3) Does not resolve to something concrete. On a related note, there could be some use for some kind of "post-redisplay-hook" in follow-mode. But it wouldn't just be `post-redisplay-hook': it would need some way to control also the order in which windows are redisplayed, and it would have to be run "between windows" (at the end of computing the new matrices for a window). The way I imagine this could work is by turning "redisplay" into an Elisp function which internally would use some lower-level C functions such as `recompute-matrices-of-window', `update-display-for-window`, `update-display-for-frame`, and `find-windows-needing-redisplay`. There would also be a need to control what happens when point needs to be moved, or when scrolling is needed. E.g. recompute-matrices-of-window could signal an error of some sort if point is not within the window, and then `redisplay' could react to such an error by either moving point or calling `window-try-scrolling' if/when applicable. Stefan