X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Ihor Radchenko <yantar92@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 07:57:01 +0000 Resent-Message-ID: <handler.56837.B.165916777917913 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 56837 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.165916777917913 (code B ref -1); Sat, 30 Jul 2022 07:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jul 2022 07:56:19 +0000 Received: from localhost ([127.0.0.1]:33953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHhKc-0004eq-PW for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 03:56:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:43788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>) id 1oHhKZ-0004eg-To for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 03:56:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>) id 1oHhKU-0001cB-T0 for bug-gnu-emacs@HIDDEN; Sat, 30 Jul 2022 03:56:15 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:39485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>) id 1oHhKG-0004xj-6l for bug-gnu-emacs@HIDDEN; Sat, 30 Jul 2022 03:56:10 -0400 Received: by mail-pj1-x102c.google.com with SMTP id h21-20020a17090aa89500b001f31a61b91dso7534766pjq.4 for <bug-gnu-emacs@HIDDEN>; Sat, 30 Jul 2022 00:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=rHfBm4Q78IaSS+zFBC7kCLSKbA6+EzZ+lc4xdZZzgAw=; b=MBl6bVqqKdSVJJk/ehv+tIMZzbibAYKN6hiHjAPVUuqzj56ULuV/rpWVXxVCq1Rpks rv7sG20N+ktJ2NcZXdOphZ1/5VXWDhXSWsiXzKWpoAoVTPVBxxBkbKNeAqfjERfMGcI2 NbKWkzCfeZT4CtYZ5MxmA6XoV8eRxIVINPCx0sZyh/LH7GMq0L2M7sg55w5daNV8Jx0X v19zeyhEGP2wrlqJExvb+S7CtJ3cyfaK/BNAFXAJGOY6ig9yspcqaF+SRz+7wCu9tETr RMHDF6gI2M+XfFbLrY0A/mv1hsmK+dSuiR8emgmNfUTd8IJNdUmsQ7GnMdhXelx5/kCL fPNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=rHfBm4Q78IaSS+zFBC7kCLSKbA6+EzZ+lc4xdZZzgAw=; b=vmVQCc3tFUdKM+VW/xKu2OcZaYlCQuH2uz+MfL/0pRUNV9zwMNpCwJwQUd0ealCr9b 07SA2bvL6iuIemE8Y6ccZmzUVEVXj4Fb6Kp6WK+xW8lEFlmjIa/LE7lYu+pET+cK6Yik z3GiJvzS1+kxny56R+nKktWUO0HoWri4nmmyb4iH234gwDGxELzbjv876rEX6PuIw+yG k5twZbpkMWv0VxofRje+atlsRtHtCxwSBDlfu6DLfrUVE/nidS5iDo9YTw8d10jy62DU OUzszjaqA2nUPVQcbkF1eVKar2WM3n+orxCi2CeBIAH2gikHXgDvQ+jA0TdoPBMubPJm q3Zg== X-Gm-Message-State: ACgBeo0QSOVLAx7Zh3YiaK2qpcdM8zaY6QjaJYthkh0U3Mfx8hqrFd2I A/Cnt5FKKFARB/mJoUD4SzEmXY8ecaTVvA== X-Google-Smtp-Source: AA6agR76ZQPhf76SezS8Ez+6mr7i4xOB5u+x5E4wRfaUTH3SBxSjQtCfgUcf3p6QLuJtVenoQJ/DAQ== X-Received: by 2002:a17:90a:94c2:b0:1f3:2590:8693 with SMTP id j2-20020a17090a94c200b001f325908693mr8722141pjw.153.1659167750890; Sat, 30 Jul 2022 00:55:50 -0700 (PDT) Received: from localhost ([1.83.155.1]) by smtp.gmail.com with ESMTPSA id t128-20020a625f86000000b0052ad49292f0sm4168524pfb.48.2022.07.30.00.55.48 for <bug-gnu-emacs@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 00:55:50 -0700 (PDT) From: Ihor Radchenko <yantar92@HIDDEN> Date: Sat, 30 Jul 2022 15:56:39 +0800 Message-ID: <875yjfrq2w.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=yantar92@HIDDEN; helo=mail-pj1-x102c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.1 (--) Hi, Try to do the following: 1. emacs -Q 2. M-x outline-mode 3. Insert * something a * else 4. Move point to "* <point>something" 5. <TAB> 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 First reported in https://orgmode.org/list/87k0h49s7z.fsf@localhost Best, Ihor
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Ihor Radchenko <yantar92@HIDDEN> Subject: bug#56837: Acknowledgement (28.1.90; `current-indentation' sometimes returns zero inside invisible text) Message-ID: <handler.56837.B.165916777917913.ack <at> debbugs.gnu.org> References: <875yjfrq2w.fsf@localhost> X-Gnu-PR-Message: ack 56837 X-Gnu-PR-Package: emacs Reply-To: 56837 <at> debbugs.gnu.org Date: Sat, 30 Jul 2022 07:57:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 56837 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 56837: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D56837 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
Received: (at control) by debbugs.gnu.org; 30 Jul 2022 08:07:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 30 04:07:13 2022 Received: from localhost ([127.0.0.1]:33963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHhVB-0004yI-52 for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 04:07:13 -0400 Received: from mail-vs1-f41.google.com ([209.85.217.41]:45626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1oHhV9-0004y4-AQ for control <at> debbugs.gnu.org; Sat, 30 Jul 2022 04:07:12 -0400 Received: by mail-vs1-f41.google.com with SMTP id o4so6617175vsc.12 for <control <at> debbugs.gnu.org>; Sat, 30 Jul 2022 01:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BdIKk+ZyD/fOGeim/TSYdpX3edJpgPl2Bb6nB45EiJE=; b=Wk+tVmE3nG45RFYlURrLFJk9304PjW01QiHNRTxPHfYADq17md2LBJ8ajyLWPDCGgX rufJXreTNqn6vzAm9qOVl8gpL2W5EokVRcAKsWn1gfh8f2jMgqpXh+y/dk0g0bu6DCG9 8Ogolxg0RN3EBoklPs6f6h9NsTH+zee86k/SI25bD2OKagtP8/skLcG2xT+Iiy4Gn1G5 hoMKnsPi+aY7O9LNAj3dJmhJZ53y3eeTdi/Mr3GcB+SdIEEuvqb0lzCSJ7gkdTQCA9b+ 3sszV/7IjYi141CD5QrBi1HdqkdvYWcI9Iu6iNTb2tyLpiInqe6tPJPx6rCL5ytNOACP zAjw== X-Gm-Message-State: AJIora9J3c4XHMWMrViPdbr1qUHBFPk+IYmGhFHFpWfDs33oOtOmoWmO Bmx3DOiKBnA+NOb65SdptvR+xCrN11js9BwAbNmDtzIjnv8= X-Google-Smtp-Source: AGRyM1utjg1/M2Z5YBpBheDHfkxyYqsnfd62svYvOIOkj55EklFueri2gauWq6tttjd2V12dh4Zu+rppwsUt+jCN3Lk= X-Received: by 2002:a67:e283:0:b0:35a:1d62:bc12 with SMTP id g3-20020a67e283000000b0035a1d62bc12mr2793666vsf.3.1659168425674; Sat, 30 Jul 2022 01:07:05 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas <stefan@HIDDEN> Date: Sat, 30 Jul 2022 10:06:54 +0200 Message-ID: <CADwFkmnQuQCh-0o6WV=632ayOn7__YFmqCaH5Js4HWbnCz4RCA@HIDDEN> Subject: To: control <control <at> debbugs.gnu.org> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forcemerge 56837 56838 thanks Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.217.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.41 listed in wl.mailspike.net] 2.0 BLANK_SUBJECT Subject is present but empty 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forcemerge 56837 56838 thanks Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.217.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.41 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager forcemerge 56837 56838 thanks
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 08:53:01 +0000 Resent-Message-ID: <handler.56837.B56837.165917112232424 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ihor Radchenko <yantar92@HIDDEN> Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.165917112232424 (code B ref 56837); Sat, 30 Jul 2022 08:53:01 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 08:52:02 +0000 Received: from localhost ([127.0.0.1]:34013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHiCX-0008Qg-L2 for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 04:52:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHiCS-0008QI-7K for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 04:52:00 -0400 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 <eliz@HIDDEN>) 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==; 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 <eliz@HIDDEN>) id 1oHiCM-0006xs-AK; Sat, 30 Jul 2022 04:51:50 -0400 Date: Sat, 30 Jul 2022 11:51:45 +0300 Message-Id: <83r12356fy.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <875yjfrq2w.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 15:56:39 +0800) References: <875yjfrq2w.fsf@localhost> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ihor Radchenko <yantar92@HIDDEN> > 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 "* <point>something" > 5. <TAB> 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.
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Ihor Radchenko <yantar92@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 09:08:02 +0000 Resent-Message-ID: <handler.56837.B56837.16591720411681 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.16591720411681 (code B ref 56837); Sat, 30 Jul 2022 09:08:02 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 09:07:21 +0000 Received: from localhost ([127.0.0.1]:34028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHiRN-0000R2-DM for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 05:07:21 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:55940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>) id 1oHiRJ-0000Qk-FG for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 05:07:20 -0400 Received: by mail-pj1-f51.google.com with SMTP id b10so6505001pjq.5 for <56837 <at> debbugs.gnu.org>; Sat, 30 Jul 2022 02:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=YCRDEZM0TdTFlBeTPhseiHWNkPYU7cXuYRPtmj5Y8/0=; b=LZbNF2omA6fekXL0TTSKvjXkw77reT46fO/dOQ3DWIhMF5cxugUuC/4dumzG6WK0Pg izYJDz17ZHRWV/qCGRAaHhA6/brA4WdvECZTsrn2BGCT4DnNMt8jWXWC9Ec+9W8OK5OA yXwsoBDpDRbweHzbaKAVVaZKj+k8pVMJiv0ESZ/jRCwgTD1Vxwab5zWz4BC1Y5gNeuAv FVrJqgvRDX/yJnSlAgYJlmGIJOZ3Ox3tgyDcIYD1fdgB59L+d2s+f1+N35ddFeua/WKL 9L9TiCFuPNMXIpeTrecp2HPiTCfdV2RzVQ3rpsAWaql4MD3KsXIhyHesLGG8RsVji2u4 08kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=YCRDEZM0TdTFlBeTPhseiHWNkPYU7cXuYRPtmj5Y8/0=; b=NL5lqwruNUvtXeQKsbxvcc4PH3bDQrAMUJBQ4Xu4g4pUwaZvgGb6vuPXwHk4yZB4r9 mA4Bs67foblEadbWe9ekmAQHtzMkT2prMnBcBoiNEQys16Dy0hRVXQpQNLCBQnu61jhu 0TTX7SiqPsRiu9iw2Q4XuaRtIuzp2j8oXNL44Wyb1lr++qUl34NdYCXFEEFN8hAldUmS f9rCpZTKLthJUDsMLruZv1M2+rKavJJ/9KXuulXUtY1Tqhg69tuR2LheK+o1mLuKWvZr GP0iKLbXzhKry3IsBZxGlPUYSeHjWswRfRnBQsYuWIYQ2uimxJi+u0ujcEUx9wnDVe6g T60g== X-Gm-Message-State: ACgBeo0RrZ1JHG3CeczcmGQTby64Ar6SbP/yrimh44ANGMLR817xTQwy XF64AZiQytXULAUgo7BfAWO8fCDpMGqr1A== X-Google-Smtp-Source: AA6agR6qiSRXnKCiUU+ke4XPui9Kh5VwpEWXBmfaOpkSQcBp9nf/5RbMXmsVNf1Ggn3iBkNtBlgGVA== X-Received: by 2002:a17:90b:390e:b0:1f2:b7b6:9f9 with SMTP id ob14-20020a17090b390e00b001f2b7b609f9mr8727966pjb.64.1659172031468; Sat, 30 Jul 2022 02:07:11 -0700 (PDT) Received: from localhost ([1.83.155.1]) by smtp.gmail.com with ESMTPSA id q17-20020aa78431000000b0052d2b55be32sm297153pfn.171.2022.07.30.02.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 02:07:10 -0700 (PDT) From: Ihor Radchenko <yantar92@HIDDEN> In-Reply-To: <83r12356fy.fsf@HIDDEN> References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> Date: Sat, 30 Jul 2022 17:08:12 +0800 Message-ID: <87v8rfq877.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Eli Zaretskii <eliz@HIDDEN> writes: > 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? This is needed for parsing. In Org, indentation defines the list level. Similarly, indentation is meaningful in Python. Since parsed text can be hidden inside fold (using org-mode, or outline-mode; the latter may also be used in Python buffers), getting an accurate indentation is important even when text is invisible. > 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. I do not understand how ellipsis can be meaningfully accounted for with regard to indentation. AFAIU, they are not. Try * something a * else 4. Move point to "* <point>something" 5. <TAB> to fold the outline 6. M-: (save-excursion (search-forward " a") (current-indentation)) ;; => 10 > 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. As I mentioned above, this is required for parsing. Best, Ihor
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 10:09:01 +0000 Resent-Message-ID: <handler.56837.B56837.16591757148248 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ihor Radchenko <yantar92@HIDDEN> Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.16591757148248 (code B ref 56837); Sat, 30 Jul 2022 10:09:01 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 10:08:34 +0000 Received: from localhost ([127.0.0.1]:34067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHjOb-00028y-QX for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 06:08:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHjOY-00028g-LM for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 06:08:33 -0400 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 <eliz@HIDDEN>) 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==; 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 <eliz@HIDDEN>) id 1oHjOS-0000fT-NT; Sat, 30 Jul 2022 06:08:25 -0400 Date: Sat, 30 Jul 2022 13:08:18 +0300 Message-Id: <83o7x66hgt.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <87v8rfq877.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 17:08:12 +0800) References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ihor Radchenko <yantar92@HIDDEN> > Cc: 56837 <at> 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)
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Ihor Radchenko <yantar92@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 11:27:02 +0000 Resent-Message-ID: <handler.56837.B56837.165918037725419 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.165918037725419 (code B ref 56837); Sat, 30 Jul 2022 11:27:02 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 11:26:17 +0000 Received: from localhost ([127.0.0.1]:34153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHkbp-0006bu-BB for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:26:17 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:35566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>) id 1oHkbm-0006bg-SH for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:26:16 -0400 Received: by mail-pl1-f179.google.com with SMTP id t2so6661420ply.2 for <56837 <at> debbugs.gnu.org>; Sat, 30 Jul 2022 04:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=sX79YgWaDV9a0nA+xTL6Y6t+CgG5hoeqVtvNuJ01zXo=; b=kqBwgDS7E6J8d9l/77wBtBfGEydJc4G6pOIafEY5Fv9u1Q0x+sGU55K8Gq4IvRTNXo 1Su3jKpHBXy3r62ubHUUUjrSOGWAfpukYJ96AxaGYuQvNk08GZzh4iRD74CmlMreyR/Y oPRzizAzy+rr1nMl46J8hl+RPmbqGg2alzCW18PNyQ0ttRriQv15wbeAejxvtmX95BF5 DPrLPxJbcaSTXXcqugVXa3AFaqSb3VQLHybFwcuEnV85TVmMMS0VU/qpfom0i8o7D1Cj eHGDPE2xqpUneOrKIs0ECi7KGnpNdelZgpvZ3cltczL56pwHsic7NhCkO/4oyR+PXZxF flfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=sX79YgWaDV9a0nA+xTL6Y6t+CgG5hoeqVtvNuJ01zXo=; b=Qge7cjReAr3sk4SSb+hgp10XdVP9LsPfGoyjF8LoDRNMmtQczHtDfxFAIom4bV4Ddp rnbmMnrMI/UVsvQbtteOJlOlxrMaWOI61i0WXREyl+EcS28r4U7V/fEhgapTtlsjzx2t K/kTrA9e76l79AIe3g2Z9IHZwzUS7nbzWclzin3O2rcfFVpOzd4gwVzdYnLfVXNHyago Tl/ATrt7Nz4yCmfmC1M5aEO8Lq11hemcm4cU/M8mOfz+gg4YDFgPRxBi7ctSPmyxjsel FRfOoVJgxnwQuV4A7R3Ik/sjdBwYsWImmtPzmpyrbZnitvr7uJO9kAa2XCz2GOzimUDE OC9A== X-Gm-Message-State: ACgBeo3k4xBXyI5c7VOqRDZcMaqM6WtL4D03qhTUByMaHo2cImLZ1FyW I2jFeLtEkEMGhSKWkYDn/imbr4b2MmjVmbkb X-Google-Smtp-Source: AA6agR4jGUzCkKCaGJAqi2iezfCmWru3MF1FGDtZqOx8qiklR0WyxXrDIXMAXhbiTVQWa6AJHtyyhA== X-Received: by 2002:a17:903:2347:b0:16d:c671:5d53 with SMTP id c7-20020a170903234700b0016dc6715d53mr7858237plh.47.1659180369016; Sat, 30 Jul 2022 04:26:09 -0700 (PDT) Received: from localhost ([2409:8a70:217:4f80:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id b13-20020a65578d000000b00419fc2c27d8sm4092588pgr.43.2022.07.30.04.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 04:26:07 -0700 (PDT) From: Ihor Radchenko <yantar92@HIDDEN> In-Reply-To: <83o7x66hgt.fsf@HIDDEN> References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> Date: Sat, 30 Jul 2022 19:27:09 +0800 Message-ID: <87lesargc2.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Eli Zaretskii <eliz@HIDDEN> writes: > 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) A simpler version would be let-binding buffer-invisibility-spec. Note that there is similar issue with current-column, though current-column is much less likely to be used without considering display properties. Would it be possible to include the "text" versions of current-indentation and current-column into Emacs? Something like (defmacro org-current-text-indentation () "Like `current-indentation', but ignore display/invisible properties." `(let ((buffer-invisibility-spec nil)) (current-indentation))) (defmacro org-current-text-column () "Like `current-column', but ignore display/invisible properties." `(string-width (buffer-substring-no-properties (line-beginning-position) (point)))) If not, could you at least mention the invisible text issues in `current-indentation' docstring? The current undefined behaviour is very hard to debug. Best, Ihor
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 11:40:01 +0000 Resent-Message-ID: <handler.56837.B56837.16591811432561 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ihor Radchenko <yantar92@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN> Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.16591811432561 (code B ref 56837); Sat, 30 Jul 2022 11:40:01 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 11:39:03 +0000 Received: from localhost ([127.0.0.1]:34184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHkoA-0000f3-GX for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:39:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHko8-0000eY-Hx for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:39:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHko3-0002n5-34; Sat, 30 Jul 2022 07:38:55 -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=tYzqutWuBkZVkrRusAgWUoQDgbwwjot23s70hPK3sMg=; b=CX26jMyI2yFp EgnHzhLvfErvYPLP6X3CxlM+jEvCbuROg6sbCTzizkntQMQz16NjkbGEYhuQcSE0TS3EYiRqpsqVU 8Lwx8PT5yGByIiicbD2l2sX+mZ9WaKnKfQOfL0ducBugvreMDSGX3cD4zUEFrSXesqS628PfMaivL YvjU+lLaoNurY1/lck4Y+9gWzN6r6jb6O4P7WUvjvDMDB3fW86PT7Ns9bvwf18goCAqEsVWU99qjw 1Fd1PUDuXQ2xcch+87+YLENQ9RFNsJ4+PcTAciMYkygSRJTdXlZMplF0U1rpXK1AgT3w2X0sb1g3O W+mROf9WtOCa/LmJVy8KYg==; Received: from [87.69.77.57] (port=2394 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHko1-0003JO-RO; Sat, 30 Jul 2022 07:38:54 -0400 Date: Sat, 30 Jul 2022 14:38:47 +0300 Message-Id: <83ilne6da0.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <87lesargc2.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 19:27:09 +0800) References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> <87lesargc2.fsf@localhost> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ihor Radchenko <yantar92@HIDDEN> > Cc: 56837 <at> debbugs.gnu.org > Date: Sat, 30 Jul 2022 19:27:09 +0800 > > A simpler version would be let-binding buffer-invisibility-spec. Really? > Note that there is similar issue with current-column, though > current-column is much less likely to be used without considering > display properties. These are all display-related, in that their results are supposed to closely reflect what will be shown on display. > Would it be possible to include the "text" versions of > current-indentation and current-column into Emacs? > > Something like > > (defmacro org-current-text-indentation () > "Like `current-indentation', but ignore display/invisible properties." > `(let ((buffer-invisibility-spec nil)) > (current-indentation))) > > (defmacro org-current-text-column () > "Like `current-column', but ignore display/invisible properties." > `(string-width (buffer-substring-no-properties > (line-beginning-position) (point)))) Sounds strange to have this, but if Lars thinks it's useful, I won't object. > If not, could you at least mention the invisible text issues in > `current-indentation' docstring? OK.
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Ihor Radchenko <yantar92@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 11:49:02 +0000 Resent-Message-ID: <handler.56837.B56837.16591817373767 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.16591817373767 (code B ref 56837); Sat, 30 Jul 2022 11:49:02 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 11:48:57 +0000 Received: from localhost ([127.0.0.1]:34207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHkxk-0000yh-V3 for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:48:57 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:43725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>) id 1oHkxh-0000yM-HP for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 07:48:54 -0400 Received: by mail-pl1-f172.google.com with SMTP id y15so6660295plp.10 for <56837 <at> debbugs.gnu.org>; Sat, 30 Jul 2022 04:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=11H1KIar8t3vf/T+rRYuMb3+fg1AnyBc6SF9S4I0LWY=; b=MDupwDJmRKmedNFKGAIzGvPowKkrbJtrb+0c6CWyd/kGMUNEicmDd6wuphH7gRzIJY +cHGiijXWvaAhJsPZawkZ8+Yf3UBwHK2VQOR8dkczA+hcSzZVAgSfYK3EKUggw8t6RRg SGBN5hgECrm9m0yeXcJDwDar1bN7ZlQ2RlLuVdyJdd7i5+w+xRPKsuE7Q/21PyTI3u3c 8mrHEU+fY2av6lDPOR71quTU4bE4ABhsKt9a+ubU/sBndsoBtBKdzaWLVlyNzJSlXiZI bsSjiZVjeFF+TXDfmc0G/9BeuGOBEc4ThlYq0Un3gXNKmBOvuYKeWep1Ztn+2lLNSGqA Xqkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=11H1KIar8t3vf/T+rRYuMb3+fg1AnyBc6SF9S4I0LWY=; b=NiFO8hzkey652bShhE50GBSJ0l5tueZ5SsRdIHkZuBw/fKxONa69RfUVZ8eNou4zth yb+lqL4zlzZ1IyOhwDaXHRq9gH5Jqa1cfUQdPNPUxL47rAgDqWFfq2l+uAie5RT0h5Z7 a0QvavHdc6gxnYG2Y9Hru/qSqM52TLZ/wdFXIv53qgsPIuVxSDe7K5cuJq9K0T7s179u 7TsvAjvCnOa0JAZKBwwGsUNdPh8L/waQLA8ZYyhaiu5rT9bVRlGlx1l9N2e3tPwrGHJC yqqdWU5gESrFG2Umg3SXXZXdKlcIRHYIKFQg7MyxSnOac3PBDN3Z1wOMqLGfuvjrMPsh fplQ== X-Gm-Message-State: ACgBeo1yED+1l1TRhzYjVKVdRUuz4i3P3fMn+e51+MHHRY4gN7Zvv0Mo T48F/K6iJrSeDBSQ3Qxphf4= X-Google-Smtp-Source: AA6agR5JY+mTekIaA7PMCEkwonaUehDdlqnKNxcpPHJ/V2SLOIdGE7zMddXkOYfpbJkv65yohgEd0w== X-Received: by 2002:a17:90b:1c82:b0:1ee:eb41:b141 with SMTP id oo2-20020a17090b1c8200b001eeeb41b141mr9026482pjb.143.1659181727312; Sat, 30 Jul 2022 04:48:47 -0700 (PDT) Received: from localhost ([2409:8a70:217:4f80:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b0016c50179b1esm5593563plh.152.2022.07.30.04.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 04:48:46 -0700 (PDT) From: Ihor Radchenko <yantar92@HIDDEN> In-Reply-To: <83ilne6da0.fsf@HIDDEN> References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> <87lesargc2.fsf@localhost> <83ilne6da0.fsf@HIDDEN> Date: Sat, 30 Jul 2022 19:49:50 +0800 Message-ID: <87ilnerfa9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.8 (/) Eli Zaretskii <eliz@HIDDEN> writes: >> A simpler version would be let-binding buffer-invisibility-spec. > > Really? Could you please elaborate? Do I miss something? I tested let-binding, and it does work if you try to let-bind buffer-invisibility spec around the calls to `current-indentation' in my reproducer. AFAIK, remove-from-invisibility-spec simply does (setq buffer-invisibility-spec ...) let-binding is less cumbersome and not limited to outline spec which is not even used by Org. Org uses multiple specs + other font-lock staff may set more arbitrary specs in third-party packages. >> Note that there is similar issue with current-column, though >> current-column is much less likely to be used without considering >> display properties. > > These are all display-related, in that their results are supposed to > closely reflect what will be shown on display. I understand. current-column even express it clearly in the docstring (unlike, current-indentation). However, as I tried to explain, display-independent versions can be useful during parsing. And not only in Org mode. If you think otherwise, we will simply implement the required versions in Org. >> If not, could you at least mention the invisible text issues in >> `current-indentation' docstring? > > OK. Thanks! Best, Ihor
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 13:27:01 +0000 Resent-Message-ID: <handler.56837.B56837.16591875646091 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ihor Radchenko <yantar92@HIDDEN> Cc: larsi@HIDDEN, 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.16591875646091 (code B ref 56837); Sat, 30 Jul 2022 13:27:01 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 13:26:04 +0000 Received: from localhost ([127.0.0.1]:34353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHmTj-0001aA-WF for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 09:26:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHmTi-0001Zf-5d for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 09:26:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHmTc-0003Yl-Pg; Sat, 30 Jul 2022 09:25:56 -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=bZElVLo3pczHdLkzhMqMtUIu6hDONWLks5Zx/izRYpw=; b=j+Kb9YiWPWM9 K0CHC/5r6JYvbXfIEp3SO87OyBpzG0V8kS70p31MIpsqS6Vatmq6Qgpfmm/j1fawPtO7a6RCFKe+3 dnwKi0cSCIX6s3zgzx7r4FaZOQbjp7U4w6tjee6jfKHk/bcOVeioKzm68Lt9rRpXrYtefryhaqicU pau60w8uO6w0OkHzHP2/4Nd/ykjINZtROLxNFvch3CsRphC1zW8mBoV7g8wqeG4V5wjTzWcOp33aI b1sttzXqJTzXnNAXkeReFm+Cyi5ibQY20qjG/jQ5liuFSZmpY3r6IGjg9rZHoUYOsnU1XP1LPksxH ngS2EL+4qShz+62I/JqIqQ==; Received: from [87.69.77.57] (port=1182 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHmTb-0002SP-Ne; Sat, 30 Jul 2022 09:25:56 -0400 Date: Sat, 30 Jul 2022 16:25:47 +0300 Message-Id: <83edy268bo.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <87ilnerfa9.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 19:49:50 +0800) References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> <87lesargc2.fsf@localhost> <83ilne6da0.fsf@HIDDEN> <87ilnerfa9.fsf@localhost> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ihor Radchenko <yantar92@HIDDEN> > Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 56837 <at> debbugs.gnu.org > Date: Sat, 30 Jul 2022 19:49:50 +0800 > > Eli Zaretskii <eliz@HIDDEN> writes: > > >> A simpler version would be let-binding buffer-invisibility-spec. > > > > Really? > > Could you please elaborate? Do I miss something? Just that I know very well what let-binding does. The snippet I sent was copy/pasted from the experiments I performed, it wasn't supposed to be the peak of elegance. > > These are all display-related, in that their results are supposed to > > closely reflect what will be shown on display. > > I understand. current-column even express it clearly in the docstring > (unlike, current-indentation). However, as I tried to explain, > display-independent versions can be useful during parsing. And not only > in Org mode. > > If you think otherwise, we will simply implement the required versions > in Org. Let's see what Lars thinks about this.
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 16:37:02 +0000 Resent-Message-ID: <handler.56837.B56837.165919896211507 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: yantar92@HIDDEN, larsi@HIDDEN Cc: 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.165919896211507 (code B ref 56837); Sat, 30 Jul 2022 16:37:02 +0000 Received: (at 56837) by debbugs.gnu.org; 30 Jul 2022 16:36:02 +0000 Received: from localhost ([127.0.0.1]:35676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHpRa-0002zK-2U for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 12:36:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHpRX-0002z0-OW for 56837 <at> debbugs.gnu.org; Sat, 30 Jul 2022 12:36:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHpRS-00055f-EC; Sat, 30 Jul 2022 12:35:54 -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=tcPwV0XAekJWP6EYyRj9if2qIXOgaTtB/9GMYp6kYx4=; b=mZaZ0ucw5PGO wx63utxXu5QAWsAqYBYtZ89/VXfcXtASG4ORpCyEe5NcXmXY47iKR0cpk+NVYG4D3TvWzJPg9yKNX hXxNq1Xhu7yySThSMphBET8qknufdcZZzQRYlDkf6PTogUlZmrTuI+DLPxcQx1phHFOCQnTT1xENy Qk/SsReeSAVOQ7/5fn2i6NEiWb2MtS/AlYw9NP3atQ7yOUX8wNKcyUnvdiQ1cXVIecl6nLODep8De GeWyQfxxxUWisSBmoM+URpXD14fn/3p36YHIfTp/p3H5IiBd6AevvqSkYMKdcgOMuIiTovbrurVej /fMu0W672I7Ib175l6/SVA==; Received: from [87.69.77.57] (port=4932 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHpRR-00061j-Tr; Sat, 30 Jul 2022 12:35:54 -0400 Date: Sat, 30 Jul 2022 19:35:40 +0300 Message-Id: <8335ei5zj7.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <83ilne6da0.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 30 Jul 2022 14:38:47 +0300) References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> <87lesargc2.fsf@localhost> <83ilne6da0.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: 56837 <at> debbugs.gnu.org > Date: Sat, 30 Jul 2022 14:38:47 +0300 > From: Eli Zaretskii <eliz@HIDDEN> > > > If not, could you at least mention the invisible text issues in > > `current-indentation' docstring? > > OK. Now done.
X-Loop: help-debbugs@HIDDEN Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Resent-From: Lars Ingebrigtsen <larsi@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 31 Jul 2022 08:14:01 +0000 Resent-Message-ID: <handler.56837.B56837.165925519222658 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: Ihor Radchenko <yantar92@HIDDEN>, 56837 <at> debbugs.gnu.org Received: via spool by 56837-submit <at> debbugs.gnu.org id=B56837.165925519222658 (code B ref 56837); Sun, 31 Jul 2022 08:14:01 +0000 Received: (at 56837) by debbugs.gnu.org; 31 Jul 2022 08:13:12 +0000 Received: from localhost ([127.0.0.1]:36340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oI44V-0005tO-Ra for submit <at> debbugs.gnu.org; Sun, 31 Jul 2022 04:13:12 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1oI44Q-0005sp-6P for 56837 <at> debbugs.gnu.org; Sun, 31 Jul 2022 04:13:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wK4xeEv9QAIh8vw0+2oF9J3z+mYjTpuDlXBWQIOtlcM=; b=q0cev7HnPkfqZq9TClQzmKxeOU /dt8nClTKi/Wu6oPLdIE0+oHJo2+XKivcs9tSMohFNwpBoL/OlRUt7kzdbdy7CpzR/SVjNLwJCYQ8 m8snmOXq+JYpa+4cEsZ59PfV49OFaeQRj0Y4V/bYlDkH7xz4jb8PXmsHEUsi7Ot65WEE=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1oI44G-00019A-9P; Sun, 31 Jul 2022 10:12:59 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> In-Reply-To: <83ilne6da0.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 30 Jul 2022 14:38:47 +0300") References: <875yjfrq2w.fsf@localhost> <83r12356fy.fsf@HIDDEN> <87v8rfq877.fsf@localhost> <83o7x66hgt.fsf@HIDDEN> <87lesargc2.fsf@localhost> <83ilne6da0.fsf@HIDDEN> X-Now-Playing: Simple Minds's _Sons and Fascination_: "In Trance as Mission" Date: Sun, 31 Jul 2022 10:12:55 +0200 Message-ID: <87mtcp4s54.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii <eliz@HIDDEN> writes: >> (defmacro org-current-text-indentation () >> "Like `current-indentation', but ignore display/invisible properties." >> `(let ((buffer-invisibility-spec nil)) >> (current-indentation))) >> >> (defma [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Eli Zaretskii <eliz@HIDDEN> writes: >> (defmacro org-current-text-indentation () >> "Like `current-indentation', but ignore display/invisible properties." >> `(let ((buffer-invisibility-spec nil)) >> (current-indentation))) >> >> (defmacro org-current-text-column () >> "Like `current-column', but ignore display/invisible properties." >> `(string-width (buffer-substring-no-properties >> (line-beginning-position) (point)))) > > Sounds strange to have this, but if Lars thinks it's useful, I won't > object. It seems quite special-purpose -- I'm not sure there's much general utility for functions like this.
Received: (at control) by debbugs.gnu.org; 10 Jan 2023 08:25:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 10 03:25:47 2023 Received: from localhost ([127.0.0.1]:38709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pF9x4-0004ds-UI for submit <at> debbugs.gnu.org; Tue, 10 Jan 2023 03:25:47 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1pF9x3-0004dO-0U; Tue, 10 Jan 2023 03:25:45 -0500 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id AFC96C0007; Tue, 10 Jan 2023 08:25:36 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#60692: 29.0.60; current-indentation wrong without outline ellipsis In-Reply-To: <83tu0zo76j.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 09 Jan 2023 21:10:28 +0200") Organization: LINKOV.NET References: <86k01v1y9c.fsf@HIDDEN> <83wn5vo8tx.fsf@HIDDEN> <83tu0zo76j.fsf@HIDDEN> Date: Tue, 10 Jan 2023 10:20:20 +0200 Message-ID: <86k01ulrwl.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control Cc: 60692 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) forcemerge 56837 60692 thanks > About current-indentation: it skips invisible text, so it's unclear to > me why you expected to see 2. The doc string says: > > Text that has an invisible property is considered as having width 0, unless > `buffer-invisibility-spec' specifies that it is replaced by an ellipsis. > > The "current indentation" on the line of buffer position 8 is entirely > in invisible text, and current-indentation only accounts for _visible_ > whitespace, per the above documentation. Thanks for the reference, it explains the problem. But this is a very strange logic. I don't get it. Why it depends on the presence of the ellipsis and fails without it? Now I see this bug report is a duplicate of bug#56837. This is a problem because modes use 'current-indentation' to get an outline level in 'outline-level' function, e.g. (setq-local outline-level (lambda () "`outline-level' function for Python mode." (1+ (/ (current-indentation) python-indent-offset)))) (setq-local outline-level (lambda () (1+ (/ (current-indentation) ruby-indent-level)))) But this fails when users want to remove an ellipsis.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.