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: Highlighting cursor for char before Date: Wed, 27 Oct 2021 22:04:49 +0300 Message-ID: <837ddyuw4u.fsf@gnu.org> References: <1844951.jBraE47yQ0@galex-713.eu> <2960319.aSkrYHcR6s@galex-713.eu> <8335omwjao.fsf@gnu.org> <3758334.UuyoW76GZr@galex-713.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38133"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alexandre Garreau Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 27 21:35:28 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 1mfohr-0009hs-Ff for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Oct 2021 21:35:27 +0200 Original-Received: from localhost ([::1]:44426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfohq-00062p-0n for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Oct 2021 15:35:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfoEF-0008Mf-Hd for emacs-devel@gnu.org; Wed, 27 Oct 2021 15:04:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfoEF-0008Ir-88; Wed, 27 Oct 2021 15:04:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=SLUfs/kH8sALNPo9zAv27tCgZBVIP5RTq8pPnDDJAlU=; b=YDs8BbRpsXspL8u6cFyp kksICBxOP9AoM65u87BwGBwIFJeiu1v1uP3ouWiUsAk0UDW/7Urq87hDicgjpgDmgKqeb4p3zTrt0 WE9LmyDKg20vCQCRR+ysuSKhFS1o+w9+7yq2VXvWaSM2o2deF280OPlALwatCk5Tidjmzm/hrqhx0 SzMuFeNi7ORhbAPnZ0dSYDU3R1qSWiJa6JRa0riUOXEZ5wL5FO0gkW73nXN2ttfrOygymq1ArJMYX Dsz1H3we9rrhIp4lpJosgk3Juj4udhfay/ic8kMVh8Vx3qYkOPULTTp4XjvDeQ6HbYcgg7Toh0LZk CiI1LLjh6Nud/Q==; Original-Received: from [87.69.77.57] (port=1645 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 1mfoEE-00061S-5J; Wed, 27 Oct 2021 15:04:50 -0400 In-Reply-To: <3758334.UuyoW76GZr@galex-713.eu> (message from Alexandre Garreau on Wed, 27 Oct 2021 20:49:47 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:278044 Archived-At: > From: Alexandre Garreau > Cc: emacs-devel@gnu.org > Date: Wed, 27 Oct 2021 20:49:47 +0200 > > To me, in LTR, currently with the current behavior, in both insert and > ovrwt mode, that block is underlining “the place where will appear the > character I type” (first assertion), and that’s its meaning. It also > underlines the character that will be deleted if I press Suppr or C-d > (second assertion), but since most of the time I use DEL, that’s > irrelevant, because the character that would be deleted if I press DEL is > not the one underlined. > > In RTL, currently, the second assertion holds, but the first doesn’t… Only if you type RTL text inside a paragraph whose base direction is left-to-right. If you type RTL text in a paragraph with right-to-left base direction, both assertions hold. > > It is complex, yes. That's what I tried to explain. > > Isn’t it just a matter of taking the current behavior and reversing the > way the block is drawed compared to the cursor position (the position > between two chars that we would see if the cursor was just a line)? I don't think I understand what you mean by "reversing" here. The function that decides where to draw the cursor is set-cursor_from_row; please study it before talking about these details, because otherwise we won't have a common understanding on which to build any meaningful discussion. > and still: is that in xdisp.c? Most of it, yes. > > And I don't think it makes sense to display the cursor on the > > character before point, because it will be terrible in bidirectional > > context. > > Why so? Because no other program does that.