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: Odd behavior when moving point over invisible text Date: Tue, 06 Jun 2023 14:48:36 +0300 Message-ID: <83v8g03j6z.fsf@gnu.org> References: <87cz2ac390.fsf@gnu.org> <83ilc23w0p.fsf@gnu.org> <87a5xdqyfv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24623"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Mats Lidell Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 06 13:49:33 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 1q6VBt-00067F-7Y for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Jun 2023 13:49:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6VB0-0006Pk-Oq; Tue, 06 Jun 2023 07:48:38 -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 1q6VAz-0006PT-3f for emacs-devel@gnu.org; Tue, 06 Jun 2023 07:48:37 -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 1q6VAy-0002tv-Mi for emacs-devel@gnu.org; Tue, 06 Jun 2023 07:48:36 -0400 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=QqC6MpDo+aymxukaQghN5/3jfs/NEn2eaPZzHfM8+gg=; b=fWXUknmv7A56 FtdyNuJUBVRzd1yRsDXd57+K82dJU0Xg8WEmsxoWODYKpCgmVGz7CC/BdvbulUXstf2GM8ysYEKBY vtYFESUdcdEF+ZbcEqTY5HTEhNzL7i1oHt3qKs4g5EQuiviX3LmdfOOOFAb59dxINc/2wbmGiloL1 1fGwRzGNlOLKBq7E2jVGqa3ekSf4zsA02wl2JGaUv5jD56WHAYoSF5avFQO+uccrt8A0H+DEKIwCS M7ux9g+IcHZTTfeA4Cvs84omVSiP8mLtyRBBJ82jJQ5K4bRQJctDUXYwazS2Wdq4dpzKCcQmoemfz WoHmNGjv6rdKt6mqF3aSLQ==; Original-Received: from [87.69.77.57] (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 1q6VAy-0006c9-32; Tue, 06 Jun 2023 07:48:36 -0400 In-Reply-To: <87a5xdqyfv.fsf@gnu.org> (message from Mats Lidell on Tue, 06 Jun 2023 01:30:44 +0200) 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:306663 Archived-At: > From: Mats Lidell > Cc: emacs-devel@gnu.org > Date: Tue, 06 Jun 2023 01:30:44 +0200 > > But... There is still a thing that I find a little odd but might be the > desired behavior. > > What happens is: If point is before the first dot in the ellipsis and I call > (forward-char) multiple times, from a function or test case, not manually, the > point stays on the first dot (It seems point is really moving in the hidden > text because if the number of times it is repeated is larger than the hidden > text the point comes out on the other side so to say.) > > This can also be demonstrated with trying to pass the ellipsis using a prefix > arg to C-f. It is easiest to demonstrate by having a big text portion that is > hidden. Put the point before the ellipsis on the right parenthesis in the > example file and type C-u 10 C-f and notice that point will stop at the first > dot. Put back the point on the parenthesis and type C-f C-f and point moves > over the ellipsis. I don't think I understand what you find odd here. What exactly are your expectations from this heuristic? 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?