Skip to content

Commit 41a409f

Browse files
committed
org-src-font-lock-fontify-block: Do not fold links inside src blocks
* lisp/org-src.el (org-src-font-lock-fontify-block): Overwrite link fontification after regexp-based `org-activate-links' fontifies links disregarding Org parser. Hidden parts of link-looking text are explicitly unfolded now. This commit relies on specific fontification order in `org-font-lock-keywords'. (org-fold-region): Declare function. Reported-by: Tim Loderhose <tim@loderhose.com> Link: https://orgmode.org/list/XdWFnN3XCJ67x3SvoiVo_itGGYfboKmuWp7OxQxRZ_SGA5vgb72oWBoqTmOUUtiqUR890-kIXjI7uhlse-HFYqNVJTyVlc15zAzbP8qHVdo=@loderhose.com
1 parent de553d1 commit 41a409f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lisp/org-src.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
(declare-function org--get-expected-indentation "org" (element contentsp))
4444
(declare-function org-mode "org" ())
4545
(declare-function org--get-expected-indentation "org" (element contentsp))
46+
(declare-function org-fold-region "org-fold" (from to flag &optional spec-or-alias))
4647
(declare-function org-element-at-point "org-element" (&optional pom cached-only))
4748
(declare-function org-element-class "org-element" (datum &optional parent))
4849
(declare-function org-element-context "org-element" (&optional element))
@@ -698,6 +699,8 @@ as `org-src-fontify-natively' is non-nil."
698699
(when (or (facep src-face) (listp src-face))
699700
(font-lock-append-text-property start end 'face src-face))
700701
(font-lock-append-text-property start end 'face 'org-block))
702+
;; Clear abbreviated link folding.
703+
(org-fold-region start end nil 'org-link)
701704
(add-text-properties
702705
start end
703706
'(font-lock-fontified t fontified t font-lock-multiline t))

0 commit comments

Comments
 (0)