Browse Source

org-do-emphasis-faces: Remove link folds if any

* lisp/org.el (org-do-emphasis-faces): Reveal hidden parts of links
fontified by `org-activate-link', if any.

Partially fixes
https://list.orgmode.org/t7np1d$vu8$1@ciao.gmane.io/T/#u
The proper fix should also involve `org-activate-link' not hitting
false-positives inside verbatim.
Ihor Radchenko 3 years ago
parent
commit
c02c0d660d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lisp/org.el

+ 4 - 0
lisp/org.el

@@ -4894,6 +4894,10 @@ stacked delimiters is N.  Escaping delimiters is not possible."
 	      (when verbatim?
 		(org-remove-flyspell-overlays-in
 		 (match-beginning 0) (match-end 0))
+                (when (and (org-fold-core-folding-spec-p 'org-link)
+                           (org-fold-core-folding-spec-p 'org-link-description))
+                  (org-fold-region (match-beginning 0) (match-end 0) nil 'org-link)
+                  (org-fold-region (match-beginning 0) (match-end 0) nil 'org-link-description))
 		(remove-text-properties (match-beginning 2) (match-end 2)
 					'(display t invisible t intangible t)))
 	      (add-text-properties (match-beginning 2) (match-end 2)