* lisp/org-fold-core.el (org-fold-core-initialize): Declare `org-fold-core-fontified' text property for font-lock. (org-fold-core--force-fontification): New variable controlling forced fontification inside folded regions. (org-fold-core-fontify-region): Fix cases when BEG is inside folded region. Respect `org-fold-core--force-fontification'. * lisp/org-macs.el (org-with-forced-fontification): New macro. (org-buffer-substring-fontified): (org-looking-at-fontified): Do not rely on jit-lock. Use `org-fold-core-fontified' text property to determine whether text is already fontified. --- lisp/org-fold-core.el | 69 +++++++++++++++++++++++++------------------ lisp/org-macs.el | 31 +++++++++++++++++++ 2 files changed, 72 insertions(+), 28 deletions(-)