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

From: Noam Postavsky <[email-masked]>
Date: Tue, 30 Apr 2019 00:34:41 -0400

Bastien <[email-masked]> writes:

> I looked at the way isearch does the temporary opening of overlays,
> and it looks complex to add another mechanism to temporarily ignore
> the 'invisible text property.  At least I don't know how to do this.

I was thinking all this complication could be avoided if we just allowed
(overlay-put OVERLAY 'invisible nil) to make text visible.

--- i/src/textprop.c
+++ w/src/textprop.c
@@ -630,14 +630,14 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
       /* Now check the overlays in order of decreasing priority.  */
       while (--noverlays >= 0)
 	{
-	  Lisp_Object tem = Foverlay_get (overlay_vec[noverlays], prop);
+          Lisp_Object tem = Fplist_member (XOVERLAY (overlay_vec[noverlays])->plist, prop);
 	  if (!NILP (tem))
 	    {
 	      if (overlay)
 		/* Return the overlay we got the property from.  */
 		*overlay = overlay_vec[noverlays];
 	      SAFE_FREE ();
-	      return tem;
+	      return XCAR (XCDR (tem));
 	    }
 	}
       SAFE_FREE ();

> Also, I tried a preliminary patches (attached) which I find quite
> convenient and seems to do what I expected first when setting
> (setq search-invisible t): turning on visible-mode.

This seems like a reasonable, though perhaps making the whole buffer
visible isn't always wanted.