From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Rankin Newsgroups: gmane.emacs.bugs Subject: bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline inviisble Date: Tue, 26 Jul 2016 18:12:33 +1000 Message-ID: <1469520753.418402.676896009.00AAC0DE@webmail.messagingengine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1469521756 1935 80.91.229.3 (26 Jul 2016 08:29:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2016 08:29:16 +0000 (UTC) To: 24073@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 26 10:29:03 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bRxjZ-0004om-Ha for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jul 2016 10:29:01 +0200 Original-Received: from localhost ([::1]:38230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxjY-0003A3-Lk for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jul 2016 04:29:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxUC-0005cu-Ot for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:13:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRxU8-000281-Gc for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:13:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxU6-00027n-KO for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:13:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bRxU6-0004V0-Ia for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jul 2016 08:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146952078217289 (code B ref -1); Tue, 26 Jul 2016 08:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Jul 2016 08:13:02 +0000 Original-Received: from localhost ([127.0.0.1]:37584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRxU5-0004Uk-LK for submit@debbugs.gnu.org; Tue, 26 Jul 2016 04:13:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRxU4-0004UX-A8 for submit@debbugs.gnu.org; Tue, 26 Jul 2016 04:13:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRxTy-00027H-0n for submit@debbugs.gnu.org; Tue, 26 Jul 2016 04:12:54 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxTv-000279-O9 for submit@debbugs.gnu.org; Tue, 26 Jul 2016 04:12:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxTt-0005IB-HU for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:12:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRxTq-000267-AB for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:12:49 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRxTn-00024Q-VA for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 04:12:46 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id AD289205E3 for ; Tue, 26 Jul 2016 04:12:33 -0400 (EDT) Original-Received: from web6 ([10.202.2.216]) by compute7.internal (MEProxy); Tue, 26 Jul 2016 04:12:33 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=MhB xDz7DlWxZwbfGGQb6Hq571yo=; b=eOd30WmmJ1178iDOPtOjZdsDRsNBi/JmWET AZ7sS8fiZymgKTz+DaJu6CR8RDTk860W8W5J596zxd6kT2XcE7wXrDWpxWlTuHIB rxln3wutbdgZwXE9Txrhgn2jecVTGBGEdFfsCnxUnLmvyIS2BpqjjWmnM7pjFAY7 TyttuJkM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=MhBxDz7DlWxZwbfGGQb6Hq571yo=; b=n1C9/ aUIupk7/3cdDIUmmfB454moIuEdXHvW7FpnKKVzI/SEYlFJmVvQkoLAx3HigEhOA KsTtch3NKHSy7LQiAWmaL35n+96SLts0pMvdV1rxWC8M75sj6Q0ybzolma+mZkGB Gngx7hWrqu4QWks/XlHY27Dk75IDtg9wTvVwLg= Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 7BCF81E380; Tue, 26 Jul 2016 04:12:33 -0400 (EDT) X-Sasl-Enc: eXBUd0LWElb1qrTSenlCdwgM+3ndfd6i7XRPU49ljdT0 1469520753 X-Mailer: MessagingEngine.com Webmail Interface - ajax-3c2832c2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121549 Archived-At: When attempting to use `outline' to collapse a heading that begins with a character with any invisible text property, the heading is mistakenly treated as invisible, when only a heading with the `outline' invisible text property should be considered invisible (i.e. collapsed). To reproduce: 1. emacs -Q 2. insert ";;; heading" 3. M-: (outline-on-heading-p) => t 4. C-a 5. M-: (put-text-property (point) (1+ (point)) 'invisible 'foo) 6. M-; (outline-on-heading-p) => nil Expected results: (outline-on-heading-p) => t Actual results: (outline-on-heading-p) => nil Solution: The function outline-on-heading-p checks bolp for an invisible property, but not specifically the `outline' invisible property: (defun outline-on-heading-p (&optional invisible-ok) "Return t if point is on a (visible) heading line. If INVISIBLE-OK is non-nil, an invisible heading line is ok too." (save-excursion (beginning-of-line) (and (bolp) (or invisible-ok (not (outline-invisible-p))) (looking-at outline-regexp)))) Instead, it should check for only the `outline' invisible text property: (defun outline-on-heading-p (&optional invisible-ok) "Return t if point is on a (visible) heading line. If INVISIBLE-OK is non-nil, an invisible heading line is ok too." (save-excursion (beginning-of-line) (and (bolp) (or invisible-ok (not (eq (outline-invisible-p) 'outline))) (looking-at outline-regexp)))) -- Paul W. Rankin www.paulwrankin.com