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.bugs Subject: bug#64724: 30.0.50; Inconsistency between manual, comments in the code, and implementation of point adjustment Date: Wed, 19 Jul 2023 19:43:21 +0300 Message-ID: <83fs5j4zti.fsf@gnu.org> References: <87bkg81j0i.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20802"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64724@debbugs.gnu.org To: Ihor Radchenko , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 19 18:44:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qMAHs-00058u-Tk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jul 2023 18:44:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMAHV-0007DG-Av; Wed, 19 Jul 2023 12:44:05 -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 1qMAHT-0007Ct-Ba for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 12:44:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMAHT-00041g-2p for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 12:44:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qMAHS-0002OY-Ht for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2023 12:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jul 2023 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64724 X-GNU-PR-Package: emacs Original-Received: via spool by 64724-submit@debbugs.gnu.org id=B64724.16897849849135 (code B ref 64724); Wed, 19 Jul 2023 16:44:02 +0000 Original-Received: (at 64724) by debbugs.gnu.org; 19 Jul 2023 16:43:04 +0000 Original-Received: from localhost ([127.0.0.1]:57058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMAGV-0002NG-PM for submit@debbugs.gnu.org; Wed, 19 Jul 2023 12:43:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMAGO-0002Mg-Qi for 64724@debbugs.gnu.org; Wed, 19 Jul 2023 12:43:02 -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 1qMAGI-0001zg-RH; Wed, 19 Jul 2023 12:42:50 -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=AJT/1iSGATu9NhIJGBOnieNj6TmMTPUzEC4jbPFwyWs=; b=MhPaflUVG9i/ r30P1sNpyZawU846+WRwfbzBKmXFti2eixU/nIxE+BWPmFe8ZBd1oBkYYjq4j74D9vmYRLHkugsAF /7RmVHUOb/wo9qaHitMZzwnBJtXFS3BQjSg4jyV415R1m1KviOYTs0rQiIJcQX2vYx6B5nh2IL7Rq hqflxNHo88j06ypMsbhLxwmy+WvZ2hlCjWNjr72Ch8XTYi1XPKL7+x2z5j3MCv09A3878DWjwRC43 rbLw5dhMtzoyY8ECZa/QelDFosnxp475bD76nMn/o3j2MCCgzVBa7Frioys+G7IxR7Hcn4NUFggt0 wGMfOnjiXe6hdMWzkWiMjA==; 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 1qMAGI-0006g0-Az; Wed, 19 Jul 2023 12:42:50 -0400 In-Reply-To: <87bkg81j0i.fsf@localhost> (message from Ihor Radchenko on Wed, 19 Jul 2023 07:02:21 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265553 Archived-At: > From: Ihor Radchenko > Date: Wed, 19 Jul 2023 07:02:21 +0000 > > This is a followup of https://orgmode.org/list/87ilag1pth.fsf@localhost > > We recently ran into some subtleties of point adjustment near invisible > regions with sticky 'invisible property. > > The actual code in `set_point_both' makes sure to move point across > invisible sticky region if point happens to end up right before front > sticky invisible or right after rear sticky invisible region. > > However, 22.6 Adjusting Point After Commands does not mention this > scenario. > > Further, `set_point_both' contains the following comments: > > /* If the preceding character is both intangible and invisible, > and the invisible property is `rear-sticky', perturb it so > that the search starts one character earlier -- this ensures > that point can never move to the end of an invisible/ > intangible/rear-sticky region. */ > charpos = adjust_for_invis_intang (charpos, -1, -1, 1); > <...> > /* If the following character is both intangible and invisible, > and the invisible property is `front-sticky', perturb it so > that the search starts one character later -- this ensures > that point can never move to the beginning of an > invisible/intangible/front-sticky region. */ > charpos = adjust_for_invis_intang (charpos, 0, 1, 1); > > However, 'intanglible text property is, in fact, not necessary to > trigger the adjustment. > > May you (1) document this behaviour in the manual; (2) clarify what's up > with intanglible. I think you confuse two different point-adjustment behaviors. What the ELisp manual describes is the one implemented in adjust_point_for_property and the code which calls it from command_loop_1. set_point_both does a different job for different situations, AFAIU. If you ignore set_point_both, what exactly is wrong about that short section in the manual? Adding Stefan, in case he has comments.