Subject: bug#30204: 27.0.50; Changing major mode resets non-default invisibility spec

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Sep 2021 13:32:01 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 05 Sep 2021 12:12:18 +0200
> 
> Actually, that's a function that's I've wanted before -- I sometimes
> find myself in a buffer with lots of...  stuff, and then resorting to
> saving, killing the buffer and then loading the contents to be sure that
> I'm rid of all local variables/overlays/text properties/etc.

Doesn't font-lock-fontify-block (which used to be "M-o M-o") do what
you want?