@@ -1451,19 +1451,24 @@ the transcluded region is large."
1451
1451
(defun org-transclusion-live-sync-source-range-markers (beg end )
1452
1452
" Find and return source range based on transclusion's BEG and END.
1453
1453
Return \" (src-beg-mkr . src-end-mkr)\" ."
1454
- (let ((src-buf ( overlay-buffer ( get-text-property (point )
1455
- 'org-transclusion-pair ) ))
1456
- (src-search-beg (org-transclusion-find-source-marker beg end)))
1454
+ (let* ((src-ov ( get-text-property (point ) 'org-transclusion-pair ) )
1455
+ (src-buf ( overlay-buffer src-ov ))
1456
+ (src-search-beg (org-transclusion-find-source-marker beg end)))
1457
1457
(if (not src-search-beg)
1458
1458
(user-error " No live-sync can be started at: %d" (point ))
1459
- (with-current-buffer src-buf
1460
- (goto-char src-search-beg)
1461
- (when-let* ((src-elem (org-transclusion-live-sync-enclosing-element))
1462
- (src-beg (org-element-property :begin src-elem))
1463
- (src-end (org-element-property :end src-elem)))
1459
+ (if (equal (current-buffer ) src-buf)
1460
+ ; ;; This if statement is a experiment
1464
1461
(cons
1465
- (move-marker (make-marker ) src-beg)
1466
- (move-marker (make-marker ) src-end)))))))
1462
+ (move-marker (make-marker ) (overlay-start src-ov))
1463
+ (move-marker (make-marker ) (overlay-end src-ov)))
1464
+ (with-current-buffer src-buf
1465
+ (goto-char src-search-beg)
1466
+ (when-let* ((src-elem (org-transclusion-live-sync-enclosing-element))
1467
+ (src-beg (org-element-property :begin src-elem))
1468
+ (src-end (org-element-property :end src-elem)))
1469
+ (cons
1470
+ (move-marker (make-marker ) src-beg)
1471
+ (move-marker (make-marker ) src-end))))))))
1467
1472
1468
1473
(defun org-transclusion-live-sync-source-content (beg end )
1469
1474
" Return text content between BEG and END.
@@ -1659,6 +1664,16 @@ links and IDs."
1659
1664
(setq tc-ov (text-clone-make-overlay beg end))))
1660
1665
(cons src-ov tc-ov))))
1661
1666
1667
+ (defun org-transclusion-live-sync-buffers-org (type )
1668
+ " Return cons cell of overlays for source and trasnclusion.
1669
+ The cons cell to be returned is in this format:
1670
+
1671
+ (src-ov . tc-ov)
1672
+
1673
+ This function uses TYPE to identify Org files to work on only Org
1674
+ links and IDs."
1675
+ (when (org-transclusion-type-is-org type)))
1676
+
1662
1677
(defun org-transclusion-live-sync-buffers-others-default (_type )
1663
1678
" Return cons cell of overlays for source and trasnclusion.
1664
1679
The cons cell to be returned is in this format:
0 commit comments