GNU logs - #56838, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#56838: 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:02 +0000
Resent-Message-ID: <handler.56838.B.165916778817935 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 56838
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 56838 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.165916778817935
          (code B ref -1); Sat, 30 Jul 2022 07:57:02 +0000
Received: (at submit) by debbugs.gnu.org; 30 Jul 2022 07:56:28 +0000
Received: from localhost ([127.0.0.1]:33956 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHhKm-0004fD-2D
	for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 03:56:28 -0400
Received: from lists.gnu.org ([209.51.188.17]:43986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1oHhKk-0004f4-1c
 for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 03:56:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54166)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1oHhKj-0001od-Si
 for bug-gnu-emacs@HIDDEN; Sat, 30 Jul 2022 03:56:25 -0400
Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:53016)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1oHhKi-000508-9e
 for bug-gnu-emacs@HIDDEN; Sat, 30 Jul 2022 03:56:25 -0400
Received: by mail-pj1-x102d.google.com with SMTP id ha11so6616456pjb.2
 for <bug-gnu-emacs@HIDDEN>; Sat, 30 Jul 2022 00:56:23 -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=oV0o2G0wJeAWBmqaU9U0G7J33k7MjJiednQnqwM7egp/q515Nm+QPEhrpyupB8VhyN
 9UMH+PNZx1Z/hYjJxlFzz4HjfYXQTSH1zeRkysafUN/u9Yc8iegluU7lbmlzdcO82lS/
 luMwbQgA1iV8plV4JhdlKPoSbtL1sVJycSl09X/wCDFBezoZviapAVa1g7gSoHt8oNJh
 y50pY+CSj1oZklU8snh7q5/XYrVLoL+c+pKd/jpA0onj4Z26I+L1YCfACXgm6ar1rUuZ
 Xt0XL/7et4ptpUFCXM26ZTE8WxtoM5nQs8jFsbHK29pg8z4Xwmkvlpsp1rnuQdoRxIjk
 h91Q==
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=ikKU4haiXogofg3kcHBfqtRAQ59Oq1AXtl7+bhD8nWdu2D5hxN6Ac5y9qd+VMctC7Z
 N5t0aHVmSQnHEDC9WkJqODuOVZvZwVsDB4w5h0ZU3QlkQiaVFEN/717SflqYRCV56xzH
 ZUXtDHrj9QjZO98Y+G9PJfwfPl/xB9Pdrks356eNwf/VivpFQU2hUY8zs74HoZpOVuSs
 w2v4GZvj+gijqEttVM25viJw14jlc7ZJYeMO0xe+yvJIEMtLGfzqvPu/p4lhD4VuPg9I
 wg2pkgIgCYj0ZftU1AK6d+0RaVRe/W+notCK9RCpMBr1ZI2HrBz+KAflnFLAX96yI89g
 arkA==
X-Gm-Message-State: ACgBeo1kK7aL9gGK7xC+RgTLwPGYb5Hq3hhI4DBpCBzTdOP/dIzpsiLv
 CiT4mu6eN3t2PGRZYc03R3zVwzmrzIW/GQ==
X-Google-Smtp-Source: AA6agR77UZ99WbeZMSe4cy7neqClRQiVlKXE6ZXoi1QmzPe5/RUiDQ9zcN5Rz+Ua7g77DFvPcDCAxA==
X-Received: by 2002:a17:90b:1807:b0:1ef:8aa5:1158 with SMTP id
 lw7-20020a17090b180700b001ef8aa51158mr8757559pjb.163.1659167782684; 
 Sat, 30 Jul 2022 00:56:22 -0700 (PDT)
Received: from localhost ([1.83.155.1]) by smtp.gmail.com with ESMTPSA id
 n9-20020a056a00212900b0052844157f09sm4176853pfj.51.2022.07.30.00.56.21
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 30 Jul 2022 00:56:22 -0700 (PDT)
From: Ihor Radchenko <yantar92@HIDDEN>
Date: Sat, 30 Jul 2022 15:57:09 +0800
Message-ID: <874jyzrq22.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::102d;
 envelope-from=yantar92@HIDDEN; helo=mail-pj1-x102d.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





Message sent:


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#56838: Acknowledgement (28.1.90; `current-indentation'
 sometimes returns zero inside invisible text)
Message-ID: <handler.56838.B.165916778817935.ack <at> debbugs.gnu.org>
References: <874jyzrq22.fsf@localhost>
X-Gnu-PR-Message: ack 56838
X-Gnu-PR-Package: emacs
Reply-To: 56838 <at> debbugs.gnu.org
Date: Sat, 30 Jul 2022 07:57:02 +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 56838 <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
56838: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D56838
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message received at control <at> debbugs.gnu.org:


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




Message received at control <at> debbugs.gnu.org:


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.





Last modified: Tue, 10 Jan 2023 08:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.