Might as well use `invisible-p', so it works for invisibility from overlays as well as from text properties. Patch attached.