[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: |
Noam Postavsky |
Subject: |
bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline invisible |
Date: |
Mon, 1 Aug 2016 23:47:34 -0400 |
On Mon, Aug 1, 2016 at 11:27 PM, Paul Rankin <hello@paulwrankin.com> wrote:
> Whoa this is terrifying...
:) Don't like pcase?
>
> Would something like the following work? Maybe with a
> (condition-case ...) ?
>
> (let ((source (find-function-noselect 'outline-on-heading-p)))
> (with-current-buffer (car source)
> (goto-char (cdr source))
> (eval-defun nil)))
Yes, that's about the same, though I would still suggest (eval (read
...)) over eval-defun for non-interactive code.
>> By the way, shouldn't that be
>>
>> (lambda (return) (or (eq return 'outline) return))
>
> I think this will fail when outline-invisible-p returns foo in the
> initial example. We want to only return t when outline-invisible-p
> returns outline, not foo or otherwise.
Oh, then your original was okay, it just had a bit of dead code.
Simply (lambda (return) (eq return 'outline)) should suffice.