emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 1/2] test INCLUDE pathname expansion with subdirectories


From: Richard Hansen
Subject: [O] [PATCH 1/2] test INCLUDE pathname expansion with subdirectories
Date: Thu, 24 Sep 2015 18:20:40 -0400

* lisp/test-ox.el (test-org-export/expand-include): Modify the
INCLUDE test to ensure that a.org including subdir/b.org including
c.org causes subdir/c.org to be read, not c.org.

TINYCHANGE
---
 testing/examples/include.org                    | 2 +-
 testing/examples/{include2.org => include3.org} | 0
 testing/examples/subdir/include2.org            | 1 +
 testing/lisp/test-ox.el                         | 8 ++++----
 4 files changed, 6 insertions(+), 5 deletions(-)
 rename testing/examples/{include2.org => include3.org} (100%)
 create mode 100644 testing/examples/subdir/include2.org

diff --git a/testing/examples/include.org b/testing/examples/include.org
index f4dcc20..7122716 100644
--- a/testing/examples/include.org
+++ b/testing/examples/include.org
@@ -4,7 +4,7 @@ Small Org file with an include keyword.
 (+ 2 1)
 #+END_SRC
 
-#+INCLUDE: "include2.org"
+#+INCLUDE: "subdir/include2.org"
 
 * Heading
 body
diff --git a/testing/examples/include2.org b/testing/examples/include3.org
similarity index 100%
rename from testing/examples/include2.org
rename to testing/examples/include3.org
diff --git a/testing/examples/subdir/include2.org 
b/testing/examples/subdir/include2.org
new file mode 100644
index 0000000..68df86e
--- /dev/null
+++ b/testing/examples/subdir/include2.org
@@ -0,0 +1 @@
+#+INCLUDE: "../include3.org"
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index ccffa89..1af5c21 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -925,7 +925,7 @@ text
       (insert-file
        (expand-file-name "examples/include.org" org-test-dir))
       (replace-regexp-in-string
-       (regexp-quote "#+INCLUDE: \"include2.org\"")
+       (regexp-quote "#+INCLUDE: \"subdir/include2.org\"")
        "Success!" (buffer-string)))
     (org-test-with-temp-text
        (format "#+INCLUDE: \"%s/examples/include.org\"" org-test-dir)
@@ -992,7 +992,7 @@ text
     "#+BEGIN_CENTER\nSuccess!\n#+END_CENTER\n"
     (org-test-with-temp-text
        (format
-        "#+INCLUDE: \"%s/examples/include2.org\" CENTER"
+        "#+INCLUDE: \"%s/examples/include3.org\" CENTER"
         org-test-dir)
       (org-export-expand-include-keyword)
       (buffer-string))))
@@ -1132,11 +1132,11 @@ Footnotes[fn:2], foot[fn:test], digit only[3], and 
[fn:inline:anonymous footnote
   (should-not
    (equal
     (org-test-with-temp-text
-       (format "#+INCLUDE: \"%s/examples/include2.org\" src emacs-lisp" 
org-test-dir)
+       (format "#+INCLUDE: \"%s/examples/include3.org\" src emacs-lisp" 
org-test-dir)
       (org-export-expand-include-keyword)
       (buffer-string))
     (org-test-with-temp-text
-       (format "#+INCLUDE: \"%s/examples/include2.org\" src emacs-lisp 
:minlevel 1" org-test-dir)
+       (format "#+INCLUDE: \"%s/examples/include3.org\" src emacs-lisp 
:minlevel 1" org-test-dir)
       (org-export-expand-include-keyword)
       (buffer-string))))
   ;; INCLUDE assigns the relative :minlevel conditional on narrowing.
-- 
2.5.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]