branch: externals/org-transclusion
commit 47ff2656eb0b71d0b728bf240cbc8029cbc3fba8
Author: Noboru Ota <[email protected]>
Commit: Noboru Ota <[email protected]>

    feat(insert): org-transclusion-insert-link-functions as a user option
---
 org-transclusion.el | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index 040de45a41..8ec681d0f7 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -127,6 +127,13 @@ arguments (src-buf src-beg src-end), pointing to the 
source buffer
 and the region that was transcluded."
   :type '(repeat function))
 
+(defcustom org-transclusion-insert-link-functions '(org-insert-link)
+  "Functions for `org-transclusion-insert' to insert an Org link.
+It is expected that these functions prompt for user to choose / create a
+link, but as long as the function insert a valid org link in a buffer,
+it will work. Used in `org-transclusion-insert-org-link', which see."
+  :type '(repeat function))
+
 ;;;; Faces
 
 (defface org-transclusion-source-fringe
@@ -170,8 +177,6 @@ The default is no color specification (transparent).")
 
 ;;;; Variables
 
-(defvar org-transclusion-insert-link-functions '(org-insert-link))
-
 (defvar org-transclusion-extensions-loaded nil
   "Have the extensions been loaded already?")
 
@@ -1670,6 +1675,11 @@ dynamic updates."
 ;;;; Utility Functions
 
 (defun org-transclusion-insert-org-link ()
+  "Return org link string from another org link function.
+The function is an element in `org-transclusion-insert-link-functions'.
+It is expected that these functions prompt for user to choose / create a
+link, but as long as the function insert a valid org link in a buffer,
+it will work."
   (let ((function (if (length> org-transclusion-insert-link-functions 1)
                       (intern (completing-read
                                "Choose a function: "

Reply via email to