emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Garid Z." <garidzorigoo@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [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/)]
Date: Sun, 23 Apr 2023 04:38:26 +0900	[thread overview]
Message-ID: <87cz3vhfm5.fsf@gmail.com> (raw)


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.


             reply	other threads:[~2023-04-22 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22 19:38 Garid Z. [this message]
2023-04-23 11:02 ` [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/)] Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cz3vhfm5.fsf@gmail.com \
    --to=garidzorigoo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).