> the extension function becomes helpful again: this because the
> #+BEGIN/#+END matcher is incremental and eventually the region to
Well, on a closer inspection it's not that incremental, it's just
ignoring the limit...
(defun org-fontify-meta-lines-and-blocks-1 (limit)
....
(when (re-search-forward
(concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
nil t) ;; on purpose, we look further than LIMIT
....
This is against the rules! But if it's allowed here it should be
allowed in org-do-latex-and-related by the same token, shouldn't it?
So in order to get all this properly working:
1. Also ignore the limit in org-do-latex-and-related.
2. Install a region extension function so that multiline regions are
properly identified at the start and after syntax breaking change
(that is, at the beginning or at the end).