* lisp/org-odt.el (org-odt-format-preamble): Don't insert TOC here.
Delay it till the end of export.
(org-odt-begin-document-body): Make a note of the default
position of TOC in `org-lparse-dyn-first-heading-pos'.
(org-odt-insert-toc): Insert TOC as directed by
[TABLE-OF-CONTENTS] line or at the default position.
(org-odt-end-export): Call `org-odt-insert-toc'.
Fix for the following bug:
http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00974.html
* etc/styles/OrgOdtContentTemplate.xml
(OrgIndentedSection-Level-*): New section styles. These
sections are indented to the same level as the corresponding
list entries. These sections hold tables that occur within a
list.
(OrgTable): Increased relative width from 90% to 96% for
aesthetic reasons.
* lisp/org-odt.el (org-odt-table-indentedp): New variable
(org-odt-begin-table): Modified. If the table is within a
list, temporarily leave the list and begin an indented section
before emitting the table.
(org-odt-end-table): Modified. If the table was within a
list, close the indented section and re-open the list
immediately after ending the table.
(org-odt-continue-list, org-odt-discontinue-list): Helper
routines to temporarily discontinue and continue a list.
(org-odt-list-stack-stashed): New variable to hold the state
of a pending list.
(org-odt-begin-list, org-odt-begin-list-item)
(org-odt-end-list-item): Modified. Handle nitty-gritties for
continuing a list and list item.
(org-odt-section-count): New variable that keeps track of
section count. Used in conjunction with naming of sections.
(org-odt-begin-section, org-odt-end-section): New defuns.
(org-odt-init-outfile): Initialize
`org-odt-list-stack-stashed' and `org-odt-section-count'.
* lisp/org-lparse.el (org-lparse-list-item-count): Removed. Was a
superfluous variable.
(org-lparse-list-level): Removed. Now derived from
`org-lparse-list-stack'.
(org-lparse-list-stack): New. List that records the list
types - ordered, unordered or descriptive - in the following
order: self, parent, grand-parent etc.
(org-do-lparse): Added, removed above let-bound vars.
Disallowed regular tables within list-table block.
(org-lparse-begin-list, org-lparse-end-list)
(org-lparse-begin-list-item, org-lparse-end-list-item):
Propagate above changes.
OpenDocument doesn't permit tables to occur in the middle of a
list. Use list continuations and indented sections to typeset
indented tables.
Fixes the following bug:
http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00515.html
Initialize`org-export-odt-schema-dir' *before* initializing
`org-odt-styles-dir'. This re-arrangement prevents the warning message that
notifies the user of missing OpenDocument schema files not lurk around in
the echo area like a sore-thumb.
* org-odt.el (org-odt-lib-dir): Add docstring.
(org-odt-data-dir): New variable. Use this variable to
control the locations from which the ODT exporter picks the
OpenDocument styles and schema files from. Set this variable
explicitly only if the in-built heuristics for locating the
above files fails.
(org-odt-styles-dir-list, org-odt-schema-dir-list): New
variables. Pay specific attention to (eval-when-compile ...)
form through which Makefile's $(datadir) - contained in
`org-odt-data-dir' - gets compiled in as a "hard coded"
constant.
(org-odt-styles-dir, org-export-odt-schema-dir): Add messages
to aid debugging.
* Makefile (etcdir): Remove this.
(stylesdir): Rename to datadir.
(datadir): Was stylesdir.
(STYLESFILES): Rename to DATAFILES.
(DATAFILES): Was STYLESFILES. Offer a menu of files that is
available. Package maintainers can use this list and their
own discretion to cherry-pick what they are willing to install
in their distribution.
(CP): Add recursive flag so that directories listed in
DATAFILES can be copied enbloc.
(install-lisp): Use conditional flag BATCH_EXTRA
(BATCH_EXTRA): "Target-specific variable value" that plumbs
the value of $(datadir) in to org-odt.el via
`org-odt-data-dir'. See ChangeLog entries for
`org-odt-styles-dir-list' and `org-odt-schema-dir-list'.
(BATCH): Add BATCH_EXTRA.
(lisp/org-odt.elc): Force re-generation of this target every
time so that $(datadir) gets plumbed in to org-odt.el through
`org-odt-data-dir'.
(org-odt-data-dir): "FORCE" target. Also a variable defined
in org-odt.el.
(install-etc): Rename this target to install-data.
(install-data): Was install-etc.
Fix for the following report:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00799.html
Ulrich Mueller <ulm@gentoo.org> writes:
In Gentoo we have an issue with the location of the
OpenDocument style files, reported to us in bug 396269 [1].
When org-mode is installed as a separate Gentoo package, its
lisp files are installed in
/usr/share/emacs/site-lisp/org-mode/. According to our
policy, non-lisp files would go to
/usr/share/emacs/etc/org-mode/. We would pass this as the
"etcdir" parameter to "make install", so the odt style files
would be installed in stylesdir =
/usr/share/emacs/etc/org-mode/styles/.
Now org-odt.el currently defines org-odt-styles-dir in a
defconst, and it searches only in ../etc/styles/,
./etc/styles/, and ./etc/org/ relative to lispdir. Obviously
it cannot find the files in the Gentoo location.
[1] <https://bugs.gentoo.org/show_bug.cgi?id=396269>
* org-odt.el (org-odt-styles-dir): Assume that the styles
files are located under `data-directory' of Emacs distribution
as etc/org/OrgOdtStyles.xml and
etc/org/OrgOdtContentTemplate.xml. Also update docstring.
(org-export-odt-schema-dir): Update docstring.
* lisp/org-odt.el (org-export-odt-default-org-styles-alist):
Add styles for title and subtitle.
(org-odt-format-toc): New.
(org-odt-format-preamble): New. Users can redefine this to
customize what goes before the document body. Currently it
outputs title, author and email, date and toc.
(org-odt-begin-document-body): Use `org-odt-format-preamble'.
(org-odt-format-date): Renamed from
`org-odt-iso-date-from-org-timestamp'. Also added an
additional param for format string.
(org-odt-begin-annotation, org-odt-update-meta-file): Use
`org-odt-format-date'.
* etc/styles/OrgOdtStyles.xml (Title, OrgTitle, Subtitle)
(OrgSubtitle): New styles for formatting title.