                  'space-doc-emphasis-overlay t)))
 
 (defun spacemacs//space-doc-modf-emphasis-overlays (&optional enable)
-  "If ENABLE has non-nil value - overlay regions which have already been
-emphasized by `org-do-emphasis-faces'. Otherwise remove all overlays
-from the current buffer with property `space-doc-emphasis-overlay'."
-
-  (if enable
+  "If ENABLE has non-nil value - overlay regions which have
+already been emphasized by `org-do-emphasis-faces'
+in the current buffer. Otherwise remove all overlays
+with property `space-doc-emphasis-overlay'."
+
+  ;; Remove overlays.
+  (dolist (overlay (overlays-in (point-min) (point-max)))
+    (when (overlay-get overlay 'space-doc-emphasis-overlay)
+      (delete-overlay overlay)))
+
+  (when enable
       (dolist (emphasized-region
                (spacemacs//space-doc-find-regions-by-text-property
                 'org-emphasis t))
         (spacemacs//space-doc-emphasis-region
          (car  emphasized-region)
-         (cadr emphasized-region)))
-
-    ;; Remove overlays.
-    (dolist (overlay (overlays-in (point-min) (point-max)))
-      (when (overlay-get overlay 'space-doc-emphasis-overlay)
-        (delete-overlay overlay)))))
+         (cadr emphasized-region)))))
 
 (defun spacemacs//space-doc-modf-org-kbd-face-remap (&optional enable)
   "If ENABLE has non-nil value - removes boxes from the `org-kbd'


(defun spacemacs//space-doc-modf-meta-tags-overlays (&optional enable)
  "If ENABLE has non-nil value - modify `org-mode' meta tags
appearance in the current `org-mode' buffer. Otherwise - disable."

  (if enable
      (let* ((invisible-org-meta-tags-list
              `(;; Hide TITLE tag.
                ("\\([ \t]*\\#\\+TITLE\\:\[ \t]*\\)"

(defun spacemacs//space-doc-org-do-emphasis-faces-advice (found)
  "If FOUND has non-nil value - modify emphasized regions
appearances in the current buffer. The function uses
`match-data' set by `org-do-emphasis-faces' function."

  ;; `org-do-emphasis-faces' returns non-nil value when it
  ;; found a region to emphasize.
  (when (and found space-doc-mode)
    (spacemacs//space-doc-emphasis-region
     (match-beginning 2)
     (match-end 2)))
  found)

(defun spacemacs//space-doc-modf-advice-org-do-emphasis-faces (&optional enable)
  "If ENABLE has non-nil value - advice `org-do-emphasis-faces' function
with `spacemacs//space-doc-org-do-emphasis-faces-advice'.
NOTE: `org-do-emphasis-faces' is lazy and will emphasize only part of the
current buffer so piggybacking it should be pretty performant solution."

  (when enable
    (advice-add 'org-do-emphasis-faces
                :after
                #'spacemacs//space-doc-org-do-emphasis-faces-advice)))

(defun spacemacs//space-doc-emphasis-region (begin end)
  "Emphasis region based on its leading character.
