emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] RFE: Including src-blocks from different files when tangling the code [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)]
@ 2023-04-22 19:38 Garid Z.
  2023-04-23 11:02 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Garid Z. @ 2023-04-22 19:38 UTC (permalink / raw)
  To: emacs-orgmode


I have following Request for Enhancement: Write src-block in separate
org-file(s), and when time comes to tangle use all those src-blocks
using some sort of reference.

In other words, take a look at following an example:

--------------------------------------------------------------------

    * This is ~/tmp/1.org~ file:

    #+name: code_block_in_1_org
    #+begin_src python :noweb yes
    import pandas as pd
    #+end_src

--------------------------------------------------------------------

    #+INCLUDE: "/tmp/1.org"           

    * This is the ~/tmp/2.org~ file
    #+caption: Local Code Block
    #+name: code_block_local
    #+begin_src python :noweb yes
    import numpy as np
    #+end_src

    #+caption: The Final Code Block
    #+name: the_final_code_block
    #+begin_src python :results output :tangle output.py :noweb yes
    <<code_block_in_1_org>>      # referencing from 1.org
    <<code_block_local>>         # referencing from within 2.org
    #+end_src

--------------------------------------------------------------------

The file ~/tmp/1.org~ contain src-block (~code_block_in_1_org~)
which is needed in block (~the_final_code_block~) of ~/tmp/2.org~
to tangle:
 - When ~/tmp/2.org~ exported to PDF via LaTeX, ~the_final_code_block~
 does contain part of code from ~code_block_in_1_org~
 - When ~/tmp/2.org~ tangled, ~the_final_code_block~
 does NOT contain part of code from ~code_block_in_1_org~

For consistency with PDF-export and file(s) management reasons,
I feel like it would be neat/cool have this feature to
spread src-blocks to different org-files.

Please take this RFE with a grain of salt, since I'm not that well
skilled/experienced person. And, I'm not even sure this spreading
src-blocks all over the places/files will be beneficial to overall
literate programming paradigm. Just for my small case, it felt
beneficial.

Please share your opinions on this, I will be  happy hear about it.

Best,
Garid Zorigoo.



Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6)
 of 2023-01-03
Package: Org mode version 9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)
-- 
Garid Z.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] RFE: Including src-blocks from different files when tangling the code [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)]
  2023-04-22 19:38 [BUG] RFE: Including src-blocks from different files when tangling the code [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)] Garid Z.
@ 2023-04-23 11:02 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2023-04-23 11:02 UTC (permalink / raw)
  To: Garid Z.; +Cc: emacs-orgmode

"Garid Z." <garidzorigoo@gmail.com> writes:

> I have following Request for Enhancement: Write src-block in separate
> org-file(s), and when time comes to tangle use all those src-blocks
> using some sort of reference.

See 16.12 Library of Babel section of Org manual.

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-23 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-22 19:38 [BUG] RFE: Including src-blocks from different files when tangling the code [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)] Garid Z.
2023-04-23 11:02 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).