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 13:08:18 +0300 Message-ID: <83o7x66hgt.fsf@gnu.org> References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@gnu.org> <87v8rfq877.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25456"; 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 12:09: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 1oHjPI-0006R6-BT for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 12:09:16 +0200 Original-Received: from localhost ([::1]:45676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHjPH-0000Sq-8T for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 06:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHjP5-0000S4-9j for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 06:09:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHjP4-0006RJ-AK for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 06:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHjP4-00029m-16 for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 06:09: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 10:09: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.16591757148248 (code B ref 56837); Sat, 30 Jul 2022 10:09:01 +0000 Original-Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 10:08:34 +0000 Original-Received: from localhost ([127.0.0.1]:34067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHjOb-00028y-QX for submit@debbugs.gnu.org; Sat, 30 Jul 2022 06:08:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHjOY-00028g-LM for 56837@debbugs.gnu.org; Sat, 30 Jul 2022 06:08:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHjOT-0006PO-9i; Sat, 30 Jul 2022 06:08:25 -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=E7x5DpQrMOW0a6paMjis5aOh3OE2zKH0j8C4KuBGuRs=; b=ihvjiBeekHXm SFrcDiiTTNHiuVUSCd1oUz1DfvLmKY3mmeDGt2gh/4TPNV02orqC+Btf3lNYvN/Vh3yb4Qnfrva3S IFaf2qyzxEkBS6OLOsG5j8+v+9PMtK57ZszYaXypPCTpTEDThr3+1blBg3e9aT+WyNeRd8GA+zrC3 VQXiAA8ejXElx0lMH8VRtF5cZUC5g8nTEbMlsygle3sy01GRRa/ZcjC1dJ8zjq4inlQ2sGPJqSIkm Ri6nrhXIqFMLbf2t0oX0okxuC0VUyusfxplEpxa2a6NISDlWTUD4JioSlO4nTUCqkpNeDEOZHkdFb HKjpEaTX7+E+4NfCa5keGg==; Original-Received: from [87.69.77.57] (port=4806 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 1oHjOS-0000fT-NT; Sat, 30 Jul 2022 06:08:25 -0400 In-Reply-To: <87v8rfq877.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 17:08:12 +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:238247 Archived-At: > From: Ihor Radchenko > Cc: 56837@debbugs.gnu.org > Date: Sat, 30 Jul 2022 17:08:12 +0800 > > > Bottom line: I think you are hitting undefined behavior here. > > Maybe. But then I'd like to be able to get the "hard" indentation > information for the underlying text in buffer, accounting for tab-width, > and disregarding overlays and other font-lock staff. I guess you should temporarily remove the invisible property? Like this: (let ((invis-spec buffer-invisibility-spec) indent) (remove-from-invisibility-spec '(outline . t)) (setq indent (save-excursion (search-forward " a") (current-indentation))) (setq buffer-invisibility-spec invis-spec) indent)