From 9f6894c10651b86bde48d5e7666d47392f223899 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 26 Feb 2024 15:52:25 +0300 Subject: [PATCH] org-activate-folds: Do not fontify newline after abbreviated links * lisp/org.el (org-activate-folds): When a fold is created by link abbreviation, and a link ends at eol, do not force the newline after the ]] to have the same face as the link. Reported-by: Rohit Patnaik Link: https://orgmode.org/list/6d440976-6747-4ce6-8913-b63931dd017f@app.fastmail.com --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 5df847125..898f72576 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5814,7 +5814,8 @@ highlighting was done, nil otherwise." (when next-unfolded-newline (org-with-wide-buffer (when (and (> (match-beginning 0) (point-min)) - (org-fold-folded-p (1- (match-beginning 0)))) + (org-fold-folded-p (1- (match-beginning 0))) + (not (org-fold-folded-p (1- (match-beginning 0)) 'org-link))) (put-text-property (match-beginning 0) (match-end 0) 'face