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 15:22:58 +0300 Message-ID: <83legw3hlp.fsf@gnu.org> References: <87cz2ac390.fsf@gnu.org> <83ilc23w0p.fsf@gnu.org> <87a5xdqyfv.fsf@gnu.org> <83v8g03j6z.fsf@gnu.org> <87zg5cpzf8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37370"; 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 14:23:46 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 1q6Viz-0009bC-QE for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Jun 2023 14:23:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6ViD-0004uL-Vg; Tue, 06 Jun 2023 08:22:58 -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 1q6ViD-0004uD-C5 for emacs-devel@gnu.org; Tue, 06 Jun 2023 08:22:57 -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 1q6ViD-00053v-39 for emacs-devel@gnu.org; Tue, 06 Jun 2023 08:22:57 -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=JmAycwpmm470x9tPsX0Ikn5uyDgE7oynLB1TxZYQeX8=; b=cBi24qM7XCmy HXFytf1GehOp+h7l1I+7V2ztBPa0eakFO4vspVhAihbMlMV4XE1prvqWgH58cCXKV5QzxjggxfmwT iz7ps1+fRFbA8o1eEP8hmHxz0EyMh+Dl6th91C+y/ZwHMR28s9jE86akxdoadW+NwtnS5eLG+enM9 lckwlyaqGFYBQWXzcHgDjjhPfAo6LuIAC9QC0Fg6TMjcNxuxswpFjopbnN6bPxfoOxnKXg3d8ya1z j2sdojlYSYqY54wQKW77CIbu6gEZn0A5NQ6DiN0d7aD34vrfOLw3IdcpdESvXeWx81vmMSI29HRm0 TtXIek8/yzp8qBQSDu7BhQ==; 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 1q6ViC-0006zK-I0; Tue, 06 Jun 2023 08:22:56 -0400 In-Reply-To: <87zg5cpzf8.fsf@gnu.org> (message from Mats Lidell on Tue, 06 Jun 2023 14:07:07 +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:306667 Archived-At: > From: Mats Lidell > Cc: emacs-devel@gnu.org > Date: Tue, 06 Jun 2023 14:07:07 +0200 > > 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. Why? In the first case, Emacs knows you stopped between the two moves, in the second one you didn't. > 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. If you are writing tests, you are better off disabling point adjustments altogether. See global-disable-point-adjustment.