From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Process: Determining the origin of a command loop. Date: Thu, 20 Dec 2018 16:11:20 +0200 Message-ID: <838t0kcmpj.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1545314988 30828 195.159.176.226 (20 Dec 2018 14:09:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2018 14:09:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 20 15:09:44 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZz1D-0007vI-Vb for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2018 15:09:44 +0100 Original-Received: from localhost ([::1]:37733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZz3K-0003RI-Ig for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2018 09:11:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZz2d-0003Pv-FQ for emacs-devel@gnu.org; Thu, 20 Dec 2018 09:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZz2a-00046L-BS for emacs-devel@gnu.org; Thu, 20 Dec 2018 09:11:11 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZz2a-00046C-7i; Thu, 20 Dec 2018 09:11:08 -0500 Original-Received: from [176.228.60.248] (port=2071 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gZz2Z-0007Kl-K6; Thu, 20 Dec 2018 09:11:08 -0500 In-reply-to: (message from Keith David Bershatsky on Wed, 19 Dec 2018 20:11:57 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:231932 Archived-At: > Date: Wed, 19 Dec 2018 20:11:57 -0800 > From: Keith David Bershatsky > Cc: emacs-devel@gnu.org > > Whereas an individual cursor (the real cursor) has very little overhead, an average of approximately 200 fake cursors are indeed semi-costly and merit optimization. The current draft of crosshairs/visible-fill-column/multiple-fake-cursors relies upon display_and_set_cursor to determine when to generate the goodies. I would like to optimize/suppress the goodies so that they are erased/redrawn only when absolutely necessary. Let us assume that we make the following modifications to the Emacs master branch and evaluate the following Lisp code after launching the newly built Emacs from the terminal so that we can see the STDERR trace-redisplay output. As to the current buffer in this situation, there is no need to erase and redraw the goodies (200 fake cursors) because the cursor is in t he same location and the buffer is unmodified in all respects. The only changes are occurring in the *compilation* buffer, which is not the current buffer. The hallmarks of this situation are "redisplay_preserve_echo_area (12)". I understand, but I think you will have to come up with your own mechanism to check when the crosshairs/visible-fill-column/multiple-fake-cursors need to be updated, because I don't think that can be established from the physical cursor's position or the need to redraw it. Since those fake cursors can be anywhere in the window, and the conditions for updating them are independent of the conditions for moving point, the logic for that must be independently designed and implemented, using the data you maintain for drawing those fake cursors. If you already track that data, then all you need is determine whether any of it changed since the last time.