From 3399279e2c5c2a56076fa85adffffe7aa5c2ca74 Mon Sep 17 00:00:00 2001 From: MT Date: Wed, 3 May 2023 09:47:34 +0200 Subject: [PATCH 7/7] lisp/ob-tangle.el: Restore argument order in org-babel-detangle * ob-tangle.el (org-babel-detangle): Change `source-code-file' to be the first argument again for external usage. This changes the prefix argument functionality, which is replaced by a much easier `single-p' argument to denote whether a single block is being detangled. --- lisp/ob-tangle.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index f199c77bc..fde6683a6 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -660,13 +660,13 @@ by `org-babel-get-src-block-info'." (org-fill-template org-babel-tangle-comment-format-end link-data)))) ;; de-tangling functions -(defun org-babel-detangle (&optional arg source-code-file ignore-header) +(defun org-babel-detangle (&optional source-code-file single-p ignore-header) "Propagate changes in source file back original to Org file. This requires that code blocks were tangled with link comments -which enable the original code blocks to be found. With one -universal prefix argument, only detangle the block at point. If -IGNORE-HEADER then detangle regardless of `:tangle-sync' status." - (interactive "P") +which enable the original code blocks to be found. If SINGLE-P +is t then only detangle a single block. If IGNORE-HEADER then +detangle regardless of `:tangle-sync' status." + (interactive) (save-excursion (when source-code-file (find-file source-code-file)) (let ((counter 0) (skip-counter 0) (tang-counter 0) end) @@ -677,7 +677,7 @@ IGNORE-HEADER then detangle regardless of `:tangle-sync' status." ((string= action "export") (setq tang-counter (1+ tang-counter)))) (setq counter (1+ counter)))))) - (if (equal arg '(4)) + (if single-p (funcall single-block-metrics) (goto-char (point-min)) (while (re-search-forward org-link-bracket-re nil t) -- 2.40.1