Browse Source

Merge branch 'maint'

Bastien Guerry 5 years ago
parent
commit
1700ea7722
2 changed files with 16 additions and 9 deletions
  1. 9 6
      contrib/lisp/org-e-odt.el
  2. 7 3
      lisp/org-odt.el

+ 9 - 6
contrib/lisp/org-e-odt.el

@@ -126,9 +126,12 @@
 (defconst org-e-odt-styles-dir
   (let* ((d (expand-file-name (org-find-library-dir "org-e-odt.el")))
 	 (styles-dir-list (list
-			   (concat d "../../etc/styles/") ;; Git
-			   (concat d "../../etc/org/")    ;; system
-			   (concat d "../etc/org/")))     ;; ELPA org-plus
+			   (concat d "etc/styles/") ;; ELPA and Git
+			   (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
@@ -142,8 +145,8 @@
 					"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")))
   "Directory that holds auxiliary XML files used by the ODT exporter.
 
 This directory contains the following XML files -
@@ -1785,7 +1788,7 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 
 ;;;; Latex Environment
 
-(eval-after-load 'org-e-odt
+(eval-after-load 'org-odt
   '(ad-deactivate 'org-format-latex-as-mathml))
 
 ;; (defadvice org-format-latex-as-mathml	; FIXME

+ 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 -