Commit graph

15 commits

Author SHA1 Message Date
Jambunathan K 59074ab3bb org-odt.el: Trivial change 2011-12-31 02:21:22 +05:30
Jambunathan K ca47d10e1f org-odt.el: Re-arrange code
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.
2011-12-31 01:11:41 +05:30
Jambunathan K 07f006e4fd Fix packaging of ODT exporter (org-7.8.02) in Gentoo
* 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>
2011-12-31 01:11:33 +05:30
Jambunathan K 2512637fce org-odt.el: Support for anchoring an image to a page
* etc/styles/OrgOdtStyles.xml(OrgPageImage)
(OrgPageImageCaptionFrame): New styles for anchoring an image
centrally on a page.

* lisp/org-odt.el (org-odt-entity-frame-styles): Accommodate new
frame styles: \"OrgPageImage\" and \"OrgPageImageCaptionFrame\".
(org-export-odt-format-image): Handle frame-related :anchor,
:style and :attributes options attached to images as shown
below:
		[[./image.png]]
(org-odt-merge-frame-params): New. Auxiliary routine to merge
the default frame params and user-specified frame params.
(org-odt-format-entity): Use the above
`org-odt-merge-frame-params'.

Jérémy Compostella <jeremy.compostella@gmail.com> writes:
  I need to add pictures that are anchored to the \"page\" and not
  to the \"paragraph\". This is very useful to get a \"floating
  picture\" on an entire page without text breaks.

He also adds:
  Sometimes, you want to add a picture but you don't want a page
  break. For example, you want to add a big illustration. To
  render correctly, the picture needs its own page but you don't
  want to break the page. In this case you need to anchor the
  picture to the \"page\".

http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00869.html
2011-12-26 16:03:25 +05:30
Jambunathan K 9164b48f69 org-odt.el: Declare vars and functions from htmlfontify 2011-12-24 12:28:31 +05:30
Jambunathan K f237ef8b37 org-odt.el (org-odt-styles-dir): It is etc/org/ under vanilla Emacs
* 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.
2011-12-24 11:33:54 +05:30
Jambunathan K 7676e2bfa5 org-odt.el: Honor author. timestamp and email options in preamble
* org-odt.el (org-odt-format-preamble): Honor following user
options: author, timestamp and email.  See

http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00539.html
2011-12-24 09:39:04 +05:30
Jambunathan K 633f2af28e org-odt.el: Fix permissions 2011-12-15 12:32:33 +05:30
Jambunathan K f5add81f4b org-odt.el: Include author and date in the title
* 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.
2011-12-15 12:25:35 +05:30
Jambunathan K 48b8d633c4 org-odt.el: Don't crash if htmlfontify is not available
* lisp/org-odt.el (org-odt-format-source-code-or-example): Try
loading htmlfontify safely.
2011-12-12 20:40:53 +05:30
Bastien Guerry 6a4343a461 Require htmlfontify.el only if emacs-version is greater than 23.2.
* org-odt.el (require): Require htmlfontify.el only if
emacs-version is greater than 23.2.

Thanks to Martyn Jago for reporting this.
2011-12-12 15:05:48 +01:00
Jambunathan K baae11d38c org-odt.el (org-export-odt-schema-dir): Modified 2011-12-11 02:04:28 +05:30
Jambunathan K ff99056baf Makefile (PKG_FILES) : Include etc/
Also fix all byte-compiler warnings in org-lparse.el and org-odt.el.
2011-12-11 02:02:33 +05:30
Jambunathan K aed0b90ce7 org-odt.el: Misc changes to reflect change in dir layout
* lisp/org-odt.el (org-odt-data-dir): Removed.
(org-odt-styles-dir, org-export-odt-schema-dir): New
variables.
2011-12-10 18:13:10 +01:00
Jambunathan K 6aef72be12 Move org-lparse.el and org-odt.el to the main lisp dir 2011-12-10 18:12:53 +01:00
Renamed from contrib/lisp/org-odt.el (Browse further)