From d6f45b6048d39fe8a155081250b25476e441d91a Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sun, 1 May 2011 23:25:57 +0530 Subject: [PATCH] org-odt.el: Kill styles.xml buffer before exiting. * lisp/org-odt.el (org-export-odt-save-list): Add styles.xml to list of buffers that need to be saved and eventually killed. (org-export-odt-nosave-list): Removed styles.xml from the list. (org-odt-save-as-outfile): Inhibit creation of backup styles.xml file. Refer the inline note in the source file for further information. --- lisp/org-odt.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 lisp/org-odt.el diff --git a/lisp/org-odt.el b/lisp/org-odt.el old mode 100644 new mode 100755 index 3e1a5806d..43885acb9 --- a/lisp/org-odt.el +++ b/lisp/org-odt.el @@ -1038,10 +1038,10 @@ MAY-INLINE-P allows inlining it as an image." ;; xml files generated on-the-fly (defconst org-export-odt-save-list - '("META-INF/manifest.xml" "content.xml" "meta.xml")) + '("META-INF/manifest.xml" "content.xml" "meta.xml" "styles.xml")) ;; xml files that are copied -(defconst org-export-odt-nosave-list '("styles.xml")) +(defconst org-export-odt-nosave-list '()) ;; xml files that contribute to the final odt file (defvar org-export-odt-file-list nil) @@ -1230,6 +1230,16 @@ MAY-INLINE-P allows inlining it as an image." ;; Update styles.xml - take care of outline numbering (with-current-buffer (find-file-noselect "styles.xml" (file-name-directory buffer-file-name)) + ;; Don't make automatic backup of styles.xml file. This setting + ;; prevents the backedup styles.xml file from being zipped in to + ;; odt file. This is more of a hackish fix. Better alternative + ;; would be to fix the zip command so that the output odt file + ;; includes only the needed files and excludes any auto-generated + ;; extra files like backups and auto-saves etc etc. Note that + ;; currently the zip command zips up the entire temp directory so + ;; that any auto-generated files created under the hood ends up in + ;; the resulting odt file. + (set (make-local-variable 'backup-inhibited) t) ;; Import local setting of `org-export-with-section-numbers' (org-html-bind-local-variables opt-plist) -- 2.11.4.GIT