[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-transclusion 83868e2cd9 13/29: Allow live sync on o
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-transclusion 83868e2cd9 13/29: Allow live sync on org-blocks -- experimental |
Date: |
Mon, 8 May 2023 06:59:09 -0400 (EDT) |
branch: externals/org-transclusion
commit 83868e2cd90a8371712720b10a83c8adb6dd42ca
Author: Benjamin Cherry <ben@devcarbon.com>
Commit: Noboru Ota <me@nobiot.com>
Allow live sync on org-blocks -- experimental
---
org-transclusion-src-lines.el | 4 ++--
org-transclusion.el | 38 ++++++++++++++++++++++++--------------
2 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/org-transclusion-src-lines.el b/org-transclusion-src-lines.el
index 3bc7cc4e76..381aad2a2b 100644
--- a/org-transclusion-src-lines.el
+++ b/org-transclusion-src-lines.el
@@ -293,8 +293,8 @@ This function uses TYPE to identify relevant files; it's
meant
for non-Org text files including program source files."
(when (org-transclusion-src-lines-p type)
;; Let's not allow live-sync when source is transcluded into a source
block.
- (when (string= "src" type)
- (user-error "No live sync for src-code block"))
+ ;; (when (string= "src" type)
+ ;; (user-error "No live sync for src-code block"))
(org-transclusion-live-sync-buffers-others-default nil)))
(provide 'org-transclusion-src-lines)
diff --git a/org-transclusion.el b/org-transclusion.el
index bca8f3f235..008e34df8f 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -681,7 +681,10 @@ a couple of org-transclusion specific keybindings; namely:
(user-error
(concat
"No live-sync can be started. "
- "Lengths of transclusion and source are not identical"))
+ "Lengths of transclusion and source are not identical"
+ (format " - tc: [%s] src: [%s]"
+ (- (overlay-end tc-ov) (overlay-start tc-ov))
+ (- (overlay-end src-ov) (overlay-start src-ov)))))
nil) ; return nil
(org-transclusion-live-sync-modify-overlays
(text-clone-set-overlays src-ov tc-ov))
@@ -1652,9 +1655,16 @@ This function is for non-Org text files."
(overlay-start tc-pair)
(overlay-end tc-pair)
(overlay-buffer tc-pair)))
- (tc-ov (text-clone-make-overlay
- (get-text-property (point) 'org-transclusion-beg-mkr)
- (get-text-property (point) 'org-transclusion-end-mkr))))
+ (tc-ov-beg-mkr (get-text-property (point)
'org-transclusion-beg-mkr))
+ (tc-ov-end-mkr (get-text-property (point)
'org-transclusion-end-mkr))
+ (tc-ov (if (org-in-src-block-p)
+ (with-current-buffer (marker-buffer tc-ov-beg-mkr)
+ (save-mark-and-excursion
+ (org-babel-mark-block)
+ (text-clone-make-overlay (region-beginning)
+ (1- (region-end)))))
+ (text-clone-make-overlay tc-ov-end-mkr
+ tc-ov-end-mkr))))
(cons src-ov tc-ov)))
;;-----------------------------------------------------------------------------
@@ -1673,16 +1683,16 @@ ensure the settings revert to the user's setting prior
to
;; Ensure this happens only once until deactivation
(unless (memq 'org-transclusion-type yank-excluded-properties)
(let ((excluded-props))
- ;; Return t if 'wrap-prefix is already in `yank-excluded-properties'
- ;; if not push to elm the list
- ;; wrap-prefix, etc.
- (dolist (sym org-transclusion-yank-excluded-properties)
- (if (memq sym yank-excluded-properties)
- (push sym org-transclusion-yank-remember-user-excluded-props)
- ;; Avoid duplicate
- (push sym excluded-props)))
- (setq yank-excluded-properties
- (append yank-excluded-properties excluded-props)))))
+ ;; Return t if 'wrap-prefix is already in `yank-excluded-properties'
+ ;; if not push to elm the list
+ ;; wrap-prefix, etc.
+ (dolist (sym org-transclusion-yank-excluded-properties)
+ (if (memq sym yank-excluded-properties)
+ (push sym org-transclusion-yank-remember-user-excluded-props)
+ ;; Avoid duplicate
+ (push sym excluded-props)))
+ (setq yank-excluded-properties
+ (append yank-excluded-properties excluded-props)))))
(defun org-transclusion-yank-excluded-properties-remove ()
"Remove transclusion-specific text props from `yank-excluded-properties'.
- [elpa] externals/org-transclusion 2cb719e80f 02/29: Add support for handling identations when using :thing-at-point sexp, (continued)
- [elpa] externals/org-transclusion 2cb719e80f 02/29: Add support for handling identations when using :thing-at-point sexp, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 8317ec94fa 09/29: Fixup, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 654c1a83f9 17/29: feat: suggestion for live-sync-buffers-src-lines, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 28737e1b5c 08/29: Need newline guarentee also in content-src-lines, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 1b5f428e58 10/29: Move new-line guarentee to cover all content sources, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion b9d73ad7fd 16/29: Typo., ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion f0e8240695 20/29: doc: mention the live-sync to be in the next stable rel for ELPA, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 1695f306e6 22/29: refactor: reverted changes to org-transclusion.el, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion d66e4b1f7d 24/29: test: remove spurflous bracket, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 1d6fb83578 21/29: fix: (unit-tests.el) require org-transclusion, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 83868e2cd9 13/29: Allow live sync on org-blocks -- experimental,
ELPA Syncer <=
- [elpa] externals/org-transclusion c44071dfb5 29/29: docs: fix id:1234567890 with zero-width space, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion 27abeab88d 06/29: test: test files things-at-point, ELPA Syncer, 2023/05/08
- [elpa] externals/org-transclusion ccc7870f07 12/29: Fixup, ELPA Syncer, 2023/05/08