Browse Source

Merge branch 'maint'

Nicolas Goaziou 7 years ago
parent
commit
3056abe781
2 changed files with 10 additions and 2 deletions
  1. 2 2
      lisp/ox-publish.el
  2. 8 0
      testing/lisp/test-ox-publish.el

+ 2 - 2
lisp/ox-publish.el

@@ -435,8 +435,8 @@ This splices all the components into the list."
   (let* ((base-dir (file-name-as-directory
 		    (org-publish-property :base-directory project)))
 	 (extension (or (org-publish-property :base-extension project) "org"))
-	 (match (and (not (eq extension 'any))
-		     (concat "^[^\\.].*\\.\\(" extension "\\)$")))
+	 (match (if (eq extension 'any) ""
+		  (format "^[^\\.].*\\.\\(%s\\)$" extension)))
 	 (base-files
 	  (cl-remove-if #'file-directory-p
 			(if (org-publish-property :recursive project)

+ 8 - 0
testing/lisp/test-ox-publish.el

@@ -455,6 +455,14 @@ Unless set otherwise in PROPERTIES, `:base-directory' is set to
 	  (org-publish-project-alist
 	   `(("p" :base-directory ,base :base-extension any))))
      (org-publish-get-project-from-filename file)))
+  ;; Pathological case: Handle both :extension any and :recursive t.
+  (should
+   (let* ((base (expand-file-name "examples/pub/" org-test-dir))
+	  (file (expand-file-name "sub/c.org" base))
+	  (org-publish-project-alist
+	   `(("p" :base-directory ,base :recursive t :base-extension any))))
+     (org-publish-get-base-files (org-publish-get-project-from-filename file))))
+
   ;; Check :exclude property.
   (should-not
    (let* ((base (expand-file-name "examples/pub/" org-test-dir))