From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Use cases for post-redisplay hooks Date: Thu, 07 Jul 2016 13:19:03 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1467923074 8287 80.91.229.3 (7 Jul 2016 20:24:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 20:24:34 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: =?UTF-8?B?Q2zDqW1lbnQ=?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 07 22:24:25 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 1bLFqS-0006pX-U9 for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2016 22:24:25 +0200 Original-Received: from localhost ([::1]:42178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLFqS-0003Uq-1A for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2016 16:24:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLFlb-0005hE-Hm for emacs-devel@gnu.org; Thu, 07 Jul 2016 16:19:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLFlZ-0007qJ-M0 for emacs-devel@gnu.org; Thu, 07 Jul 2016 16:19:22 -0400 Original-Received: from nov-007-i617.relay.mailchannels.net ([46.232.183.171]:47698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLFlU-0007p2-6j; Thu, 07 Jul 2016 16:19:17 -0400 X-Sender-Id: _forwarded-from|45.48.239.195 Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 6ADBC100AD8; Thu, 7 Jul 2016 20:19:09 +0000 (UTC) Original-Received: from cobb.liquidweb.com (ip-10-220-9-73.us-west-2.compute.internal [10.220.9.73]) by relay.mailchannels.net (Postfix) with ESMTPA id 9BD7910051E; Thu, 7 Jul 2016 20:19:08 +0000 (UTC) X-Sender-Id: _forwarded-from|45.48.239.195 Original-Received: from cobb.liquidweb.com (cobb.liquidweb.com [10.91.5.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.6.15); Thu, 07 Jul 2016 20:19:09 +0000 X-MC-Relay: Forwarding X-MailChannels-SenderId: _forwarded-from|45.48.239.195 X-MailChannels-Auth-Id: liquidweb X-MC-Loop-Signature: 1467922749050:3321550174 X-MC-Ingress-Time: 1467922749050 Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51860 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1bLFlI-00034r-Ga; Thu, 07 Jul 2016 16:19:04 -0400 X-AuthUser: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.232.183.171 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:205377 Archived-At: With my limited computer skills, I was not able to find the "sweet spot" = in the redisplay code where I knew for sure that `window-start' and `wind= ow-end' were always going to be correct such that I could easily set a hy= pothetical `needs-recalculation' flag to `nil'. When I tried applying ov= erlays too late in time in the redisplay cycle, there were visual problem= s updating the screen. With my custom `window-start-end-hook' (with accepts a function with argu= ments for `window-start' and `window-end'), I use a test (built into the = C code) to see whether point is fully visible before I run the Lisp funct= ion attached to the hook. However, it assumes that `make-cursor-line-ful= ly-visible' remains set at the default value of `t'. I use `(setq scroll= -conservatively 101)'. On my todo-list, is to figure out how to incorpor= ate a test (akin to `needs recalculation') for when `make-cursor-line-ful= ly-visible' is set to `nil'. Essentially, redisplay does less work when = `make-cursor-line-fully-visible' is `nil'. I've been using a custom buil= d of Emacs with the `window-start-end-hook' since shortly after generatin= g Emacs feature request 22404. Keith At Thu, 7 Jul 2016 15:44:13 -0400, Cl=C3=A9ment Pit--Claudel wrote: >=20 > But I meant =C2=AD=E2=80=94 can't you update this flag yourself, and do= at most one recalculation per command loop?