emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR] org-babel-n-tangle


From: Phil
Subject: Re: [FR] org-babel-n-tangle
Date: Mon, 15 Jul 2024 07:12:31 +0200
User-agent: Mozilla Thunderbird


* [2024-07-12 13:23] Ihor Radchenko:> Phil <pe@7d.nz> writes:
To tangle to multiple destinations

a logic extension of the existing tangle mechanism.
1) Introduce :tangle-directory parameter that defines
   relative directory to be used as tangle target; this
   directory, if defined, will be used instead of the Org
   file directory to expand the tangle target;
2) Allow :tangle-directory and :tangle-file to be a list
   of targets to write.

Then, we can modify `org-babel-effective-tangled-filename'
to account for :tangle directory and modify
`org-babel-tangle' (as you did) to write to multiple
targets.

All right. So I have it working for single blocks by
modifying only `org-babel-tangle' with :tangle-directory
accepting a single string or a list, e.g.

:tangle-directory '("dir1" "/ssh:host1:/dir2" "/-::/etc")

The option is ignored for file-wide tangle.

What do you think of, instead of adding :tangle-directory,
modifying :tangle to make it accept also a list?

Since I may not get back to this in the next weeks,
I'm saving the following note and a patch as a current
status of the function for later.

=:tangle-directory dir= is set
- Tangle globally
      |--------+------------------+--------------|
      | tangle | expected result  | current      |
      |--------+------------------+--------------|
      | yes    |             ignore dir          |
      | no     |             ignore dir          |
      | file   | block → dir/file?| block → file |
      |--------+------------------+--------------|
- Tangle a single block
      |--------+------------------+---------------------------|
      | tangle | expected result  | current                   |
      |--------+------------------+---------------------------|
      | yes    | ?                | dir/[org-folder/org-file] |
      | no     | error?           | dir (as file or folder)   |
      | file   | tangle to TD+dir | tangle to TD+dir          |
      |--------+------------------+---------------------------|

Cheers,

Phil

Attachment: 0001-add-header-arg-tangle-directory.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]