*** add-to-invisibility-spec, remove-from-invisibility-spec
Modes that use overlays to hide portions of a buffer should set the invisible property of the overlay to the mode's name (or another symbol) and modify the `buffer-invisibility-spec' to include that symbol. Use `add-to-invisibility-spec' and `remove-from-invisibility-spec' to manipulate the `buffer-invisibility-spec'. Here is an example of how to do this:

;; If we want to display an ellipsis: (add-to-invisibility-spec '(my-symbol . t)) ;; If you don't want ellipsis: (add-to-invisibility-spec 'my-symbol)

... (overlay-put (make-overlay beginning end) 'invisible 'my-symbol)

... ;; When done with the overlays: (remove-from-invisibility-spec '(my-symbol . t)) ;; Or respectively: (remove-from-invisibility-spec 'my-symbol)