diff --git a/lisp/ob-tangle-sync.el b/lisp/ob-tangle-sync.el index 61c23f647..cfa6abdd2 100644 --- a/lisp/ob-tangle-sync.el +++ b/lisp/ob-tangle-sync.el @@ -44,7 +44,6 @@ (define-minor-mode org-babel-tangle-sync-mode "Global minor mode that synchronizes tangled files after every save." :global t - :interactive t :lighter " o-ts" (if org-babel-tangle-sync-mode (add-hook 'after-save-hook 'org-babel-tangle-sync-synchronize nil t) @@ -57,8 +56,8 @@ here are subject to the org-babel-tangle-sync treatment. If nil, then all org files with tangle headers are considered." :group 'org-babel-tangle-sync :type 'list - :package-version '(Org . "9.6.5") - :set (lambda (_var val) (mapcar #'(lambda (x) (expand-file-name x)) val))) + :package-version '(Org . "9.7") + :set (lambda (var val) (set var (mapcar #'expand-file-name val)))) (defun org-babel-tangle-sync--babel-tangle-jump (link block-name) @@ -95,15 +94,15 @@ If the cursor is either within the source file or in destination tangled file, perform a desired tangling action. The tangling action by default is to detangle the tangled files' changes back to its source block, or to tangle the source block to its tangled -file. Actions are one of `skip' (no action), `pull' (detangle +file. Actions are one of `skip' (no action), `import' (detangle only), `export' (tangle only), and `both' (default, synchronize in both directions). All `org-mode' source blocks and all tangled files with comments are considered valid targets, unless specified otherwise by `org-babel-tangle-sync-files'." (interactive) (let* ((link (save-excursion - (progn (re-search-backward org-link-bracket-re nil t) - (match-string-no-properties 0)))) + (re-search-backward org-link-bracket-re nil t) + (match-string-no-properties 0))) (block-name (match-string 2)) (orgfile-p (string= major-mode "org-mode")) (tangled-file-p (and link (not orgfile-p)))) @@ -142,12 +141,12 @@ specified otherwise by `org-babel-tangle-sync-files'." (org-babel-detangle) (message "Synced to %s" source-file)))))) - ;; Source Block → Tangled File (or Source Block ← Tangled File (via "pull")) + ;; Source Block → Tangled File (or Source Block ← Tangled File (via "import")) (when orgfile-p ;; Tangle action of Source file on Block if: ;; - member of sync file list (or list is empty) ;; Actions - ;; - pull (Source Block ← File) + ;; - import (Source Block ← File) ;; - skip (nothing) ;; - export, both, nil (Source Block → File) (if (or (null org-babel-tangle-sync-files) @@ -157,7 +156,7 @@ specified otherwise by `org-babel-tangle-sync-files'." (tangle-file (cdr (assq :tangle src-headers))) (tangle-action (alist-get :tangle-sync src-headers))) (when tangle-file - (cond ((string= tangle-action "pull") (save-excursion + (cond ((string= tangle-action "import") (save-excursion (org-babel-detangle tangle-file))) ((string= tangle-action "skip") nil) (t (let ((current-prefix-arg '(16)))