bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24073: 24.5; outline-on-heading-p sees any invisible text property a


From: npostavs
Subject: bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline invisible
Date: Mon, 01 Aug 2016 10:16:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)

Paul Rankin <hello@paulwrankin.com> writes:

> Noam Postavsky <npostavs@users.sourceforge.net> on Thu, 28 Jul 2016 22:07 
> -0400:
>> I think it's because outline-invisible-p is a defsubst, so when
>> compiled, callers don't actually reference the symbol
>> `outline-invisible-p' at all.
>
> Ah yes. Thanks. A predicate function that doesn't return a t or nil
> and misuses defsubst!

I don't think it's necessarily a misuse of defsubst, that just happens
to be one of the limitations.

>
> Is there any way for a package to work around this with outline in its 
> present state?

Well, as you saw, re`eval'uating outline-on-heading-p (so that it
becomes uncompiled) seems to work, you could try doing that from lisp:

    (pcase (find-function-noselect 'outline-on-heading-p)
      (`(,buffer . ,position)
       (with-current-buffer buffer
         (goto-char position)
         (eval (read (current-buffer)))))
      (_ (error "Couldn't find `outline-on-heading-p'")))

Or advise :override outline-on-heading-p instead of outline-invisible-p.

>     (advice-add 'outline-invisible-p :filter-return
>                 (lambda (return) (eq return (or 'outline t)))

By the way, shouldn't that be

                  (lambda (return) (or (eq return 'outline) return))

>                 '((name . "fountain-mode-patch")))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]