branch: externals/org-transclusion
commit 19fb9cf67786e6a23763ba899da4356284b6be27
Author: gggion <[email protected]>
Commit: gggion <[email protected]>
fix: remove destination fringe re-application from indent-mode extension
* org-transclusion-indent-mode.el
(org-transclusion-indent--add-properties-and-fringes): Rename to
org-transclusion-indent--add-properties. Remove call to
org-transclusion-add-fringe-to-region for destination buffer. Remove
declare-function for org-transclusion-add-fringe-to-region. Update
docstring to clarify function only handles org-indent properties, not
fringe indicators.
Destination buffer fringes are managed by uniform text properties set in
org-transclusion-content-insert. Extension should only ensure
org-indent-mode's indentation properties are applied, not modify fringe
indicators. Source buffer fringes are handled separately via per-line
text properties and modification hooks. Previous implementation was
adding per-line fringes to destination buffer, conflicting with uniform
fringe approach and causing visual inconsistencies.
---
org-transclusion-indent-mode.el | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/org-transclusion-indent-mode.el b/org-transclusion-indent-mode.el
index ccf2a099d7..f0f4c445f7 100644
--- a/org-transclusion-indent-mode.el
+++ b/org-transclusion-indent-mode.el
@@ -30,21 +30,18 @@
;;; Code:
(require 'org-indent)
-(declare-function org-transclusion-add-fringe-to-region "org-transclusion")
-(defun org-transclusion-indent--add-properties-and-fringes (beg end)
- "Ensure org-indent properties exist in transcluded region, then re-add
fringes.
+(defun org-transclusion-indent--add-properties (beg end)
+ "Ensure org-indent properties exist in transcluded region.
BEG and END are the transcluded region bounds.
-The main package adds fringes during content insertion, but org-indent's
-after-change hook may not have run yet. This function ensures org-indent
-properties are set, then re-applies fringes that may have been overwritten."
+The main package adds uniform fringe indicators to transcluded content
+via text properties. This function ensures org-indent-mode's indentation
+properties are applied if org-indent-mode is active, but does not modify
+the fringe indicators."
(when org-indent-mode
;; Ensure org-indent properties exist
- (org-indent-add-properties beg end)
- ;; Re-apply fringes (org-indent-add-properties may have overwritten them)
- (org-transclusion-add-fringe-to-region
- (current-buffer) beg end 'org-transclusion-fringe)))
+ (org-indent-add-properties beg end)))
(defun org-transclusion-indent--refresh-source-region (src-buf src-beg src-end)
"Refresh org-indent properties in source region after transclusion removal.
@@ -57,7 +54,7 @@ is active."
;; Register hooks when extension loads
(add-hook 'org-transclusion-after-add-functions
- #'org-transclusion-indent--add-properties-and-fringes)
+ #'org-transclusion-indent--add-properties)
(add-hook 'org-transclusion-after-remove-functions
#'org-transclusion-indent--refresh-source-region)