* 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/OASIS: Removed. The rng files are needed only for generating
rnc files. They are not needed for integrating with Emacs proper.
* contrib/odt/etc/schema/od-schema-v1.1.rnc: Removed. Just go with 1.2
schema.
Should the deleted files be needed later, they can always be resurructed
from the git repo.
* contrib/babel/langs/ob-fortran.el (org-babel-fortran-var-to-fortran):
Replacing usage of characterp with integerp (which should work w/Emacs22).
* lisp/ob-C.el (org-babel-C-var-to-C): Replacing usage of characterp
with integerp (which should work w/Emacs22).
* 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
* contrib/lisp/org-odt.el (org-odt-embedded-images-count): New
variable.
(org-odt-copy-image-file): Use the above variable to name the
embedded image files. Remove some cruft as well.
(org-export-odt-file-list, org-export-odt-save-list): Removed.
(org-odt-init-outfile, org-odt-save-as-outfile): Related changes.
* contrib/lisp/org-odt.el (org-export-odt-manifest-lines):
Removed.
(org-odt-update-manifest-file): Removed.
(org-odt-create-manifest-file-entry)
(org-odt-write-manifest-file): New function.
(org-odt-manifest-file-entries): New variable.
(org-odt-manifest-file-entry-tag): Updated.
(org-odt-init-outfile): Don't create manifest.xml here. Don't
create Pictures directory so early in the export. Reset
`org-odt-manifest-file-entries'.
(org-odt-save-as-outfile): Modified. Use
`org-odt-create-manifest-file-entry' and
`org-odt-write-manifest-file'.
(org-odt-copy-image-file, org-odt-update-meta-file)
(org-odt-copy-styles-file): Use
`org-odt-create-manifest-file-entry'.
Rationalized creation of Manifest file entries. New entries are
created right at the point where new files are added to the odt file.
* contrib/lisp/org-odt.el (org-odt-init-outfile): Don't create
mimetype file here.
(org-odt-save-as-outfile): Create mimetype file here. Note
that this routine gets called towards the end of the export
just before files are zipped.
* contrib/lisp/org-odt.el
(org-odt-init-outfile): Don't create meta.xml here.
(org-odt-update-meta-file): Create and update meta.xml here
instead. Note that this routine gets called just before the
component files are zipped.
(org-export-odt-meta-lines): Remove it. Not needed any longer.
(org-odt-save-as-outfile): No need to create backup files
while saving xml buffers.
* contrib/lisp/org-lparse.el (org-lparse-format-table-row): In
list-tables, require that the header row be a row with max
number of columns. Abort export if this condition is not met.
* contrib/lisp/org-xhtml.el (org-xhtml-end-table): During
export of list-tables, `org-xhtml-format-table-no-css' is not
bound. In such cases pretend that it's value is nil.
* contrib/lisp/org-lparse.el
(org-lparse-list-table:table-cell-open): New variable.
(org-lparse-begin-list-table:table-cell)
(org-lparse-end-list-table:table-cell): New routines. Use
`org-lparse-begin-collect' and `org-lparse-end-collect' to get
a string representation of a multi-line table cell.
(org-lparse-list-table-p, org-lparse-list-level)
(org-lparse-list-item-count, org-lparse-list-stack)
(org-lparse-list-table:table-cell-open)
(org-lparse-list-table:table-row)
(org-lparse-list-table:lines): New variables to keep track of
the state of the list at a point in time during export.
(org-do-lparse): Init above variables.
(org-lparse-begin-list, org-lparse-end-list)
(org-lparse-begin-list-item, org-lparse-end-list-item):
Modified so that list marked as list-table are exported as a
table. Refer notes in the file for more information.
(org-lparse-do-format-list-table): Make sure that `org-table'
is loaded.
* contrib/lisp/org-odt.el (org-odt-format-table-cell): Table
cells are list-tables are already paragraphs. No need to
enclose them in paragraphs again.
* contrib/lisp/org-odt.el
(org-odt-entity-control-callbacks-alist): Added an entry for
TABLE-CELL.
(org-odt-begin-paragraph, org-odt-format-stylized-paragraph):
Honour `org-lparse-current-paragraph-style'.
(org-odt-begin-table-cell, org-odt-end-table-cell): Factored
out from the earlier `org-odt-format-table-cell'. Note that
these functions set and reset
`org-lparse-current-paragraph-style'.
(org-odt-format-table-cell): Use the above functions.
* contrib/lisp/org-lparse.el
(org-lparse-current-paragraph-style): New variable.
(org-do-lparse): Init the above variable at the beginning of
export.
* contrib/lisp/org-odt.el
(org-odt-get-paragraph-style-cookie-for-table-cell)
(org-odt-get-style-name-cookie-for-table-cell): Factored out
from `org-odt-format-table-cell'.
(org-odt-format-table-cell): Simplified using above functions.
* contrib/lisp/org-lparse.el (org-lparse-footnote-buffer):
Deleted. Genericized as `org-lparse-collect-buffer'.
(org-lparse-output-buffer): Added docstring.
(org-lparse-collect-buffer): New variable. Was
`org-lparse-footnote-buffer' till now.
(org-lparse-collect-count): New variable to aid in asserting
implicit assumptions made by the export engine.
(org-lparse-begin-collect): New function. Factored out from
`org-lparse-begin-footnote-definition'.
(org-lparse-end-collect): New function. Factored out from
`org-lparse-end-footnote-definition'.
(org-lparse-begin-footnote-definition)
(org-lparse-end-footnote-definition): Use above functions.
(org-do-lparse): Reset `org-lparse-collect-buffer' and
`org-lparse-collect-count' at the beginning of export.
Cleanup `org-lparse-collect-buffer'.
* contrib/lisp/org-xhtml.el (org-xhtml-end-export): Removed
references to `org-lparse-footnote-buffer'.
* contrib/lisp/org-lparse.el (org-lparse-list-table-enable):
New customizable variable.
(org-lparse-preprocess-after-blockquote-hook): New hook to
treat #+begin_list-table...#+end_list-table blocks specially.
Add this hook to
`org-export-preprocess-after-blockquote-hook'.
(org-lparse-list-table-p): New variable. Bound during
`org-do-lparse'.
(org-lparse-begin-environment, org-lparse-end-environment):
Set `org-lparse-list-table-p' as the engine moves in and out
of list-table blocks.
(org-do-lparse): Bind `org-lparse-list-table-p' to nil on
start of export. Honor
ORG_LIST-TABLE-START...ORG-LIST-TABLE-END environment.
Actual export of list as table is not implemented yet.
* contrib/lisp/org-lparse.el (org-lparse-do-format-org-table):
Modified. Delete some local variables and move it to
`org-lparse-do-format-list-table'
(org-lparse-do-format-list-table): Modified as above.
* contrib/lisp/org-lparse.el
(org-lparse-do-format-list-table): New. Factored out from
`org-lparse-do-format-org-table'.
(org-lparse-do-format-org-table): Use above function.
(org-lparse-format-list-table): New. Wrapper for
`org-lparse-do-format-list-table'. For future use.
* contrib/lisp/org-lparse.el
(org-lparse-org-table-to-list-table): New. Factored out from
`org-lparse-do-format-org-table'.
(org-lparse-do-format-org-table): Use
`org-lparse-org-table-to-list-table'.
* contrib/lisp/org-xhtml.el
(org-export-xhtml-do-preprocess-latex-fragments): Factored out
from the earlier org-export-xhtml-preprocess.
(org-export-xhtml-preprocess-latex-fragments): Check if
backend is xhtml. If yes, delegate to
org-export-xhtml-do-preprocess-latex-fragments. This is hooked
to org-export-preprocess-after-blockquote-hook.
(org-export-xhtml-preprocess-label-references): Factored out
from the earlier org-export-xhtml-preprocess.
(org-export-xhtml-preprocess): Call
org-export-xhtml-preprocess-label-references. Note that
processing of latex fragments is no longer done here.
(org-xhtml-format-image): Honor captions, label and attributes
even for images that are created by latex fragment processing.
(org-xhtml-unload-function): Unhook from
org-export-preprocess-after-blockquote-hook.
Thanks to Myles English for registering this requirement.
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01116.html