emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tangle Source Block Only to a Specific Location/Target in a File
@ 2022-03-04 22:50 zacque
  0 siblings, 0 replies; only message in thread
From: zacque @ 2022-03-04 22:50 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I want to tangle a source block only to a specific location in a file, without modifying the rest of its content. E.g. given this source block:

#+begin_src emacs-lisp :noweb yes :tangle /path/to/foo :target-name <<target_name>>
(+ 1 2 3)
(print "Hello, world")
<<others>>
#+end_src

Upon tangled, the "foo" contents will change from this:

#+begin_src emacs-lisp
...
(with-eval-after-load 'bar
  ...
  ;; BEGIN RECEIVE ORGSRC <<target_name>>
  ;; END RECEIVE ORGSRC <<target_name>>
  ...)
...
#+end_src

to

#+begin_src emacs-lisp
...
(with-eval-after-load 'bar
  ...
  ;; BEGIN RECEIVE ORGSRC <<target_name>>
  (+ 1 2 3)
  (print "Hello, world")
  <<expanded_others>>
  ;; END RECEIVE ORGSRC <<target_name>>
  ...)
...
#+end_src

Note: The target syntax in the target file imitates the syntax for receiving
radio tables on purpose.

Is there any idea how I can achieve this?

-- 
Cheers,
zacque


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-05  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-04 22:50 Tangle Source Block Only to a Specific Location/Target in a File zacque

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).