Browse Source

org-odt.el (org-odt-styles-dir): Try more directories

* org-odt.el (org-odt-styles-dir): Try more directories.
Don't throw an error, just send a message.

Thanks to Nick Dokos for reporting this.
Bastien Guerry 5 years ago
parent
commit
fc8ad1347e
1 changed files with 7 additions and 3 deletions
  1. 7 3
      lisp/org-odt.el

+ 7 - 3
lisp/org-odt.el

@@ -150,7 +150,11 @@ Also add it to `rng-schema-locating-files'."
   (let* ((d (expand-file-name "../" (org-find-library-dir "org-odt.el")))
 	 (styles-dir-list (list
 			   (concat d "etc/styles/") ;; ELPA and Git
-			   (concat d "etc/org/")))
+			   (concat d "etc/org/")    ;; Org from Emacs
+			   (concat d "../"
+				   (number-to-string emacs-major-version) "."
+				   (number-to-string emacs-minor-version) "/etc/org/")
+			   (concat data-directory "org/"))) ;; Custom install
 	 styles-dir)
     (setq styles-dir
 	  (car
@@ -164,8 +168,8 @@ Also add it to `rng-schema-locating-files'."
 					"OrgOdtStyles.xml" sd)))
 			     sd))
 			 styles-dir-list))))
-    (or styles-dir
-	(error "Cannot find factory styles files for Org ODT, aborting")))
+    (or (expand-file-name styles-dir)
+	(message "Cannot find factory styles files for Org ODT, aborting")))
   "Directory that holds auxiliary XML files used by the ODT exporter.
 
 This directory contains the following XML files -