From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Unfreezing the display during auto-repeated scrolling. [ Was: Aborting display. Is this possible? ] Date: Sun, 26 Oct 2014 18:45:47 +0200 Message-ID: <83h9yq4w5g.fsf@gnu.org> References: <8338aidbcq.fsf@gnu.org> <20141020185757.GD2947@acm.acm> <83lhoabl2x.fsf@gnu.org> <20141020210819.GE2947@acm.acm> <87y4s9rgi9.fsf@fencepost.gnu.org> <83zjcpa11g.fsf@gnu.org> <20141021171403.GB3035@acm.acm> <83oat59ucc.fsf@gnu.org> <20141021183807.GD3035@acm.acm> <20141026124333.GA4397@acm.acm> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1414341993 22084 80.91.229.3 (26 Oct 2014 16:46:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2014 16:46:33 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 26 17:46:24 2014 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 1XiQxT-0002qU-5x for ged-emacs-devel@m.gmane.org; Sun, 26 Oct 2014 17:46:23 +0100 Original-Received: from localhost ([::1]:57393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiQxS-0001qm-Sr for ged-emacs-devel@m.gmane.org; Sun, 26 Oct 2014 12:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiQxC-0001qg-Sh for emacs-devel@gnu.org; Sun, 26 Oct 2014 12:46:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiQx8-0004t5-5N for emacs-devel@gnu.org; Sun, 26 Oct 2014 12:46:06 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:35587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiQx7-0004t0-TD for emacs-devel@gnu.org; Sun, 26 Oct 2014 12:46:02 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NE2007008YWPZ00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Sun, 26 Oct 2014 18:46:00 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NE2007QO98NK9A0@a-mtaout23.012.net.il>; Sun, 26 Oct 2014 18:46:00 +0200 (IST) In-reply-to: <20141026124333.GA4397@acm.acm> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.175 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:175864 Archived-At: > Date: Sun, 26 Oct 2014 12:43:33 +0000 > From: Alan Mackenzie > Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org > > Here's what I've done: Conceptually, ITs (i.e. "struct it"s, the > iterators in xdisp.c) are used for two different purposes: > (i) display; > (ii) calculation of displayed character sizes, positions etc. > I've distinguished these two cases by adding an extra boolean flag to IT, > called `not_for_display'. The functions `init_iterator' and > `start_display' have got this as an extra boolean parameter. > > Some of the ITs in window.c and xdisp.c are now designated > `not_for_display'. > > `handle_fontified_prop' now checks this flag in IT. If both the flag and > `use-default-face-for-fast-scrolling' are set, then fontification is not > done. The existing face (usually default) is simply left there. The > code doesn't also check for the event queue being non-empty - in > practice, this didn't work very well. > > Here's the code. Comments and criticism would be welcome. I'm afraid this is a non-starter. Even if this feature is accepted (and I don't like it), it cannot be controlled on such a low level. You cannot possibly know, on this low level, which code will use the "not for display" functions, even if today they are only used in a context where ignoring font-lock faces might be OK. You already marked as "not for display" line-pixel-height, which must be accurate in the results it returns, since otherwise it will violate its contract. Likewise in resize_mini_window (which is definitely "for display"), redisplay_internal (likewise), etc. OTOH, displaying strings (e.g., as part of mode-line display) will never bump into font-lock faces, so setting this flag there is not useful. So if we go this way, we are digging a hole for ourselves -- it is an impossible maintenance burden to have functions that don't exactly do what they say they do under some circumstances. You should only make changes in window_scroll_* functions, and do that only under control of the use-default-face-for-fast-scrolling variable, so that the Lisp application that binds this variable to a non-nil value is the sole source of this behavior, and holds all the responsibility for binding it where it wants. No code should disregard font-lock faces, except when this variable is non-nil. And I still don't understand why writing a simple "fast-scroll" function in Lisp, which just moves point N lines forward or backward, is not a better solution. It's certainly easier and has exactly zero impact on our infrastructure. Thanks.