From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Allowing point to be outside the window? Date: Sun, 28 Nov 2021 15:44:13 +0200 Message-ID: <83o864wg2a.fsf@gnu.org> References: <87ilwd7zaq.fsf.ref@yahoo.com> <87ilwd7zaq.fsf@yahoo.com> <83bl24yaed.fsf@gnu.org> <87sfvg7l51.fsf@yahoo.com> <83zgpowu23.fsf@gnu.org> <87zgpo5tws.fsf@yahoo.com> <83pmqkwi6r.fsf@gnu.org> <87v90c5su6.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13729"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 28 14:45:01 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrKUH-0003OV-84 for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 14:45:01 +0100 Original-Received: from localhost ([::1]:60278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrKUE-0002KC-PR for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 08:44:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrKTM-00012L-Nr for emacs-devel@gnu.org; Sun, 28 Nov 2021 08:44:06 -0500 Original-Received: from [2001:470:142:3::e] (port=33546 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrKTL-0002ig-WA; Sun, 28 Nov 2021 08:44:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QKhn//Q+TLvfI+6DpnhLsqzZx8K5VPnn8+Igkx/nwxA=; b=iijp0HwHaBAU IAWHey+8NmkqyPSuGkxG0H+mGjn/YWrKXTQ+0EN0KzV9QQj7hEUQnZzrH1iMDBr5luYJg2t5hFFWb 5gIq5pJ4FiATfUHGA3gG2+ASc61rVjpE/aC+ePzHyA6aYbv4eytQva0K9E49Ecyer4gYeSDy3QCN7 BvMSecyaHrPUMYYkZ3SJ2VmAGkj9uu29iVfBNDw+PmgPFhDeoBC9zsBBGgsZav1PYDJDjLrBrxzi6 F5StEMxAc9bq22FAvEKFIZnQur6lyXQPJdcK96/ADHkZrvu42LU1cX2K2L3ce4rSmxAC4Xi/srwur mtm2iuZY+hd3/sg2tvC4Cg==; Original-Received: from [87.69.77.57] (port=3984 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrKTL-0004p0-KP; Sun, 28 Nov 2021 08:44:03 -0500 In-Reply-To: <87v90c5su6.fsf@yahoo.com> (message from Po Lu on Sun, 28 Nov 2021 21:10:25 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280410 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Sun, 28 Nov 2021 21:10:25 +0800 > > Eli Zaretskii writes: > > >> Hmm, thanks. One small question though: what should I do in order to > >> make a window's cursor invisible? > > > Prevent display_and_set_cursor from being called, I presume? > > What if the cursor is already displayed? Is it OK to call > erase_phys_cursor from redisplay_window? Hmm... I guess it would be better to modify display_and_set_cursor so that it only erases the cursor if needed, but doesn't display it. > > There's also set_cursor_from_row, which calculates where to display > > the cursor, and something should be done about that to indicate that > > the cursor is not shown at all. > > set_cursor_from_row can just immediately return if I indicate that the > cursor is invisible because point is before or after window start, > correct? Yes, but that function is the one that sets the data in window's 'cursor' member, so in this case set_cursor_from_row should somehow indicate there that the cursor is not visible or something. I think. There are several places in the display code which look at that data and rely on it. > > And why only "before window start"? what about beyond window's end? > > I don't know how to get that information inside redisplay_window. > AFAIU, it's not available until redisplay completes. So you will have to add code somewhere that produces this information and records it somewhere, right? It would be not very useful to support "point outside window, but only before the window" feature. You will find in try_scrolling code that finds whether point is beyond the window end. You can do something similar where you need this information. > I hope this isn't the case here, but I can't explain what the "X" here > is in terms more specific than "I want the ability to have point outside > the window". I don't see any way around carefully reading the code and finding all the places where we assume that point is visible, or make it visible if it isn't.