From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mats Lidell Newsgroups: gmane.emacs.devel Subject: Re: Odd behavior when moving point over invisible text Date: Tue, 06 Jun 2023 14:07:07 +0200 Message-ID: <87zg5cpzf8.fsf@gnu.org> References: <87cz2ac390.fsf@gnu.org> <83ilc23w0p.fsf@gnu.org> <87a5xdqyfv.fsf@gnu.org> <83v8g03j6z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5667"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 06 14:09:28 2023 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 1q6VVA-0001Hw-93 for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Jun 2023 14:09:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6VTD-0004E1-GM; Tue, 06 Jun 2023 08:07:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6VT0-0003vy-An for emacs-devel@gnu.org; Tue, 06 Jun 2023 08:07:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6VSz-0000DU-Ny for emacs-devel@gnu.org; Tue, 06 Jun 2023 08:07:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ftVq7wvSAqExkNX1FMJ9VMG4GbOnZQn38yG+YE7fQnM=; b=FVmI37mAdbcAKzIwaJMd 6svbqilzDZVuhw2zL1qmrJUnbMeqEUp/Zd3K/mufhipjEJQoAaQulOYlNLyBqYFqnsAdCxMCiL/J8 p2sFJ7Mi9yOXvbrl3NUHTMwNBKu1TjMR6wQm1Mid6JhyDUf2MK71ZafkL0lwK/ISuDfT9IU1M6vy8 sqVQYI7kkAoo9bX6FYqS2CRQMtzc0V0RTS1QSLrbdh1Q8X1HXfcaFarV8YNG09IpbGkn89UGDWVi4 C78UhIKVj40PneQcaza4OZmnNpjx/5F1IW/eLEenjwYx9o3fHOXrLzTLYGNi2zCj6c5TcO2eZOaAc hXZmg38+tCpPkw==; Original-Received: from c80-217-132-174.bredband.tele2.se ([80.217.132.174] helo=zerblatt) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6VSx-0004jI-Rw; Tue, 06 Jun 2023 08:07:12 -0400 In-Reply-To: <83v8g03j6z.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Jun 2023 14:48:36 +0300") 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306666 Archived-At: > Eli Zaretskii writes: > I don't think I understand what you find odd here. My initial "odd feeling" comes from this. Put the point one char away from the ellipsis. Press C-f twice and point moves up to the ellipsis and over it. If I instead do C-u 2 C-f the point will stop at the ellipsis. > What exactly are your expectations from this heuristic? I would expect both ways to move the point to produce the same result. > The commands, like forward-char, aren't changed, they still move by the > exact number of buffer positions they are told to move. The heuristic kicks > in _after_ the command exits, and it (the heuristic) tries to figure out on > which end of the invisible region to put point. When point moves from > "afar" into the invisible region, how to know whether to put it at the > nearest end or the farthest one? I understand the difficulties and also the problems related to "fixing" this is dawning on me. Thanks for the feedback. For my initial quest to write some unit tests around hidden text I feel better equipped now. I understand why (forward-char) twice can't be used in the unit test to move past the ellipsis since that behavior is connected to the heuristics that will not kick in. %% Mats