From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Can we make set_point_both less expensive? Date: Fri, 20 Mar 2015 09:08:25 +0100 Message-ID: <550BD579.9040804@gmx.at> 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> <550A7FFB.7040502@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1426838949 25534 80.91.229.3 (20 Mar 2015 08:09:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 08:09:09 +0000 (UTC) Cc: Eli Zaretskii , dancol@dancol.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 20 09:09:00 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 1YYrzD-0001x5-W8 for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 09:08:56 +0100 Original-Received: from localhost ([::1]:42747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYrzD-0003EW-7L for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 04:08:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYrz9-0003CT-5z for emacs-devel@gnu.org; Fri, 20 Mar 2015 04:08:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYrz3-00041M-VD for emacs-devel@gnu.org; Fri, 20 Mar 2015 04:08:51 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:52333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYrz3-00041C-KX; Fri, 20 Mar 2015 04:08:45 -0400 Original-Received: from [188.22.109.224] ([188.22.109.224]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LikE1-1Z6Ydp2j3l-00cvl1; Fri, 20 Mar 2015 09:08:32 +0100 In-Reply-To: X-Provags-ID: V03:K0:keVukdRbohG2AYUIeKUrUCQFAnS+A9O5CuGG1YT9fkkwxPhBxuf ADmuXZXmlNZiDJIVcI/KjAdh4imKEiseY5GumxyDLuGdD8P3h56R2/BM34vChUvgKig07JJ D+iFM7xw/NkHlBZXBB/rt0dSJIAxhIefiOZSCqKDr6e1ZAg2pR/ynmn9cPiZMXVQ+8idsox 2X+l6sYNMVXYznQl9lZyg== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.19 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:184033 Archived-At: >> So I'd rather try to inhibit potential misbehavior than to fix it. > > Not running the hook a second time (like we do now) doesn't inhibit this > bad interaction. > And I'm not sure how we could actually inhibit this bad interaction. By not running the same hook twice (AFAIAC a bad interaction is only one where the function and redisplay try forever to annihilate each other's actions). Although one problem of `pre-redisplay-function' is that for my taste it already runs a bit too often, for example, whenever we blink the cursor. > Tho, I'd expect that this function will need/want to do exactly the same > as pre-redisplay-function, so maybe keeping a single function (but > providing it with some extra argument/data to distinguish the two cases > if/when needed) would work better. But wouldn't we then have to change the signature of functions on `pre-redisplay-function'? In any case, I don't know yet about the major use cases you have in mind. `redisplay--update-region-highlights' is not very overhead-intensive and thus probably not very representative for what may follow. With `scroll-restore-mode' I'm only interested in calls where redisplay has already calculated the prospective position of `window-point'. The current version of `pre-redisplay-function' is not useful for that. > And it still wouldn't prevent bad interactions (this new hook could > still move point out of the window), of course. Yes. And redisplay would move it back (or maybe not if we decide to allow such behavior in general and not for horizontal scrolling alone). martin