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: Paul Rankin
Subject: bug#24073: 24.5; outline-on-heading-p sees any invisible text property as outline invisible
Date: Tue, 02 Aug 2016 14:22:07 +1000

Noam Postavsky <npostavs@users.sourceforge.net> on Mon, 01 Aug 2016 23:47 -0400:
> :) Don't like pcase?

I fear what I do not understand.

> > 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.

Ah yes, I should have read the docs: "Read one Lisp expression as text
from STREAM" - I assumed it would eval the whole buffer... Thanks

I'm gonna assume if the package has (require 'outline) then it's safe to
assume the existence of outline-on-heading-p too... It appears that
(find-function-noselect 'missingfunction) will just hang Emacs anyway.

> >> 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.

Then this will fail if/when outline-invisible-p is fixed to return t
when I wanna future-proof this, so users don't notice the transition.
Sorry my previous reply neglected to mention returning t.





reply via email to

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