branch: externals/org-transclusion
commit 9fa73547523ef196bcd3d51fe6b0545b25b2a61c
Author: gggion <[email protected]>
Commit: gggion <[email protected]>
feat: add org-transclusion-after-remove-functions hook
Add customizable hook to allow extensions to perform cleanup after
transclusion removal. This enables org-transclusion-indent-mode to
refresh org-indent properties without creating hard dependency.
* org-transclusion.el (org-transclusion-after-remove-functions): New
defcustom. Run after removing a transclusion with arguments (SRC-BUF
SRC-BEG SRC-END) representing the source buffer and region.
The hook provides an extension point for optional features like
org-indent-mode support without requiring the main package to depend
on org-indent. Defined as defcustom for consistency with
org-transclusion-after-add-functions.
---
org-transclusion.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/org-transclusion.el b/org-transclusion.el
index bbf693dfd1..8b44918bb2 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -116,6 +116,17 @@ and end, pointing to the beginning and end of the
transcluded
content."
:type '(repeat function))
+(defcustom org-transclusion-after-remove-functions nil
+ "Functions to be called after a transclusion has been removed.
+The hook runs after the transclusion overlay has been deleted and
+the #+transclude keyword has been re-inserted. It is intended for
+cleanup operations in the source buffer. For example, it is used by
+the `org-transclusion-indent-mode' extension to refresh org-indent
+properties after transclusion removal. The functions are called with
+arguments (src-buf src-beg src-end), pointing to the source buffer
+and the region that was transcluded."
+ :type '(repeat function))
+
;;;; Faces
(defface org-transclusion-source-fringe