unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline inviisble
@ 2016-07-26  8:12 Paul Rankin
  2016-07-26  9:29 ` Paul Rankin
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Paul Rankin @ 2016-07-26  8:12 UTC (permalink / raw)
  To: 24073

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





^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2017-04-01 12:05 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-26  8:12 bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline inviisble Paul Rankin
2016-07-26  9:29 ` Paul Rankin
2016-07-26 15:14   ` Eli Zaretskii
2016-07-27  5:43     ` Paul Rankin
2016-07-28  4:25 ` bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline invisible Paul Rankin
2016-07-29  2:07   ` Noam Postavsky
2016-08-01  9:37     ` Paul Rankin
2016-08-01 14:16       ` npostavs
2016-08-02  3:27         ` Paul Rankin
2016-08-02  3:47           ` Noam Postavsky
2016-08-02  4:22             ` Paul Rankin
2016-08-02 14:27               ` Noam Postavsky
2016-08-02  7:20             ` Paul Rankin
2016-08-02 14:31               ` Noam Postavsky
2016-08-03  3:18                 ` Paul Rankin
2016-08-31  1:12 ` bug#24073: 25.1-rc2 Paul Rankin
2016-08-31  2:41   ` Eli Zaretskii
2016-08-31  2:56     ` Paul Rankin
2016-08-31  8:59       ` John Wiegley
2016-08-31  9:12       ` Nicolas Petton
2016-08-31 14:25       ` Eli Zaretskii
2016-09-03  4:38         ` Paul Rankin
2016-09-18 14:39           ` Eli Zaretskii
2016-09-18 14:45             ` Nicolas Goaziou
2016-09-18 14:53               ` Eli Zaretskii
2016-09-19  9:40                 ` Paul Rankin
2016-09-19 16:48                   ` Eli Zaretskii
2016-09-20  5:37                     ` Bastien Guerry
2016-09-30  8:06                     ` Bastien Guerry
2017-03-30  8:18                       ` Paul Rankin
2017-03-31  0:16                         ` npostavs
2017-04-01  6:40                           ` Paul Rankin
2017-04-01  7:20                             ` Andreas Schwab
2017-04-01  8:06                               ` Paul Rankin
2017-04-01  8:20                                 ` Andreas Schwab
2017-04-01  9:11                                   ` Paul Rankin
2017-04-01  9:37                                     ` Andreas Schwab
2017-04-01 10:18                                       ` Paul Rankin
2017-04-01 11:44                                         ` Eli Zaretskii
2017-04-01 12:05                                           ` Paul Rankin
2017-04-01 11:48                                         ` Andreas Schwab
2016-09-18 15:34               ` Bastien Guerry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).