From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: [PATCH 1/2] org-odt: Improve customization of org-export-odt-styles-file Date: Fri, 22 Jul 2011 20:08:32 +0530 Message-ID: <81wrfafkif.fsf_-_@gmail.com> References: <817h7mce7q.fsf@gmail.com> <81oc0yaqes.fsf@gmail.com> <4E1E91D3.70800@diplan.de> <87wrfkx3wo.fsf@gnu.org> <81oc0w9jie.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkGsS-0003Hd-LZ for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkGsR-00081b-At for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:38:56 -0400 Received: from mail-pz0-f49.google.com ([209.85.210.49]:64412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkGsR-00081W-0o for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:38:55 -0400 Received: by pzk33 with SMTP id 33so3200344pzk.8 for ; Fri, 22 Jul 2011 07:38:53 -0700 (PDT) In-Reply-To: <81oc0w9jie.fsf@gmail.com> (Jambunathan K.'s message of "Fri, 15 Jul 2011 11:24:01 +0530") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain > I am seeing that customization interface for org-export-odt-styles-file > variable is only partially done. If the customization interface doesn't > do the right thing for you, you can use the setq form temporarily. The attached patch takes care of the above "issue". --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-org-odt-Improve-customization-of-org-export-odt-styl.patch Content-Description: 0001-org-odt-Improve-customization-of-org-export-odt-styl.patch >From fe6cc741850cdfca4bd9577430f744208957e3eb Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 22 Jul 2011 16:37:33 +0530 Subject: [PATCH 1/2] org-odt: Improve customization of org-export-odt-styles-file * contrib/lisp/org-odt.el (org-odt-data-dir) (org-export-odt-automatic-styles-file): Update docstring. (org-export-odt-use-bookmarks-for-internal-links): Update docstring. Improve customization interface. --- contrib/lisp/org-odt.el | 60 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 47 insertions(+), 13 deletions(-) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index ea4e32b..c1c5b7f 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -73,7 +73,16 @@ (cond ((file-directory-p dir1) dir1) ((file-directory-p dir2) dir2) - (t (error "Cannot find factory styles file. Check package dir layout"))))) + (t (error "Cannot find factory styles file. Check package dir layout")))) + "Directory that holds auxiliary files used by the ODT exporter. + +The 'styles' subdir contains the following xml files - + 'OrgOdtStyles.xml' and 'OrgOdtAutomaticStyles.xml' - which are + used as factory settings of `org-export-odt-styles-file' and + `org-export-odt-automatic-styles-file'. + +The 'etc/schema' subdir contains rnc files for validating of +OpenDocument xml files.") (defvar org-odt-file-extensions '(("odt" . "OpenDocument Text") @@ -135,22 +144,47 @@ (org-lparse-register-backend 'odt) (defcustom org-export-odt-automatic-styles-file nil - "Default style file for use with ODT exporter." + "Automatic styles for use with ODT exporter. +If unspecified, the file under `org-odt-data-dir' is used." :type 'file :group 'org-export-odt) -;; TODO: Make configuration user-friendly. (defcustom org-export-odt-styles-file nil - "Default style file for use with ODT exporter. -Valid values are path to an styles.xml file or a path to a valid -*.odt or a *.ott file or a list of the form (FILE (MEMBER1 -MEMBER2 ...)). In the last case, the specified FILE is unzipped -and MEMBER1, MEMBER2 etc are copied in to the generated odt -file. The last form is particularly useful if the styles.xml has -reference to additional files like header and footer images. -" - :type 'file - :group 'org-export-odt) + "Default styles file for use with ODT export. +Valid values are one of: +1. nil +2. path to a styles.xml file +3. path to a *.odt or a *.ott file +4. list of the form (ODT-OR-OTT-FILE (FILE-MEMBER-1 FILE-MEMBER-2 +...)) + +In case of option 1, an in-built styles.xml is used. See +`org-odt-data-dir' for more information. + +In case of option 3, the specified file is unzipped and the +styles.xml embedded therein is used. + +In case of option 4, the specified ODT-OR-OTT-FILE is unzipped +and FILE-MEMBER-1, FILE-MEMBER-2 etc are copied in to the +generated odt file. Use relative path for specifying the +FILE-MEMBERS. styles.xml must be specified as one of the +FILE-MEMBERS. + +Use options 1, 2 or 3 only if styles.xml alone suffices for +achieving the desired formatting. Use option 4, if the styles.xml +references additional files like header and footer images for +achieving the desired formattting." + :group 'org-export-odt + :type + '(choice + (const :tag "Factory settings" nil) + (file :must-match t :tag "styles.xml") + (file :must-match t :tag "ODT or OTT file") + (list :tag "ODT or OTT file + Members" + (file :must-match t :tag "ODF Text or Text Template file") + (cons :tag "Members" + (file :tag " Member" "styles.xml") + (repeat (file :tag "Member")))))) (defconst org-export-odt-tmpdir-prefix "odt-") (defconst org-export-odt-bookmark-prefix "OrgXref.") -- 1.7.2.3 --=-=-=--