Subject: bug#16493: 24.3.50; (setq search-invisible t) is useless, let's allow to turn visible-mode temporarily on

From: Stefan Monnier <[email-masked]>
Date: Sat, 11 May 2019 16:06:12 -0400

>> Starting from t, (add-to-invisibility-spec 'foo) also has the weird
>> result that it *reduces* the number of properties which cause
>> invisibility (from infinity to 2).
> Yes, but I don't see that as a problem.

Here's another way to look at it:

Give me a circumstance where an Elisp package can make use of the fact
that buffer-invisibility-spec defaults to t?

I can't come up with any, because there are only 3 cases:
- the package doesn't use `invisible` and hence doesn't care.
- the package only uses the `t` value of the `invisible` property, so it
  doesn't care because add-to-invisibility-spec always puts `t` in the list.
- the package uses non-nil, non-t value of the `invisible` property.
  In this case, either the package:
  - calls add-to-invisibility-spec to register that value, in which case
    it doesn't care.
  - doesn't call add-to-invisibility-spec, so the text is only invisible
    until some other unrelated package comes around and calls
    add-to-invisibility-spec, thus causing undesired behavior.

So any package which makes use of this default value is vulnerable to
being broken by activation of some unrelated package.

        Stefan