commit baae11d38ccf71d835c68b25dec88311f26625b4 (patch)
parent ff99056ba Makefile (PKG_FILES) : Include etc/
tree 6acc1aab71271fcb1302f6917f0ca7ddacd9d3dd
author Jambunathan K <kjambunathan@gmail.com> 2011-12-11 00:48:20 +0530
committer Jambunathan K <kjambunathan@gmail.com> 2011-12-11 02:04:28 +0530
org-odt.el (org-export-odt-schema-dir): Modified
---
lisp/org-odt.el | 63 +++++++++++++++++++++++++--------------------------------
1 file changed, 28 insertions(+), 35 deletions(-)
diff --git a/lisp/org-odt.el b/lisp/org-odt.el
index 553965cd3..179c4d908 100644
--- a/lisp/org-odt.el
+++ b/lisp/org-odt.el
@@ -100,7 +100,7 @@ This directory contains the following XML files -
`org-export-odt-styles-file' and
`org-export-odt-content-template-file'.")
-(defconst org-export-odt-schema-dir
+(defcustom org-export-odt-schema-dir
(let ((schema-dir (expand-file-name
"../contrib/odt/etc/schema/" org-odt-lib-dir)))
(if (and (file-readable-p
@@ -116,7 +116,32 @@ This directory contains the following XML files -
This directory contains rnc files for OpenDocument schema. It
also contains a \"schemas.xml\" that can be added to
`rng-schema-locating-files' for auto validation of OpenDocument
-XML files. See also `rng-nxml-auto-validate-flag'.")
+XML files. See also `rng-nxml-auto-validate-flag'."
+ :type '(choice
+ (const :tag "Not set" nil)
+ (directory :tag "Schema directory"))
+ :group 'org-export-odt
+ :set
+ (lambda (var value)
+ "Set `org-export-odt-schema-dir'.
+Also add it to `rng-schema-locating-files'."
+ (let ((schema-dir value))
+ (set var
+ (if (and
+ (file-readable-p
+ (expand-file-name "od-manifest-schema-v1.2-cs01.rnc" schema-dir))
+ (file-readable-p
+ (expand-file-name "od-schema-v1.2-cs01.rnc" schema-dir))
+ (file-readable-p
+ (expand-file-name "schemas.xml" schema-dir)))
+ schema-dir
+ (prog1 nil
+ (message "Warning (org-odt): Unable to locate OpenDocument schema files.")))))
+ (when org-export-odt-schema-dir
+ (eval-after-load 'rng-loc
+ '(add-to-list 'rng-schema-locating-files
+ (expand-file-name "schemas.xml"
+ org-export-odt-schema-dir))))))
(defvar org-odt-file-extensions
'(("odt" . "OpenDocument Text")
@@ -130,32 +155,7 @@ XML files. See also `rng-nxml-auto-validate-flag'.")
("otp" . "OpenDocument Presentation Template")
("odi" . "OpenDocument Image")
("odf" . "OpenDocument Formula")
- ("odc" . "OpenDocument Chart")
- ("doc" . "Microsoft Text")
- ("docx" . "Microsoft Text")
- ("xls" . "Microsoft Spreadsheet")
- ("xlsx" . "Microsoft Spreadsheet")
- ("ppt" . "Microsoft Presentation")
- ("pptx" . "Microsoft Presentation")))
-
-(defvar org-odt-ms-file-extensions
- '(("doc" . "Microsoft Text")
- ("docx" . "Microsoft Text")
- ("xls" . "Microsoft Spreadsheet")
- ("xlsx" . "Microsoft Spreadsheet")
- ("ppt" . "Microsoft Presentation")
- ("pptx" . "Microsoft Presentation")))
-
-;; RelaxNG validation of OpenDocument xml files
-(eval-after-load 'rng-nxml
- '(when org-export-odt-schema-dir
- (setq rng-nxml-auto-validate-flag t)))
-
-(eval-after-load 'rng-loc
- '(when org-export-odt-schema-dir
- (add-to-list 'rng-schema-locating-files
- (expand-file-name "schemas.xml"
- org-export-odt-schema-dir))))
+ ("odc" . "OpenDocument Chart")))
(mapc
(lambda (desc)
@@ -167,13 +167,6 @@ XML files. See also `rng-nxml-auto-validate-flag'.")
(cons (concat "\\." (car desc) "\\'") 'archive-mode)))
org-odt-file-extensions)
-(mapc
- (lambda (desc)
- ;; Let Org open all Microsoft files using system-registered app
- (add-to-list 'org-file-apps
- (cons (concat "\\." (car desc) "\\'") 'system)))
- org-odt-ms-file-extensions)
-
;; register the odt exporter with the pre-processor
(add-to-list 'org-export-backends 'odt)
glossary
--------
Commit objects reference one tree, and zero or more parents.
Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.
Multiple parents means the commit is a merge.
Root commits have no ancestor. Note that it is
possible to have multiple root commits when merging independent histories.
Every commit references one top-level tree object.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).