Subject: Re: bug#7101: Please reveal-mode, don't hide my overlays!

From: Stefan Monnier <[email-masked]>
Date: Thu, 07 Oct 2010 12:23:07 +0200

> Am I the only one that gets crazy when reveal hides the overlays
> again? At least I mostly find it very frustrating when moving around
> in a buffer that uses org-mode.

I love this feature, since it lets me open&close things without ever
having to remember a keybinding: I hide everything in the major mode
hook and then use reveal-mode to hide&show.

> I can see it is useful sometimes though I do not know how to best
> separate those times when it is useful and when it is not. So I will
> not try that.

> Instead in the attached patch I made the automatic hiding optional and
> add a new command for hiding

Maybe I could live with that, and I think it's going in the right
direction (e.g. the reveal-close-revealed functionality sounds good),
but I don't think having it as a defcustom is right: it's something
you'll likely want to change dynamically at run time.

One thing I've considered is to add a "keep-pos/region-shown" command that
would mark the current buffer position (or region) as something that
should stay revealed, so it won't be auto-closed when you move elsewhere.
Of course, it would want to come with something like
reveal-close-revealed to later re-hide them.

Another thing I'd be interested to see is a hook that major/minor modes
can use to have some control over showing/hiding.  The main such use for
me would be to let smerge-mode teach reveal-mode that if one conflict
marker is revealed, all the corresponding markers should also be
revealed (or maybe just: if part of a conflict is revealed, always
reveal the whole conflict).

        Stefan