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#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Date: Sat, 30 Jul 2022 11:51:45 +0300 Message-ID: <83r12356fy.fsf@gnu.org> References: <875yjfrq2w.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6278"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56837@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 30 10:55:17 2022 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 1oHiFh-0001OU-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 10:55:17 +0200 Original-Received: from localhost ([::1]:48658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHiFe-0002rr-QA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 04:55:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHiDW-0001ir-J8 for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHiDW-0004aW-7D for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHiDW-0008T5-0z for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:53: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: Sat, 30 Jul 2022 08:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs Original-Received: via spool by 56837-submit@debbugs.gnu.org id=B56837.165917112232424 (code B ref 56837); Sat, 30 Jul 2022 08:53:01 +0000 Original-Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 08:52:02 +0000 Original-Received: from localhost ([127.0.0.1]:34013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHiCX-0008Qg-L2 for submit@debbugs.gnu.org; Sat, 30 Jul 2022 04:52:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHiCS-0008QI-7K for 56837@debbugs.gnu.org; Sat, 30 Jul 2022 04:52:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHiCN-0004PD-0K; Sat, 30 Jul 2022 04:51:51 -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=/INip7e2ib4GIxQVcwlZC0KzB93Vnsprrlo2lVuo9ww=; b=M2Qqnn1EH6g3 CqH0bxTX20W1PhawAXdMG4CzqThbcMxRUet/pQ8I97xZUznXTbd9a5LCS9y+w/Mn30tCJrC5oCEL4 SPfrHuMBegM/Fem+kHYKG4O2gHJ8npkS4QAr/2k3ZBhQhqwtBWRpe547dOIvRvjDnRgm6yQmmeZ30 eO02F6Vwug0f//ZHur0llUj7TFrHYX539QKiJqiiJZHhKkYpDpbTOHuECtaohI193wbAsXiUiHKLk 02/Syq7KZ/QnhiaRYDQD1qer4Cq7Zyl/0Ql+aud9vPnfvzk3aqOZ1Xg0M1IKmVmXazB+2pisGtJjp pqbsRezsr1PWnNUyhnJezA==; Original-Received: from [87.69.77.57] (port=4108 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 1oHiCM-0006xs-AK; Sat, 30 Jul 2022 04:51:50 -0400 In-Reply-To: <875yjfrq2w.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 15:56:39 +0800) 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" Xref: news.gmane.io gmane.emacs.bugs:238243 Archived-At: > From: Ihor Radchenko > Date: Sat, 30 Jul 2022 15:56:39 +0800 > > 1. emacs -Q > 2. M-x outline-mode > 3. Insert > > * something > a > * else > > 4. Move point to "* something" > 5. to fold the outline > 6. M-: (save-excursion (search-forward " a") (current-indentation)) > ;; => 2 > 7. M-: (remove-from-invisibility-spec '(outline . t)) > 8. M-: (add-to-invisibility-spec '(outline)) > 9. M-: (save-excursion (search-forward " a") (current-indentation)) > ;; => 0; expected: => 2 I don't understand what is the purpose of asking about indentation of a line that is completely invisible. current-indentation skips invisible characters, so if everything is invisible, why do you expect any useful result? Technically, the difference between the two results is because current-indentation tries to account for the ellipsis (which is present in the first case but not in the second). But that's not relevant to the larger issue at hand here. Bottom line: I think you are hitting undefined behavior here.