* contrib/lisp/org-export.el (org-export-get-inbuffer-options): Fix
but with incomplete macros returning an error. Also with behaviour
`nil', only insert new value if none was defined before.
(org-export-use-select-tags-p): Fix bug preventing it from properly
detecting select-tags.
(org-export--skip-p): Small refactoring
* testing/contrib/lisp/test-org-export.el: New test file.
* contrib/lisp/org-export.el (org-export-get-parent): New function.
(org-export-data, org-export-get-previous-element,
org-export-get-next-element): Use new function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-item): Use new function.
Refactor code.
(org-e-ascii-paragraph): Use new function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-item): Use new function.
* EXPERIMENTAL/org-e-html.el (org-e-html-item): Use new function.
* EXPERIMENTAL/org-e-odt.el (org-e-odt-item): Use new function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii-item, org-e-ascii-paragraph): Apply `:genealogy' removal.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-item): Apply `:genealogy'
removal.
* contrib/lisp/org-element.el (org-element-map): Do not compile
genealogy. Also use `:ignore-list' when possible.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
Populate `:ignore-list' before starting to transcode each element in
subtree.
(org-export-get-min-level): Use `:ignore-list'.
(org-export--skip-p): Renamed from `org-export-skip-p'. This is now
an internal function.
(org-export-data): Use and update `:ignore-list'. Do not update
genealogy.
(org-export-ignore-element): New function
(org-export-last-sibling-p): Small refactoring.
(org-export-resolve-fuzzy-link): Apply `:genealogy' removal.
(org-export-get-genealogy): Use a more efficient algorithm.
The equivalent of (plist-get info :genealogy) is
now (org-export-get-genealogy blob info), blob being any element or
object.
* contrib/lisp/org-element.el (org-element-object-restrictions):
Modify docstring.
(org-element-secondary-value-alist): New variable.
(org-element-map): Possibly look into secondary strings when mapping
through objects. Also sanitize some function names.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--unique-links): Make use of
org-element-map improvement.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-item): Use new
`org-list-get-item-number' function.
* contrib/lisp/org-element.el (org-element-item-interpreter): Use new
`org-list-get-item-number' function.
* contrib/lisp/org-element.el (org-element-string-restrictions): Allow
targets in tables. Also fix wrong symbol for verse-blocks.
(org-element-verse-block-parser): Apply change.
* contrib/lisp/org-element.el (org-element-link-parser): Recognize
"ref" type links as a new type of Org link.
* contrib/lisp/org-export.el (org-export-resolve-ref-link): New
function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--describe-links): Do not
describe "ref" type links at the end of each section.
(org-e-ascii-link): Handle "ref" type links.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Handle "ref" type
links.
"ref" type links are Org answer to LaTeXisms like "\ref{some-label}".
Hence, [[ref:some-label]] will be replaced with the sequence number of
the element with name "#+name: some-label" during export.
* contrib/lisp/org-export.el (org-export-dispatch): Put
temporary buffer that holds exported HTML source in either
`nxhtml-mode' or `nxml-mode'.
`nxhtml-mode' is *not* part of stock Emacs while `nxml-mode' is.
* contrib/lisp/org-export.el (org-export-dispatch)
(org-export-dispatch-ui): Add new entries for the new HTML
exporter.
* EXPERIMENTAL/org-e-html.el: New file. This is a very rough
cut based out on org-xhtml.el and org-e-latex.el. The file
retains all the LaTeXisms in either commented form or
otherwise. This is deliberate so as to have a quick look at
the reference implementation. Retaining the organization
style of org-xhtml.el would enable easy creation of
org-e-odt.el by simply replacing e-html with e-odt for the
most part.
The changes here covers fairly a good ground - say 90% - of my
unit test file.
* contrib/lisp/org-export.el (org-export-as, org-export-to-buffer,
org-export-to-file): Add an optional argument to prevent including
files and executing Babel code.
This can be used as a basis for an Org to Org exporter.
* contrib/lisp/org-element.el (org-element-recursive-objects): Add
macro object type to recursive types.
(org-element-object-restrictions): Macros can only contain other
macros.
* contrib/lisp/org-export.el (org-export-get-inbuffer-options): Parse
macro value, unless it it meant to be eval'ed.
(org-export-expand-macro): Expand macros recursively.
* contrib/lisp/org-element.el (org-element-link-parser): Do not parse
radio link as a recursive link.
* contrib/lisp/org-export.el (org-export-solidify-link-text): Make
sure "\" isn't allowed in solidified strings. This is required to
allow entities in radio targets.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Apply changes to
radio links.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-link): Apply changes to
radio links.
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent-paragraph): New functions.
(org-export-get-parent-headline, org-export-get-previous-element,
org-export-get-next-element): Internally use new function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-link--inline-image,
org-e-latex-link): Apply changes to topology functions.
This new function is especially useful since every object derives its
properties from those the containing paragraph.
* contrib/lisp/org-element.el (org-element-object-restrictions): Allow
plain links in link description.
* contrib/lisp/org-export.el (org-export-default-inline-image-rule):
New variable.
(org-export-inline-image-p): Use rules instead of extensions. A rule
is a regexp applied to path for a given type of link. It allows to
extend inline images to non-local files.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-inline-image-rules): New
variable.
(org-e-latex-inline-image-extensions): Removed variable
There are two motivations behind this change. The first one is to
allow, for example, an HTML exporter to define a rule like the
following:
("http" . "\\.\\(png\\|jpg\\|jpeg\\|gif\\)\\(\\?\\(\\w+=\\w+&?\\)*\\)?")
The other one is to properly define thumbnails (clickable images),
like the following:
[[http://orgmode.org][file:~/my-logo.png]]
* contrib/lisp/org-export.el (org-export-filters-alist): New variable.
(org-export-install-filters): New function.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-filters-alist): New variable.
Back-end specific filters can now be installed in communication
channel with `org-BACKEND-filters-alist' variable.
* contrib/lisp/org-export.el (org-export-get-environment): Renamed
function from org-export-collect-options. Also make arguments
optionals.
(org-export-as): Apply renaming. Refactor code a bit.
(org-export-get-inbuffer-options): Remove string argument from
signature. Backend is now optional. Also, check if option match is
really a keyword.
(org-export-get-global-options, org-export-parse-option-keyword): Make
backend argument optional.
* contrib/lisp/org-export.el (org-export-collect-options): Remove
useless argument.
(org-export-initial-options): Add an `:input-file' property in
communication channel.
* contrib/lisp/org-export.el (org-export-initial-options): Initialize
correctly some macros when buffer is a clone.
(org-export-expand-macro): Ignore output when macro's value is nil.
* contrib/lisp/org-element.el (org-element-map): Remove included file
expansion part.
* contrib/lisp/org-export.el (org-export-as): Expand include keywords
before executing blocks.
(org-export-expand-include-keyword, org-export-prepare-file-contents):
New functions.
(org-export-included-file, org-export-parse-included-file): Removed
functions.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii-keyword): Remove include
keyword handling.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-keyword): Remove include
keyword handling.
Back-ends do not need anymore to take care of #+include keywords.
This change is required since file inclusion can potentially break any
structure. Hence, it should be done before parsing.
* contrib/lisp/org-export.el (org-export-with-current-buffer-copy):
Copy `outline-level' value in the temporary buffer. This fixes
a bug introduced by commit
10b06ae53c.
* contrib/lisp/org-element.el (org-element-item-parser): If item's
first line is empty, ensure contents start at a beginning of line so
that child can be correctly parsed.
* contrib/lisp/org-element.el (org-element-dual-keywords): Move
caption in the dual keywords category.
(org-element--affiliated-re): Change regexp matching a dual keyword.
(org-element-collect-affiliated-keywords): Dual parsed keywords also
get their optional value parsed as a secondary string.
* EXPERIMENTAL/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-src-block): Apply caption status change.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--build-caption): Apply
caption status change.
(org-e-ascii--list-listings, org-e-ascii--list-tables): Apply caption
status change. Also use short caption name when available.
The status change implies a syntax change. Captions can now share
#+results: syntax, which mean that they can have a secondary
value. Thus, the following Org snippets are valid, the first two being
equivalent.
#+caption: long name
#+caption[]: long name
#+caption[short name]: long name
* contrib/lisp/org-export.el (org-export-get-inbuffer-options):
Replace macro with an empty string when no value is provided.
Ignore macros with an ill-formed key.
* contrib/lisp/org-export.el (org-export-option-alist): Add filters as
properties in the communication channel. This allows back-end
developers to install their own filters at run time instead of
making them reside in a global variable.
(org-export-data, org-export-as): Read filters from communication
channel instead of global variables.
(org-export-filter-apply-functions): Only accept list of functions.
Also change order of calling: it is now LIFO.
* contrib/lisp/org-export.el (org-export-collect-elements): Change
output to list of elements instead of their beginning position.
Also add an optional predicate argument for fine grain control.
Remove back-end argument.
(org-export-collect-tables, org-export-collect-listings): Apply
changes from previous function.
(org-export-collect-figures): Apply changes from previous function.
Also require a predicate to correctly define the concept of figure.
* contrib/lisp/org-export.el (org-export-get-ordinal): Correctly
handle predicate in `org-export-get-ordinal'. Also allow to count
more than one element type in the same sequence with optional
argument TYPES.
* contrib/lisp/org-element.el (org-element-quote-section-parser):
Assume point is at quote-section beginning.
(org-element-guess-type): Move point to section beginning before
calling for quote-section parser.
(org-element-parse-elements, org-element-current-element): Correctly
detect and parse quote section.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-export-to-latex,
org-e-latex-export-to-pdf): New functions.
* contrib/lisp/org-export.el (org-export-dispatch): Make use of new
functions.
* contrib/lisp/org-export.el (org-export-output-file-name): New function.
(org-export-to-file): Remove post-process and pub-dir arguments. Add
a file argument to specify an output file.
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
Ensure `:headline-offset' is filled before `:headline-numbering'
since the latter depends on the former.
(org-export-collect-headline-numbering): Use headline elements as keys
in the returned alist, instead of just beginning numbers.
(org-export-get-headline-number): Apply key change.
* contrib/lisp/org-export.el (org-export-resolve-fuzzy-link): Now
return the full object (for a target) or element (for an headline)
when a match is found. Also rewrite internals so it doesn't rely
on :headline-alist.
(org-export-collect-tree-properties): Remove :headline-alist property
from communication channel, since `org-export-resolve-fuzzy-link'
doesn't use it anymore. Also store full target objects
in :target-list property, not only raw names. Fix an argument name
mismatch, too.
Previous version of org-export-resolve-fuzzy-link returned beginning
position as the identifier for the headline found, which is pretty
weak when files are included in the parsed buffer.
* contrib/lisp/org-element.el (org-element--element-block-re): New
variable.
(org-element-current-element): New function.
(org-element-parse-elements): Make use of the new specialized function
instead of `org-element-at-point'. Also narrow buffer to current
container (greater element or recursive object) being parsed to
improve search speed.
(org-element-comment-parser): Speed-up parsing for comments at column 0.
(org-element-guess-type): Make comment regexp less restrictive, due to
comment optimizations.
* contrib/lisp/org-export.el (org-export-handle-code): Allow to delay
processing of source code by storing line numbers and references in
text properties attached it.
* contrib/lisp/org-export.el (org-export-collect-options): Default
title is retrieved before in-buffer settings are read. Also, be
more careful about indirect buffers.
* contrib/lisp/org-element.el (org-element-parse-objects): Untabify
strings between objects to avoid any `tab-width' mismatch.
* contrib/lisp/org-element.el (org-element-normalize-contents): No
longer need to handle tabs.
* contrib/lisp/org-element.el (org-element-map): Remove use of
`org-export-update-info'.
* contrib/lisp/org-export.el (org-export-persistent-properties,
org-export-persistent-properties-list): Remove variables
(org-export-collect-tree-properties): Rename from
`org-export-initialize-persistent-properties'.
(org-export-data): Get rid of `org-export-update-info' calls.
(org-export-as): Use new `org-export-collect-tree-properties' name.
(org-export-resolve-coderef, org-export-get-loc): New functions.
(org-export-handle-code): Use new functions instead of removed
properties. Reformat code. Change signature.
* contrib/lisp/org-element.el (org-element-section-parser,
org-element-section-interpreter): New functions
(org-element-greater-elements): Add new element to the list.
(org-element-at-point): Change arguments to handle a new section mode.
(org-element-guess-type): Accept an optional argument to look for
sections in priority.
(org-element-parse-buffer): Start in section mode by default. Thus
any text before the first headline is still in a section of his
own.
(org-element-parse-elements): Handle new section mode.
* contrib/lisp/org-export.el (org-export-update-info): No longer need
to keep it updated.
(org-export-collect-footnote-definitions,
org-export-footnote-first-reference-p): Get rid of dependency on the
removed property.
* contrib/lisp/org-export.el (org-export-table-format-info): Now
`:width' is properly retrieved with cookies where alignement is
missing (i.e. "<6>"). Also `:row-groups' contains groups of
standard lines only (colgroups and width lines are skipped).
* contrib/lisp/org-export.el (org-export-update-info): `:genealogy' is
now a full flat list of objects and elements containing current
object or element. Thus, `:parent-properties' and
`:inherited-properties' are now obsolete, and removed.
(org-export-data): Apply change to `:genealogy' property.
(org-export-get-parent-headline): New function to fullfil one common
need.
(org-export-last-sibling-p, org-export-included-file): Make use of the
new function.
* contrib/lisp/org-export.el (org-export-get-subtree-options):
Correctly get `:title: from headline when no "EXPORT_TITLE" property
is defined. Also assume point is at subtree beginning.
(org-export-as): Fix subtree parsing. The subtree starts at point or
at first heading above. Contents do not include the first headline.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.
Also define two aliases.
* contrib/lisp/org-export.el
(org-export-collect-footnote-definitions): Change key to footnote
number, retrieved with `org-export-get-footnote-number'. Also, do
not use beginning position as label for inline footnotes, as those
are weak identifiers.
* contrib/lisp/org-element.el (org-element-headline-parser): Update
list of attributes in the docstring.
(org-element-inlinetask-parser): Complete attributes with properties
inherited from any property drawer within the inlinetask and with
time properties (i.e. scheduled, clock...).
* contrib/lisp/org-element.el (org-element-map): Change name of local
variables to prevent variable name collisions with the function
around org-element-map.
* contrib/lisp/org-export.el (org-export-persistent-properties-list):
Add omitted persistent properties.
This patch also updates documentation with regards to persistent properties.
* contrib/lisp/org-export.el (org-export-collect-headlines): Simplify
function, in order to allow greater flexibility to build a proper
table of contents.
EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Apply changes.
contrib/lisp/org-export.el (org-export-inline-image-p): Remove
description of the link as a required argument, since this function is
called with link contents anyway.
From the author: "This is a rewrite of Org-Velocity for speed. Delays due
to file size should no longer be perceptible. I have also added in-line
previews of entry contents and dropped support for Org-Remember."
* contrib/lisp/org-export.el (org-export-persistent-properties-list):
Remove unused persistent properties.
(org-export-initialize-persistent-properties): Delegate headline
numbering alist to `org-export-collect-headline-numbering'.
(org-export-collect-headline-numbering): New function.
(org-export-update-info): Remove part relative to headline numbering.
(org-export-get-headline-number): Use new `:headline-numbering' to get
current headline number.
Headline numbering is not done on demand anymore, but built once and
for all at the beginning of the export process, and stored in an
alist, accessible through the `:headline-numbering' property in the
communication channel.
* contrib/lisp/org-export.el (org-export-with-current-buffer-copy):
Full invisibility prevents `current-column' from returning useful
values. Thus, keep visibility related text-properties and set
`buffer-invisibility-spec' to nil.
The TOC max level which could be specified by user is lost during the
export operation. However, this information could be useful in particular
with the ODT exporter. So if another script work on the ODT afterward and
ask to re-compute the TOC, the new TOC will keep this max level.
TINYCHANGE.
* contrib/lisp/org-odt.el (org-export-odt-max-image-size): New
variable.
(org-odt-image-size-from-file): Honor above variable.
Ivars Finvers <ifinvers@shaw.ca> says -
One minor issue that I came across in using the ODT
exporter relates to the size of embedded images. I often need
to include plots of simulation results in my documents. These
plots can be larger than a normal page, which causes problems
in the text flow. In LaTeX, I've grown used to being able to
automatically rescale a plot to match the maximum text width
of the document. It would be useful to have such a feature
for the ODT exporter.
* contrib/lisp/org-lparse.el (org-lparse-format-org-link): Fix
issues with formatting of custom links - pass the right
backend to the custom formatter.
Fix for bug reported by Christian Moe here:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00474.html
TODO: Modify `org-bbdb-export' to support odt backend. Review contrib
modules for odt compatibility.
* contrib/lisp/org-xhtml.el (org-xhtml-begin-environment)
(org-xhtml-end-environment): Fix param list.
Continue commit 2e0e462d14.
Support for annotation blocks for xhtml backend still needs to
be ported. See org-exp-blocks.el for more information.
* contrib/lisp/org-odt.el (org-odt-is-formula-link-p):
Recognize *.mml and *.mathml as mathml files. Recognize *.odf
files as OpenDocument formula file.
(org-odt-copy-formula-file): Use `org-odt-zip-extract-one' to
handle ODF formula files.
(org-export-odt-format-formula): If a ODF formula link has no
caption or label, embed it inline. Otherwise embed it as
displayed.
* contrib/lisp/org-odt.el (org-odt-update-styles-file)
(org-odt-write-mimetype-file): New. Extracted out of
`org-odt-save-as-outfile'.
(org-odt-save-as-outfile): Use above routines.
(org-export-odt-tmpdir-prefix)
(org-odt-init-outfile): Misc changes.
Preparing for introducing `org-export-as-odf'. The new
command will create OpenDocument Formula files out of LaTeX
fragments. Dynamic variable `org-lparse-backend' will be set
to 'odf during this command.
* contrib/lisp/org-odt.el (org-odt-encode-plain-text): New.
(org-odt-format-line)
(org-odt-format-source-code-or-example-plain): Use it.
(org-odt-format-object-description): New. Format svg:title
and svg:desc elements out of plain text.
(org-export-odt-format-formula, org-export-odt-format-image):
Check whether the incoming formula or image is generated out
of a latex fragment. If yes, pass the latex fragment for
downstream processing.
(org-odt-format-frame): Check if the object that is enclosed
in the frame has metadata associated with it. If yes, dump it
as part of svg:title and svg:desc elements.
(org-odt-protect-latex-fragment): New after advice for
`org-format-latex-as-mathml'. Fixes the following bug
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00176.html
* contrib/lisp/org-odt.el
(org-odt-format-source-line-with-line-number-and-label): When
numbering was turned off, src blocks were getting stripped
from export. Fixed this regression.
* contrib/lisp/org-odt.el (org-odt-begin-table)
(org-export-odt-format-formula, org-export-odt-format-image)
(org-odt-entity-frame-styles, org-odt-format-entity): Use
"__Table__", "__Figure__", "__MathFormula__",
"__DvipngImage__" as internal category handles.
(org-export-odt-user-categories)
(org-export-odt-get-category-from-label)
(org-odt-label-styles, org-odt-category-map-alist): New
variables.
(org-odt-entity-labels-alist): Add label style as an
additional entry. Update docstring.
(org-odt-get-label-category-and-style): New defun.
(org-odt-add-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references)
(org-odt-format-entity-caption, org-odt-init-outfile):
Modified.
(org-odt-label-def-ref-spec): Removed. Superceded by
`org-odt-label-styles'.
(org-odt-get-label-definition): Removed
Give user more control over how labels are generated and
referenced. This is accomplished by mapping each label to a
category-handle which in turn is used to locate the category,
counter and style to be associated with label.
* contrib/lisp/org-lparse.el (org-lparse-special-blocks): New
variable. Add "annotation" blocks in addition to the already
existing "list-table" blocks.
(org-lparse-get-block-params): New helper routine to read
params passed to a special block. Used in conjunction with
OpenDocument annotations and with parsing of "#+ATTR_ODT:..."
lines attached to images.
(org-lparse-par-open-stashed): New let-bound variable.
(org-do-lparse): Bind `org-lparse-par-open-stashed'. Treat
all blocks listed in `org-lparse-special-blocks' as special
environments. Honor options passed as part of
"#+begin_<block-name>[options]".
(org-lparse-preprocess-after-blockquote-hook): Handle all
blocks listed in `org-lparse-special-blocks' specially.
(org-lparse-strip-experimental-blocks-maybe-hook): New hook
that hooks up to `org-export-preprocess-hook'. Removes blocks
listed under `org-lparse-special-blocks' while exporting to
formats other than "odt" or "xhtml".
(org-lparse-begin-environment, org-lparse-end-environment):
Modified signature to accomodate block params.
(org-lparse-stash-save-paragraph-state)
(org-lparse-stash-pop-paragraph-state): New helper routines
for use with emitting of OpenDocument annotations.
(org-lparse-list-table-enable): Removed. "list tables" are
now always enabled.
* contrib/lisp/org-odt.el (org-odt-begin-annotation)
(org-odt-end-annotation): New routines.
(org-odt-begin-environment, org-odt-end-environment): Handle
block params. Handle the new "annotation" block.
(org-odt-format-author, org-odt-iso-date-from-org-timestamp):
New helper routnes for emitting author and comment timestamps
with annotation blocks.
(org-odt-update-meta-file): Use above routines.
(org-export-odt-format-image): Use
`org-lparse-get-block-params' to parse inline image attributes.
(org-odt-format-date): Removed. Superceded by
`org-odt-iso-date-from-org-timestamp'.
See http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01251.html
* contrib/lisp/org-odt.el
(org-export-odt-preferred-output-format): Use
`org-lparse-reachable-format'. Update docstring.
(org-export-odt-convert-processes)
(org-export-odt-convert-process)
(org-export-odt-convert-capabilities): New customizable
variables. Migrated from org-lparse.el.
(org-export-odt-convert): New. Replaces `org-lparse-convert'.
(org-odt-get): Handle options - `CONVERT-METHOD' and
`CONVERT-CAPABILITIES'.
* contrib/lisp/org-lparse.el (org-lparse-and-open)
(org-lparse-to-buffer)
(org-replace-region-by, org-lparse-region, org-lparse): Made
these functions non-interactive.
(org-lparse-convert): Removed. Splitted it in to
`org-lparse-convert-read-params' and `org-lparse-do-convert'.
(org-lparse-convert-read-params, org-lparse-do-convert): New
helper routines.
(org-lparse-convert-processes, org-lparse-convert-process)
(org-lparse-convert-capabilities): Removed. Migrated to
org-odt.el.
(org-lparse-get-other-backends, org-lparse-get-converter)
(org-lparse-all-backends): Removed these helper routines.
(org-lparse-do-reachable-formats)
(org-lparse-reachable-formats, org-lparse-reachable-p): New
helper routines.
(org-do-lparse): Misc changes.
org-lparse.el is likely to be replaced by Nicolas Goazious's
backend. So, with future-proofing in view, hide org-lparse.el
from direct user contact. This amounts to retiring all
interactive functions and customizable variables that have
org-lparse as prefix and migrating their existing functinality
to the odt namespace. This set of changes does precisely
that.
* contrib/lisp/org-odt.el (org-export-odt): Define the missing
customizable group and hook it up with `org-export'
customizable group.
(org-export-odt-preferred-output-format): Fix the `:group'
property.
* contrib/lisp/org-odt.el (org-export-odt-inline-images):
Renamed from `org-odt-export-inline-images'. Also removed
customizability.
(org-export-odt-inline-image-extensions): Renamed from
`org-odt-export-inline-image-extensions'. Also fixed the
`:group' property.
(org-odt-format-org-link): Propagate above changes.
Additionally, replace one
(or (org-mode-p) (derived-mode-p 'org-mode))
with
(derived-mode-p 'org-mode)
cause that is reflexive anyway (returns true, if the current mode is
org-mode).
Delete one check testing for org-mode or org derived mode
* contrib/lisp/org-odt.el: Introduce a new option
"#+ODT_STYLES_FILE: ..." for per-file setting of
`org-export-odt-styles-file'.
(org-export-odt-styles-file): Mention above option in
docstring.
(org-odt-save-as-outfile): Honor above option.
* contrib/lisp/org-contacts.el (completion-table-case-fold): Make
completion compatible with Emacs 24Fix org-contacts completion at point (was: org-contacts completion stopped working)
julien Barnier <julien@nozav.org> writes:
Hi Julien,
>> I use a very recent emacs 24 bzr checkout and org master from git.
>> Not sure who's the culprit.
>
> Same problem here. After a quick look it seems that there has been a
> recent change in the arguments taken by the completion-table-case-fold
> function in minibuffer.el :
>
> http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/105991
Thanks for the pointer!
> But I don't think I could be able to find a fix by myself.
But I was able, so good teamwork, mate. :-)
--8<---------------cut here---------------start------------->8---
>From d89ca3ce39cd7436e5205744adcf468d9619180f Mon Sep 17 00:00:00 2001
From: Tassilo Horn <tassilo@member.fsf.org>
Date: Thu, 13 Oct 2011 17:02:07 +0200
Subject: [PATCH 2/2] Fix org-contacts completion at point.
* contrib/lisp/org-lparse.el
(org-lparse-table-get-colalign-info): Renamed
`org-forced-aligns' to `org-col-cookies'. Renamed local
variable `forced-aligns' to `col-cookies'.
(org-lparse-format-table-row): With the introduction of
`org-col-cookies' property the internal structure of
`org-lparse-table-colalign-info' has changed. Do the right
thing while setting up col alignment. Pass on the colwidth
property as horiz-span arg of `TABLE-CELL' callback.
* contrib/lisp/org-odt.el (org-odt-begin-table): Let the table
style be settable throught #+ATTR_ODT line. By default tables
are configured to occupy 90% of paper width. This is too big
for smaller tables. For aesthetic reasons, a user might
prefer that such tables of shorter width and thus specify a
different style.
(org-odt-end-table, org-odt-format-table-cell): Honor colwidth
specification.
* contrib/lisp/org-xhtml.el (org-xhtml-format-table-cell): Fix
signature as mandated by changes in TABLE-CELL callback.
See comments in the earlier patch. See also
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html
* contrib/lisp/org-odt.el (org-odt-get-label-definition): If a
label cannot be resolved, issue a warning and return nil.
(org-odt-fixup-label-references): Nothing to fixup if a
referenced label is not seen by the odt exporter.
* contrib/odt/styles/OrgOdtStyles.xml
(OrgFixedWidthBlockLastLine, OrgSrcBlockLastLine): New styles
to be applied to the last line of the source or example
blocks.
* contrib/lisp/org-odt.el
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use above
styles.
* contrib/lisp/org-lparse.el (org-lparse-format-org-link):
Push the responsibility of calling
`org-export-get-coderef-format' to the backends.
* contrib/lisp/org-xhtml.el (org-xhtml-format-org-link): Take
up the above responsibility.
* contrib/lisp/org-odt.el (org-odt-format-link): Handle links whose
descriptions are actually line-numbers.
(org-odt-format-source-line-with-line-number-and-label): New.
Generate line numbers and link targets for lines that are part of
source or example blocks.
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use
`org-odt-format-source-line-with-line-number-and-label'.
(org-odt-format-source-code-or-example): Pre-process input lines with
`org-export-number-lines'. Also handle numbering of src lines.
(org-odt-format-org-link): Rework handling of coderef links. Generate
ODF-specific markup for line-number based coderef links.
(org-xml-encode-plain-text-lines): Removed. Not used any more.
contrib/odt/styles/OrgOdtStyles.xml (OrgSrcBlockNumberedLine): New
style for automatic numbering of src and example lines.
Another small patch for org-elisp-symbol: Set the symbol type to
"Function or command" if it is defuned but not fbound when
`org-elisp-symbol-store-link' is called.
Best,
-- David
* contrib/odt/styles/OrgOdtContentTemplate.xml: Add bottom
margin to "OrgTable". Modify border properties of
"OrgTblCell*"s. Add "OrgEquation" table styles for
typesetting of display equations.
* contrib/odt/styles/OrgOdtStyles.xml: Added various "graphic"
styles for formatting of inline and display equations.
Modified names of some "graphic" styles for images for reasons
of consistency.
* contrib/lisp/org-odt.el (org-export-odt-do-format-image):
Removed. This is now folded in to
`org-export-odt-format-image'. A part of this is extracted in
to `org-odt-format-entity'.
(org-odt-entity-frame-styles): New variable.
(org-odt-format-entity): New function. See previous entries.
(org-export-odt-format-image): Modified. See previous
entries.
(org-export-odt-do-format-numbered-formula)
(org-export-odt-do-format-formula): Removed. These functions
are now folded within `org-export-odt-format-formula'.
(org-export-odt-format-formula): Modified as noted above.
Also use `org-odt-format-entity'.
(org-odt-format-frame, org-odt-format-textbox): Modified
signature to facilitate elegant introduction of
`org-odt-format-entity'.
(org-odt-format-inlinetask): Honor change in signature.
(org-odt-label-def-ref-spec): Added an entry for "Equation".
Only MathML equations are typeset using tables. Dvipng equations are still
typeset as regular images.
* contrib/lisp/org-odt.el
(org-odt-entity-labels-alist, org-odt-entity-counts-plist)
(org-odt-label-def-ref-spec): New variables.
(org-odt-init-outfile): Reset above variables.
(org-odt-add-label-definition, org-odt-get-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references): New functions.
(org-export-odt-preprocess-label-references): Modified.
(org-odt-end-export): Call `org-odt-fixup-label-references'.
(org-odt-parse-label): Removed
(org-odt-default-entity): Removed.
(org-odt-format-entity-caption): Fixed signature so that
category param is no longer optional. Use
`org-odt-format-label-definition'.
(org-export-odt-do-format-formula)
(org-export-odt-do-format-image): Pass the mandatory category
param to `org-odt-format-entity-caption'.
* contrib/odt/styles/OrgOdtContentTemplate.xml: Add Figure and
Equation as sequence declarations.
Most of these changes can be pushed to org-exp.el. For now park the
changes locally to org-odt.el.
* contrib/lisp/org-odt.el (org-odt-table-style)
(org-odt-table-style-spec): New variables.
(org-export-odt-table-styles): New user-customizable variable.
(org-odt-begin-table): Init `org-odt-table-style' from the
attributes.
(org-odt-get-table-cell-styles): New function.
(org-odt-end-table): Use the above function.
(org-odt-get-style-name-for-table-cell): Removed. Now folded
in to `org-odt-get-table-cell-styles'.
(org-odt-get-style-name-cookie-for-table-cell): Modified to
accommodate new user-defined styles.
Users now have the option of choosing Org's own way of styling or
using custom styling.
* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed
* contrib/odt/styles/OrgOdtContentTemplate.xml: Added. This
file is now a fully-formed "content.xml" file but with "empty"
content. Note that the original "OrgOdtAutomaticStyles.xml"
was just an xml fragment.
* contrib/lisp/org-odt.el
(org-odt-document-content-header): Removed.
(org-export-odt-automatic-styles-file): Removed.
(org-export-odt-content-template-file): Renamed from
`org-export-odt-automatic-styles-file'.
(org-odt-data-dir): Update docstring.
(org-odt-begin-office-body, org-odt-begin-document-content):
Modified to accomodate changes introduced by the new
"OrgOdtContentTemplate.xml" file.
* contrib/lisp/org-odt.el
(org-odt-embedded-formulas-count):New variable.
(org-odt-init-outfile): Reset above variable.
(org-odt-is-formula-link-p, org-odt-format-inline-formula)
(org-odt-copy-formula-file, org-export-odt-format-formula)
(org-export-odt-do-format-formula)
(org-export-odt-do-format-numbered-formula): New functions for
formatting mathml file links as embedded ODF formulae.
(org-odt-format-org-link): Add check for links to mathml files
and call `org-odt-format-inline-formula'.
(org-export-odt-format-image): Update function signature. Use
`org-latex-src' property to identify latex dvipng images. Use
the (to be committed) `org-latex-src-embed-type' to identify
whether the equation image should be inlined or displayed.
(org-odt-format-textbox): Modified to accomodate correct
formatting of captioned formula.
(org-odt-format-inlinetask): Modified to accomodate changes to
the previous function.
(org-export-odt-do-format-image): Minor change.
(org-export-odt-do-preprocess-latex-fragments): When LaTeX
fragment option is set to `t' or `mathjax' check for
availability of latex to mathml converter using (to be
committed) `org-format-latex-mathml-available-p'. If such a
converter is available and configured, use it. Otherwise
default to the earlier behaviour.
Refer the following post for more information:
http://article.gmane.org/gmane.emacs.orgmode/46712
* contrib/lisp/org-odt.el (org-odt-format-frame): New.
(org-odt-format-textbox): Use the above function.
(org-export-odt-do-format-image): Use the above two functions.
Use the new custom styles for the Frame and Graphics elements.
(org-odt-image-attrs-from-size): Remove this.
* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed all
Frame and Graphics entries.
* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles - OrgSimpleGraphics, OrgCaptionedGraphics,
OrgCaptionFrame, OrgInlineGraphics and OrgInlineFormula.
* contrib/lisp/org-odt.el (org-odt-format-date): %:z format
specifier of `format-time-string' is not portable. Replace it
with an equivalent implementation using %z specifier.
Thanks to Anton Tarasenko for reporting this bug and verifying
this fix. See
http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00099.html