Stefan Monnier <> writes:

> But in addition to that, I suspect that Org should probably not modify
> visibility directly from the modification hooks.  Instead, its
> modification hook function should just stash the info somewhere and then
> update the visibility later on, such as in a `post-command-hook`, timer,
> `pre-redisplay-functions`, younameit.

Good idea. At least, for this specific feature in Org mode.

> As a rule of thumb, I think modification hooks should be treated a bit
> like POSIX signal handlers: just record the event somewhere but don't do
> any substantial work in there.

Yet, it is sometimes necessary to modify text right inside the
modification hooks. Otherwise, it is very hard (and sometimes
impossible) to keep track of the original text region when multiple
modifications happen there one by one.

Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <>.
Support Org development at <>,
or support my work at <>

Reply via email to