From b4f072f9bb1e2c7ca75484d8ec269437dd04ff74 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 27 Jun 2009 12:43:47 -0700 Subject: [PATCH] moving around tangle test files --- org-tangle-integration/README.txt | 3 - org-tangle-integration/article | 114 ------------------ org-tangle-integration/file1.sh | 9 -- .../test.org => test-tangle.org | 18 ++- 4 files changed, 7 insertions(+), 137 deletions(-) delete mode 100644 org-tangle-integration/README.txt delete mode 100644 org-tangle-integration/article delete mode 100644 org-tangle-integration/file1.sh rename org-tangle-integration/test.org => test-tangle.org (67%) diff --git a/org-tangle-integration/README.txt b/org-tangle-integration/README.txt deleted file mode 100644 index 505f2c94c..000000000 --- a/org-tangle-integration/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -text line 1 -text line 2 -text line 3 diff --git a/org-tangle-integration/article b/org-tangle-integration/article deleted file mode 100644 index 253867084..000000000 --- a/org-tangle-integration/article +++ /dev/null @@ -1,114 +0,0 @@ -From: "Eric H. Neilsen, Jr." -Subject: [Orgmode] A tool for creating source code files from example and src blocks in org files -To: emacs-orgmode@gnu.org -Date: Tue, 02 Jun 2009 13:50:58 -0500 - -Hi, - -First, thank you Carsten and others, for putting this thing together; -org-mode is the most useful tool I've run across in a long time. - -I recently put together a few commands to create source code files -from SRC and EXAMPLE blocks in org-mode files. The original idea is to -be able to compile examples in my notes without needing to merge them -into a separate source file by hand. As I was writing it I realized -this is exactly the same tool one needs to turn org-mode into a -literate programming tool (see http://www.literateprogramming.com/ ), -so I adopted some of the nomenclature. (I tried literate programming a -few years ago, and gave up in frustration with the tools. I am tempted -to try again with org-mode.) - -The two user level commands are org-tangle and org-untangle, best -explained through example. Running org-tangle in a buffer that looks -like this: - ----------------------- begin /tmp/test.org --------------------------- -* Some file - -Some text here - -#+CHUNK file1.sh 1 -#+BEGIN_SRC bash -echo "line 1" -echo "line 2" -#+END_SRC - -more text - -** Some subsection - -#+CHUNK file1.sh 2 -#+BEGIN_SRC bash -echo "line 5" -echo "line 6" -#+END_SRC - -blah blah blah - -#+CHUNK README.txt 1 -#+BEGIN_EXAMPLE -text line 1 -text line 2 -text line 3 -#+END_EXAMPLE - -foo foo bar baz - -#+CHUNK file1.sh 1.5 -#+BEGIN_SRC bash -echo "line 3" -echo "line 4" -#+END_SRC --------------- end /tmp/test.org ---------------- - -results in the creation of these two files, opened in emacs buffers: - -------------- begin /tmp/file1.sh ---------------- -# ORGCHUNK /tmp/test.org 1 -echo "line 1" -echo "line 2" -# ORGCHUNK /tmp/test.org 1.5 -echo "line 3" -echo "line 4" -# ORGCHUNK /tmp/test.org 2 -echo "line 5" -echo "line 6" -------------- end /tmp/file1.sh --------------------- - -and - ------------- begin /tmp/README.txt ------------- -text line 1 -text line 2 -text line 3 ------------- end /tmp/README.txt --------------- - -If you then edit file1.sh and run org-untangle in the buffer, changes -to it will overwrite the literal blocks in the org-mode file from -whence they came. - -Is there any interest in this? My organization's rules for releasing -code to open source projects are being revised, but I am likely to be -able to do so under a BSD-like license. If there is interest, I will -push to try and figure out how to do this, and maybe even see if I can -do the assignment of copyright stuff needed for it to get under the -main umbrella (although I am not optimistic). - -(If anyone feels like rewriting it, that would be even better; aside -from a fairly straightforward .emacs, this is my first ever lisp code, -so it is likely to need cleaning and refactoring.) - - -Eric - --- -Eric H. Neilsen, Jr. -http://home.fnal.gov/~neilsen - - - -_______________________________________________ -Emacs-orgmode mailing list -Remember: use `Reply All' to send replies to the list. -Emacs-orgmode@gnu.org -http://lists.gnu.org/mailman/listinfo/emacs-orgmode - diff --git a/org-tangle-integration/file1.sh b/org-tangle-integration/file1.sh deleted file mode 100644 index 6ebd76862..000000000 --- a/org-tangle-integration/file1.sh +++ /dev/null @@ -1,9 +0,0 @@ -# ORGCHUNK /tmp/test.org 1 -echo "line 1" -echo "line 2" -# ORGCHUNK /tmp/test.org 1.5 -echo "line 3" -echo "line 4" -# ORGCHUNK /tmp/test.org 2 -echo "line 5" -echo "line 6" diff --git a/org-tangle-integration/test.org b/test-tangle.org similarity index 67% rename from org-tangle-integration/test.org rename to test-tangle.org index ad9b15383..2770f3f64 100644 --- a/org-tangle-integration/test.org +++ b/test-tangle.org @@ -2,8 +2,7 @@ Some text here -#+CHUNK file1.sh 1 -#+BEGIN_SRC bash +#+BEGIN_SRC sh echo "line 1" echo "line 2" #+END_SRC @@ -12,15 +11,13 @@ more text ** Some subsection -#+CHUNK file1.sh 2 -#+BEGIN_SRC bash -echo "line 5" -echo "line 6" +#+BEGIN_SRC sh +echo "line 3" +echo "line 4" #+END_SRC blah blah blah -#+CHUNK README.txt 1 #+BEGIN_EXAMPLE text line 1 text line 2 @@ -29,8 +26,7 @@ text line 3 foo foo bar baz -#+CHUNK file1.sh 1.5 -#+BEGIN_SRC bash -echo "line 3" -echo "line 4" +#+BEGIN_SRC sh +echo "line 5" +echo "line 6" #+END_SRC