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: Can we make set_point_both less expensive? Date: Wed, 18 Mar 2015 15:24:35 -0400 Message-ID: References: <5505E34C.4000106@dancol.org> <838uex1u1m.fsf@gnu.org> <8361a029p2.fsf@gnu.org> <83vbi0zukw.fsf@gnu.org> <55080104.9070606@gmx.at> <5508800E.3070600@gmx.at> <55092AE0.1080206@gmx.at> <5509CC67.5010207@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426706731 5306 80.91.229.3 (18 Mar 2015 19:25:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Mar 2015 19:25:31 +0000 (UTC) Cc: Eli Zaretskii , dancol@dancol.org, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 18 20:25:21 2015 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 1YYJai-0008Fk-E1 for ged-emacs-devel@m.gmane.org; Wed, 18 Mar 2015 20:25:20 +0100 Original-Received: from localhost ([::1]:35412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYJah-0000Bf-Dv for ged-emacs-devel@m.gmane.org; Wed, 18 Mar 2015 15:25:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYJaW-0000A6-5c for emacs-devel@gnu.org; Wed, 18 Mar 2015 15:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYJaS-00028e-4X for emacs-devel@gnu.org; Wed, 18 Mar 2015 15:25:08 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:37599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYJaO-00022e-8P; Wed, 18 Mar 2015 15:25:00 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 8E4758515D; Wed, 18 Mar 2015 15:24:59 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id F00C11E5B8C; Wed, 18 Mar 2015 15:24:35 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id C21D2B40DB; Wed, 18 Mar 2015 15:24:35 -0400 (EDT) In-Reply-To: <5509CC67.5010207@gmx.at> (martin rudalics's message of "Wed, 18 Mar 2015 20:05:11 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184004 Archived-At: >> We don't have to have an endless loop. We can decide to stop the loop >> at any point. Since such inf-loop would be an error in any case it's >> perfectly OK to end up with an "incorrect" display. > The loop wouldn't be "an error in any case". It would be the result of > an interaction of the function on the hook and the display engine. Right, but such an interaction is undesirable, so it would reflect a misbehavior, i.e. an error. >> Currently we decide to stop the loop before it can even start, so we end >> up with an incorrect display even if there would not be any such >> inf-looping. > I'd be among the first to appreciate a hook that is run once after the > display engine has established new window-start/-end/-point positions. > But having the display engine potentially call that hook again and again > would scare me. I don't want an inf-loop either. Basically, I'd want something like: 1- pre-redisplay-function 2- do redisplay 3- point is out of the window, so move point 4- pre-redisplay-function again 5- do redisplay again 6- point is out of the window again, so move point again but without going through a new redisplay loop (might want to record the problem in *Messages* instead) tho the exact behavior of 6 is not very important to me (as long as it doesn't loop indefinitely). Also, step (4) will often do nothing in which case we should be able to skip 5 and 6. For that we might need to slightly change pre-redisplay-function by making it return whether something was changed or not. Stefan