Skip to main content

I recommend using the builtin org-mode :noweb-ref:noweb-ref header to concatenate the code blocks because doing so will resolve the block tangling issue and will allow more flexibility in the future.

  • Updated Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 2 #+BEGIN_SRC clojure :noweb-ref configs (println "world") #+END_SRC 
  • Tangling the code with C-c C-v C-t produces:

     (println "hello") (println "world") 

As new sections are added, deleted, moved, or updated, tangling the code should always produce the code in the order expected:

  • Future Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "Howdy") #+END_SRC ** config 2 - Updated #+BEGIN_SRC clojure :noweb-ref configs (println "World") #+END_SRC ** config 1 - Moved #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 4 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "earth") #+END_SRC 
  • Future Tangle

     (println "Howdy") (println "World") (println "hello") (println "earth") 

Hope that helped.


This code was tested using:
GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10)
Org mode version 9.1.2

I recommend using the builtin org-mode :noweb-ref header to concatenate the code blocks because doing so will resolve the block tangling issue and will allow more flexibility in the future.

  • Updated Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 2 #+BEGIN_SRC clojure :noweb-ref configs (println "world") #+END_SRC 
  • Tangling the code with C-c C-v C-t produces:

     (println "hello") (println "world") 

As new sections are added, deleted, moved, or updated, tangling the code should always produce the code in the order expected:

  • Future Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "Howdy") #+END_SRC ** config 2 - Updated #+BEGIN_SRC clojure :noweb-ref configs (println "World") #+END_SRC ** config 1 - Moved #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 4 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "earth") #+END_SRC 
  • Future Tangle

     (println "Howdy") (println "World") (println "hello") (println "earth") 

Hope that helped.


This code was tested using:
GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10)
Org mode version 9.1.2

I recommend using the builtin org-mode :noweb-ref header to concatenate the code blocks because doing so will resolve the block tangling issue and will allow more flexibility in the future.

  • Updated Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 2 #+BEGIN_SRC clojure :noweb-ref configs (println "world") #+END_SRC 
  • Tangling the code with C-c C-v C-t produces:

     (println "hello") (println "world") 

As new sections are added, deleted, moved, or updated, tangling the code should always produce the code in the order expected:

  • Future Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "Howdy") #+END_SRC ** config 2 - Updated #+BEGIN_SRC clojure :noweb-ref configs (println "World") #+END_SRC ** config 1 - Moved #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 4 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "earth") #+END_SRC 
  • Future Tangle

     (println "Howdy") (println "World") (println "hello") (println "earth") 

Hope that helped.


This code was tested using:
GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10)
Org mode version 9.1.2

Source Link
Melioratus
  • 4.9k
  • 1
  • 28
  • 49

I recommend using the builtin org-mode :noweb-ref header to concatenate the code blocks because doing so will resolve the block tangling issue and will allow more flexibility in the future.

  • Updated Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 2 #+BEGIN_SRC clojure :noweb-ref configs (println "world") #+END_SRC 
  • Tangling the code with C-c C-v C-t produces:

     (println "hello") (println "world") 

As new sections are added, deleted, moved, or updated, tangling the code should always produce the code in the order expected:

  • Future Code

     * config file #+BEGIN_SRC clojure :noweb yes :exports none :mkdirp yes :tangle data/code/tangle-append-test.clj <<configs>> #+END_SRC ** config 1 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "Howdy") #+END_SRC ** config 2 - Updated #+BEGIN_SRC clojure :noweb-ref configs (println "World") #+END_SRC ** config 1 - Moved #+BEGIN_SRC clojure :noweb-ref configs (println "hello") #+END_SRC ** config 4 - Added #+BEGIN_SRC clojure :noweb-ref configs (println "earth") #+END_SRC 
  • Future Tangle

     (println "Howdy") (println "World") (println "hello") (println "earth") 

Hope that helped.


This code was tested using:
GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10)
Org mode version 9.1.2