Q: how can I get
isearch to understand invisible text
properties, not just overlays?
I'm writing a major mode that uses text properties rather than
overlays to toggle visibility. I'd like to use
isearch to be
able to find invisible text and make it visible, but don't know
how to convince
isearch to do so.
As an example, evaluate the following function in a buffer:
(defun try-me () (let ((text (concat (propertize "Visible text" 'invisible nil) (propertize "\nOtters" 'invisible t)))) (insert text)))
It will insert one line of visible text "Visible text", and another line of invisible text "Otters" below it.
isearch to search for "Otters" results in no hits.
How can I get
isearch a) to find text with the invisible text
property, and b) get it to toggle the invisible text property so
it's visible? (I imagine I'll need a custom function to do that,
but don't know how to get
isearch to use that function.)