summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJambunathan K <kjambunathan@gmail.com>2012-05-24 21:41:38 +0530
committerJambunathan K <kjambunathan@gmail.com>2012-05-24 21:41:38 +0530
commit1e811161c5006e92dc4df9f1c192be1c206e0a8b (patch)
tree5c2e879621c047ddb37b3910b3a7f52283be129c
parent141d0fd24bbad52065e41ba7692f53710f627e73 (diff)
downloadorg-mode-1e811161c5006e92dc4df9f1c192be1c206e0a8b.tar.gz
org-odt.el: Fix corruption due to multiple XML declarations
* lisp/org-odt.el (org-odt-init-outfile) (org-odt-write-manifest-file): Disable `nxml-auto-insert-xml-declaration-flag'. * lisp/org-lparse.el (org-do-lparse): Don't trigger auto-mode processing. Guard against insertion of multiple XML declarations within component XML files when `nxml-auto-insert-xml-declaration-flag' is on. Fixes bug http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00510.html.
-rw-r--r--lisp/org-lparse.el3
-rw-r--r--lisp/org-odt.el7
2 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-lparse.el b/lisp/org-lparse.el
index c9669dd..9c3cd5b 100644
--- a/lisp/org-lparse.el
+++ b/lisp/org-lparse.el
@@ -1111,9 +1111,6 @@ version."
(unless body-only
(org-lparse-end 'DOCUMENT-CONTENT))
- (unless (plist-get opt-plist :buffer-will-be-killed)
- (set-auto-mode t))
-
(org-lparse-end 'EXPORT)
;; kill collection buffer
diff --git a/lisp/org-odt.el b/lisp/org-odt.el
index 2e984a5..8475eaa 100644
--- a/lisp/org-odt.el
+++ b/lisp/org-odt.el
@@ -2211,7 +2211,9 @@ captions on export.")
(content-file (expand-file-name "content.xml" outdir)))
;; init conten.xml
- (with-current-buffer (find-file-noselect content-file t))
+ (with-current-buffer
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect content-file t)))
;; reset variables
(setq org-odt-manifest-file-entries nil
@@ -2320,7 +2322,8 @@ visually."
(make-directory "META-INF")
(let ((manifest-file (expand-file-name "META-INF/manifest.xml")))
(with-current-buffer
- (find-file-noselect manifest-file t)
+ (let ((nxml-auto-insert-xml-declaration-flag nil))
+ (find-file-noselect manifest-file t))
(insert
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\" manifest:version=\"1.2\">\n")