From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Date: Sat, 22 Jul 2023 14:05:00 +0000 Message-ID: <87v8ecrqib.fsf@localhost> References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@gnu.org> <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@gnu.org> <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@gnu.org> <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@gnu.org> <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@gnu.org> <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@gnu.org> <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17914"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 22 16:05:17 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 1qNDET-0004NX-AI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 16:05:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNDEG-0000dy-H8; Sat, 22 Jul 2023 10:05:04 -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 1qNDEE-0000dl-L4 for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 10:05:02 -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 1qNDEE-0001Gb-59 for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 10:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qNDED-00083a-Vk for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jul 2023 14:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64696 X-GNU-PR-Package: emacs Original-Received: via spool by 64696-submit@debbugs.gnu.org id=B64696.169003469730956 (code B ref 64696); Sat, 22 Jul 2023 14:05:01 +0000 Original-Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 14:04:57 +0000 Original-Received: from localhost ([127.0.0.1]:37378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNDE9-00083E-CW for submit@debbugs.gnu.org; Sat, 22 Jul 2023 10:04:57 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:53357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNDE7-000831-MX for 64696@debbugs.gnu.org; Sat, 22 Jul 2023 10:04:56 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 393BE240028 for <64696@debbugs.gnu.org>; Sat, 22 Jul 2023 16:04:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690034689; bh=s5rmk197IkMOQR7LglPrTxXPDO5MhM2NPr3TrxREWpw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=h3kZunQYVhUuk7wriswxR1O0CidNMpy/zBSdSuLQLCuqx1AW8xB7Y1+VnsCLPKq1/ ixjfwFuQ8Aymvv2ZSU2avN2U1FQ2B1t2E9bu5/mQ5H86XNQLchDYgK0A3vls+RYokj DfBlk559HV4g7eVfdZ9QXo3mj9soVjFN5n+T/55pYU7hK7GdFgb21HnCzolXCVYHMO 31kSHHWDlFXxGzxoyYu+AvDyQ4q4oypeTx7Mw/+XJHsSPxGW0zZyCch6hBRJYX1mmh NbjWtzyfQitqtt1rogbcb9ykKRGv1ctW6awQ/6ZPndlk4vD/2lvoWATeslPseWfgo/ uOLOuDVA1R5jQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R7Sq40l9Qz6tvJ; Sat, 22 Jul 2023 16:04:47 +0200 (CEST) In-Reply-To: <83wmys8a2g.fsf@gnu.org> 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:265817 Archived-At: Eli Zaretskii writes: >> =E2=9B=94 Warning (emacs): Test #2:: =E2=80=99word=E2=80=99 is inside fo= lded heading (hidden using overlays). >> =E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99 >> =E2=9B=94 Warning (emacs): 1:: current-column =3D 4 >>=20 >> Test #2 is unexpected - we are inside invisible region, but >> current-column reports as if everything were visible. > > current-column produces incorrect results when the newline before the > current line is invisible. It always starts from the beginning of the > current physical line, even if that is in invisible text. Then why does test #3 produce current-column =3D 0? The newline before current line is also invisible there. > We could teach current-column about invisible newlines, see the patch > below. But I'm not sure this is justified, nor whether it won't break > something. The patch below also has a disadvantage that it will still > behave as before for a buffer that is not displayed in any window; if > we want that to be fixed as well, the changes will need to be more > extensive. (Basically, we will need to write a non-display version of > back_to_previous_visible_line_start.) > > With the patch below, Test #2 shows "current-column =3D 6", which is > correct, since the cursor is shown after "* Test", with all the rest > invisible. This will definitely break indentation code. Look at `indent-line-to': (beginning-of-line 1) (skip-chars-forward " \t") (let ((cur-col (current-column))) <...> ((> cur-col column) ; too far right (after tab?) (delete-region (progn (move-to-column column t) (point)) ;; The `move-to-column' call may replace ;; tabs with spaces, so we can't reuse the ;; previous start point. (progn (beginning-of-line 1) (skip-chars-forward " \t") (point)))) In the Test #2 situation, if `current-column' returns 6 and we have * Test word (indent-line-to 3) we will go into (> cur-col column) branch and (delete-region ) In other words, `indent-line-to' with delete "word". I am pretty sure that it is not the only breakage. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at