Commit Graph

192 Commits

Author SHA1 Message Date
Nicolas Goaziou 718e1ec3c4 Merge branch 'maint' 2013-08-29 10:08:24 +02:00
Nicolas Goaziou 2baa2c3afa ox: Fix stack overflow in equal error
* lisp/ox.el (org-export-table-cell-width): Modify key (now an
  element) and value structure (now a vector) of cache so it can use
  `eq' as test. Elements are circular lists so `equal' cannot apply on
  them.

Reported-by: Jambunathan K <kjambunathan@gmail.com>
2013-08-29 10:04:22 +02:00
Nicolas Goaziou e7c8872005 ox: Fix docstrings
* lisp/ox.el (org-export-to-buffer, org-export-to-file): Fix
  docstrings.
2013-08-27 10:32:59 +02:00
Nicolas Goaziou cf8cc35ec5 ox: Fix test errors
* lisp/ox.el (org-export-data-with-backend): Set temporary back-end as
  the new back-end in local communication channel.
(org-export-filter-apply-functions): Handle corner case where back-end
is nil.
* testing/lisp/test-ox.el: Small refactoring.
2013-08-12 10:42:05 +02:00
Nicolas Goaziou 73b060b768 ox: Only provide back-end name as second argument of filters
* lisp/ox.el (org-export-filter-apply-functions): Only provide
  back-end name (a symbol) as second argument of filters, not the full
  back-end (a vector).
2013-08-10 09:42:20 +02:00
Nicolas Goaziou ef2d475bf8 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2013-08-08 18:49:17 +02:00
Nicolas Goaziou c82cb4f75e ox-publish: Correctly return document title
* lisp/ox-publish.el (org-publish-find-title): Fix title when no
  #+TITLE property is provided.
* lisp/ox.el (org-export-store-default-title): Remove-function.
(org-export--default-title): Remove variable.
(org-export-options-alist): Do not use a default value.
(org-export--get-buffer-attributes): Store a default title.
(org-export-as): Apply function removal.
(org-export--get-global-options): Do not set a property with an
explicitely nil value.
2013-08-08 18:45:39 +02:00
Nicolas Goaziou 6f55864f20 ox: Add arguments to `org-export-to-file' and `org-export-to-buffer'
* lisp/ox.el (org-export-to-buffer): Add two arguments: one to trigger
  asynchronous export and the other to do extra processing from within
  the buffer.
(org-export-to-file): Add two arguments: one to trigger asynchronous
  export and the other to do extra processing on the output file.
(org-export-async-start): Small clean up.
2013-08-07 16:10:38 +02:00
Nicolas Goaziou d1d918100e ox: Fix f5161671ce
* lisp/ox.el (org-export-as): Use new back-end structure.
2013-08-03 09:46:58 +02:00
Nicolas Goaziou b95d7842f2 Merge branch 'maint' 2013-08-03 09:45:42 +02:00
Nicolas Goaziou f5161671ce ox: Re-introduce `org-export-current-backend' for compatibility
* lisp/ox.el (org-export-current-backend): New variable.
(org-export-as): Use new variable.

Thanks to Christophe Rhodes for providing a preliminary patch.
2013-08-03 09:44:34 +02:00
Nicolas Goaziou a3375f3432 Merge branch 'maint' 2013-07-31 14:45:09 +02:00
Nicolas Goaziou cc10c80d85 ox: Preserve coding system when writing output to a file
* lisp/ox.el (org-export-to-file): Preserve coding system when writing
  output.
2013-07-31 14:44:33 +02:00
Nicolas Goaziou d73ff5fd61 Merge branch 'maint' 2013-07-28 21:40:37 +02:00
Nicolas Goaziou 33a2c7ea68 ox: Fix compilation error with Emacs < 24
* lisp/ox.el (org-export-stack-mode-map): Fix compilation error with
  Emacs < 24.
2013-07-28 21:40:02 +02:00
Nicolas Goaziou 9b7f43768f Merge branch 'maint' 2013-07-28 21:33:24 +02:00
Nicolas Goaziou 17ba41434e ox: Maintain compatibility with Emacs 23
* lisp/ox.el (org-export--dispatch-action): Maintain compatibility
  with Emacs 23.
2013-07-28 21:32:48 +02:00
Bastien Guerry c815fe55cd Merge branch 'maint' 2013-07-24 01:37:33 +02:00
Bastien Guerry c31ad79326 ox.el: Remove reference to the obsolete variable `org-export-language-setup'
* ox.el: Remove reference to the obsolete variable
`org-export-language-setup'.
2013-07-24 01:37:16 +02:00
Nicolas Goaziou 814755a2d7 ox: Fix small bug
* lisp/ox.el (org-export--get-inbuffer-options): Fix small bug
  introduced in 908d42c9b6.
2013-07-22 16:06:47 +02:00
Nicolas Goaziou 908d42c9b6 ox: Multiple options can be set through the same keyword
* lisp/ox.el (org-export--get-inbuffer-options): Multiple options can
  now be set through the same buffer keyword.
* testing/lisp/test-ox.el: Add test.
2013-07-22 15:15:01 +02:00
Nicolas Goaziou 203f4c9b05 ox: Fix "wrong-type-argument" error in template insertion
* lisp/ox.el (org-export-insert-default-template): Fix
  "wrong-type-argument" error in template insertion.

Thanks to Eric Abrahamsen for reporting this.
2013-07-11 08:48:36 +02:00
Nicolas Goaziou cea0434c4f ox: Change back-ends internal representation to structures
* lisp/ox.el (org-export--registered-backends): Renamed from
  `org-export-registered-backends'.
(org-export-invisible-backends): Removed variable.
(org-export-get-backend, org-export-get-all-transcoders
org-export-get-all-options, org-export-get-all-filters): New
functions.  It replaces `org-export-backend-translate-table'.
(org-export-barf-if-invalid-backend, org-export-derived-backend-p,
org-export-define-backend, org-export-define-derived-backend):
Rewrite functions using new representation.
(org-export-backend-translate-table): Remove function.
(org-export-get-environment): Use new function.
(org-export--get-subtree-options, org-export--parse-option-keyword,
org-export--get-inbuffer-options, org-export--get-global-options,
org-export-to-buffer org-export-to-file, org-export-string-as
org-export-replace-region-by): Update docstring.
(org-export-data-with-translations): Remove function.  Use
`org-export-data-with-backend' with a temporary back-end instead.
(org-export-data-with-backend, org-export-as): Reflect new definition
for back-ends.
(org-export--dispatch-action, org-export--dispatch-ui): Reflect new
definition for back-ends and variable removal.  Refactoring.
(org-export-filter-apply-functions): Call functions with
current back-end's name, not full back-end.
* lisp/org.el (org-export-backends, org-create-formula--latex-header):
Use new structure and variables.
* testing/lisp/test-ox.el: Update tests.

This patch separates back-end definition from its registration.  Thus,
it allows to use anonymous or unregistered back-ends.
2013-07-04 14:17:49 +02:00
rasmus 733fb0713e Some language support for Danish, Swedish and Norwegian
* ox.el (org-export-smart-quotes-alist): Added ("da" "no" "nb" "nn"
"sv").
* ox.el (org-export-dictionary): Added some entries ("da" "no" "nb"
"nn" "sv").

These languages are rather unrestricted, so some changes may to some
extend reflect my preferences.
2013-07-03 13:49:05 +02:00
rasmus e7609fb904 Extended org-export-default-language docstring
* ox.el (org-export-default-language): mention other variables
affected by language.
2013-07-03 13:49:05 +02:00
Feng Shu 9795d6d258 ox: add Simplified Chinese translations for `org-export-dictionary'
* lisp/ox.el: (org-export-dictionary): Add Simplified Chinese translations for
`org-export-dictionary'

TINYCHANGE
2013-07-02 19:01:16 +02:00
Nicolas Goaziou 41068a59d2 ox: Update some translations
* lisp/ox.el (org-export-dictionary): Update some translations.
2013-06-29 15:46:31 +02:00
Nicolas Goaziou f7f874006e ox-odt: Fix internationalization of some labels
* lisp/ox-odt.el (org-odt-label-styles, org-odt-category-map-alist):
  Fix docstring.
(org-odt-format-label): Add docstring.  Internationalize prefix.
* lisp/ox.el (org-export-dictionary): Add entry for colons.
2013-06-29 15:29:24 +02:00
Yoshinari Nomura 6037c0da46 ox: add Japanese translations for figures and tables
* lisp/ox.el: (org-export-dictionary): Add Japanese translations for
figures and tables

TINYCHANGE
2013-06-29 14:03:18 +02:00
Yoshinari Nomura 5cd065df88 ox: add dictionary entry for numbered figures
* lisp/ox.el: (org-export-dictionary): Add "Figure %d:" entry
in the same manner with "Table %d:".

TINYCHANGE
2013-06-29 14:03:15 +02:00
Nicolas Goaziou ec8f3f987e Merge branch 'maint' 2013-06-25 09:33:39 +02:00
Nicolas Goaziou a52a35779f ox: Remove useless dictionary entries
* lisp/ox.el (org-export-dictionary): Remove useless dictionary entries.
* lisp/ox-ascii.el (org-ascii--build-caption): Apply removal.
2013-06-25 09:29:18 +02:00
Nicolas Goaziou 42a9473aed ox: Add spanish and german translations
* lisp/ox.el (org-export-dictionary): Add spanish and german
  translations.

Patch suggested by Georg Lehner.
2013-06-25 09:15:24 +02:00
Nicolas Goaziou 4788a58e71 Merge branch 'maint' 2013-06-18 22:48:08 +02:00
Nicolas Goaziou 60899b1a2f ox: Fix fuzzy link resolution before first headline
* lisp/ox.el (org-export-resolve-fuzzy-link): Fix link resolution when
  link lives before the first headline.
* testing/lisp/test-ox.el: Add test.
2013-06-18 22:29:49 +02:00
Nicolas Goaziou 221768a768 Merge branch 'maint' 2013-06-05 14:24:58 +02:00
Nicolas Goaziou 4b7006f444 ox: Fix "Wrong argument type" error when attributes start with :key ""
* lisp/ox.el (org-export-read-attribute): Fix "Wrong argument type"
  error when attributes start with :key "".
2013-06-05 14:24:18 +02:00
Nicolas Goaziou d3eaa6abb6 Merge branch 'maint' 2013-05-25 14:37:01 +02:00
Nicolas Goaziou 87ab99f563 org-element/ox: Fix src-block indentation when it should be preserved
* lisp/org-element.el (org-element--remove-indentation): New function.
(org-element-example-block-parser, org-element-src-block-parser): Use
new function.
(org-element-src-block-interpreter): Update function according to
change.
* lisp/ox.el (org-export-unravel-code): Do not remove any indentation
  since it now happens at the parser level.
* testing/lisp/test-org-element.el: Add tests.
* testing/lisp/test-ox.el: Refactor tests.
2013-05-25 14:35:24 +02:00
Nicolas Goaziou 419b69a435 Merge branch 'maint' 2013-05-20 11:34:59 +02:00
Nicolas Goaziou 4daf9d60d9 ox: Small fix to cell width caching mechanism
* lisp/ox.el (org-export-table-cell-width): Be sure to use cache even
  when stored value is nil.
2013-05-20 11:33:11 +02:00
Nicolas Goaziou a5872b9eca Merge branch 'maint' 2013-05-19 09:54:18 +02:00
Nicolas Goaziou aafb2d2b46 ox: Fix "Symbol's value as variable is void: org-export--default-title"
* lisp/ox.el (org-export--default-title): Fix "Symbol's value as
  variable is void: org-export--default-title".

Bug was introduced in b70e77343a.
2013-05-19 09:52:57 +02:00
Nicolas Goaziou 63531fb2cc Merge branch 'maint' 2013-05-18 18:26:56 +02:00
Nicolas Goaziou 62296ceb88 ox: Improve speed wrt table export
* lisp/ox.el (org-export-resolve-fuzzy-link): Change property name
  holding cache.
(org-export-table-has-header-p, org-export-table-row-group,
org-export-table-cell-width, org-export-table-cell-alignment): Cache
results.
(org-export-table-cell-address): Refactor.
(org-export-get-parent): Inline function.
* testing/lisp/test-ox.el: Update tests.
2013-05-18 18:20:46 +02:00
Nicolas Goaziou 15baadd8af Merge branch 'maint' 2013-05-15 21:20:29 +02:00
Nicolas Goaziou b70e77343a Fix options bug introduced in 16f12e
* lisp/ox.el (org-export-options-alist): Change default value
  for :title property.
(org-export--default-title): New dynamically scoped variable.
(org-export-store-default-title): New function.
(org-export--get-buffer-attributes): Remove title handling.
(org-export--get-global-options): Revert "ox: Fix default
title" (16f12e0aef).  Refactor code.
* testing/lisp/test-ox.el: Update a test.
2013-05-15 21:19:28 +02:00
Nicolas Goaziou 7dc2babf29 Merge branch 'maint' 2013-05-12 20:45:01 +02:00
Nicolas Goaziou 48e51fe5d9 ox: Ignore whitespace differences when resolving a radio link
* lisp/ox.el (org-export-resolve-radio-link): Ignore whitespace
  differences when resolving a radio link.
* testing/lisp/test-ox.el: Add test.
2013-05-12 20:42:30 +02:00
Nicolas Goaziou d542097aa3 Merge branch 'maint' 2013-05-12 17:56:14 +02:00
Nicolas Goaziou e7cd6f1875 ox: Fix radio target resolution
* lisp/ox.el (org-export-resolve-radio-link): Fix radio target
  resolution.
* testing/lisp/test-ox.el: Add test.
2013-05-12 17:54:56 +02:00
Carsten Dominik b3a88babf1 Merge branch 'fix-types' 2013-05-09 15:24:43 +02:00
Carsten Dominik a84c01642b Fix customization types of variables
* contrib/lisp/org-wl.el (org-wl-namazu-default-index): Fix custom type.
* lisp/ob-lob.el (org-babel-lob-files): Fix custom type.
* lisp/org-agenda.el (org-agenda-export-html-style):
(org-agenda-ndays):
(org-agenda-inactive-leader):
(org-agenda-day-face-function):
(org-agenda-auto-exclude-function): Fix custom type.
* lisp/org-bibtex.el (org-bibtex-prefix): Fix custom type.
* lisp/org-clock.el (org-clock-heading-function):
(org-show-notification-handler): Fix custom type.
* lisp/org-footnote.el (org-footnote-auto-adjust): Fix custom type.
* lisp/org-protocol.el (org-protocol-default-template-key): Fix custom type.
* lisp/org.el (org-make-link-description-function):
(org-link-translation-function):
(org-link-frame-setup):
(org-refile-target-verify-function):
(org-get-priority-function):
(org-use-fast-tag-selection):
(org-columns-modify-value-for-display-function):
(org-sparse-tree-default-date-type): Fix custom type.
* lisp/ox-html.el (org-html-postamble):
(org-html-postamble-format):
(org-html-preamble-format): Fix custom type.
* lisp/ox-odt.el (org-odt-content-template-file): Fix custom type.
* lisp/ox.el (org-export-with-archived-trees):
(org-export-initial-scope): Fix custom type.

Thanks to Glenn Moris for reporting these.  He used cus-test.el
to find them.
2013-05-09 15:19:02 +02:00
Nicolas Goaziou 7e4c7edb8a ox: Small refactoring
* lisp/ox.el (org-export-expand-include-keyword): Avoid using `read'
  to determine file name.
2013-05-08 18:13:06 +02:00
Nicolas Goaziou 16f12e0aef ox: Fix default title
* lisp/ox.el (org-export--get-global-options): Properly set default
  title, i.e. when to TITLE keyword is provided.
* testing/lisp/test-ox.el: Add tests.
2013-05-08 16:00:18 +02:00
Nicolas Goaziou bd27a005bb ox: Tolerate included file names without double quotes
* lisp/ox.el (org-export-expand-include-keyword): Tolerate included
  file names without double quotes.
2013-05-07 17:47:59 +02:00
Nicolas Goaziou 3e1d83bf6b ox: Fix caching for fuzzy link resolution
* lisp/ox.el (org-export-resolve-fuzzy-link): Fix caching process.
* testing/lisp/test-ox.el: Add test.
2013-05-04 09:03:00 +02:00
Lawrence Mitchell b7301bd639 ox: Cache locations of fuzzy links
* ox.el (org-export-resolve-fuzzy-link): Look for fuzzy link in a
  cache before trying to resolve it in the parse tree.

When a document contains a large number of identical fuzzy links, it
doesn't make sense to continually search for them.  Instead, cache the
locations in the position independent case.
2013-05-02 14:50:42 +02:00
Nicolas Goaziou eba04bfb3c ox-org: Preserve affiliated keywords
* lisp/ox.el (org-export-expand): Optionally add affiliated keywords
  to results.
* lisp/ox-org.el (org-org-identity): Use new argument for
  `org-export-expand'.
2013-04-26 15:53:05 +02:00
Nicolas Goaziou d408d721c3 ox: Fix `org-export-with-footnotes' behaviour
* lisp/ox.el (org-export--skip-p, org-export--interpret-p): When
  `org-export-with-footnotes' is nil, ignore completely footnotes
  references and definitions instead of exporting them verbatim.
* testing/lisp/test-ox.el: Add tests.
2013-04-21 23:44:18 +02:00
Nicolas Goaziou 60aa1682ce ox: Change scope for `org-export-with-timestamps'
* lisp/ox.el (org-export-with-timestamps): Only applies to isolated
  timestamps, i.e. timestamps in a paragraph containing only
  timestamps and empty strings.
(org-export--skip-p): Skip timestamps according to new behaviour.
* testing/lisp/test-ox.el: Update tests.
2013-04-18 16:58:56 +02:00
Bastien Guerry 4231cb4b12 Use `org-add-hook' in some places and merge Emacs revno r112320
* ox.el (org-export-stack-mode)
* org-crypt.el (org-crypt-check-auto-save)
(org-crypt-use-before-save-magic): Use `org-add-hook' when the
hooks are local hooks.

* org-indent.el (org-indent-mode)
* org-agenda.el (org-agenda-mode): Use `org-add-hook' and
merge upstream change from Emacs revno r112320.
2013-04-18 10:29:00 +02:00
Nicolas Goaziou 407a6acf4d ox/ox-latex: Fix docstrings
* lisp/ox-latex.el: Remove instructions since everything is documented
  in Org manual.
* lisp/ox.el (org-export-with-smart-quotes): Use LATEX instead of
  LaTeX for keywords, the latter being hard to type, somewhat
  difficult to read, and overall just pedantic.
2013-04-16 12:54:05 +02:00
Bastien Guerry 320b633b6e ox-latex.el (latex): Don't force exporting with smart quotes
* ox-latex.el (latex): Don't force exporting with smart
quotes.

* ox.el (org-export-with-smart-quotes): Mention the need to
use the relevant Babel package when setting this option to
non-nil.

Before the fix, if the user used #+LANGUAGE: fr with no other
customization, the quotes would disappear from the PDF output.
That's because smart quotes were enforced, while the .tex file
needs \usepackage[french]{babel} to display the quotes.

We now don't force the smart quotes and give more explanations
in `org-export-with-smart-quotes'.
2013-04-16 11:39:41 +02:00
Nicolas Goaziou df2807b59d ox: Remove macro filters
* lisp/ox.el (org-export-filters-alist): Remove macro filter.
(org-export-filter-macro-functions): Remove variable.

Macro filters are never called since macro expansion happens before
the export process.
2013-04-15 08:22:51 +02:00
Bastien Guerry 4d77fb7696 ox.el: Fix tiny typo. 2013-04-15 00:55:26 +02:00
Bastien Guerry 7c048fd886 ox.el (org-export-with-planning): Enhance docstring
* ox.el (org-export-with-planning): Enhance docstring.
2013-04-14 11:46:45 +02:00
Nicolas Goaziou 659edb40a5 ox: Allow to use empty strings in attributes
* lisp/ox.el (org-export-read-attribute): Allow to use empty strings
  in attributes.
* testing/lisp/test-ox.el: Add tests.

With this patch,

  #+attr_backend: :a "" becomes (:a "")
  #+attr_backend: :a """" becomes (:a "\"\"")
  ...
2013-04-10 18:50:52 +02:00
Bastien Guerry b5f1ff6d83 ox.el (org-export-options-alist, org-export--skip-p): Use `:with-planning' instead of `:with-plannings'
* ox.el (org-export-options-alist, org-export--skip-p): Use
`:with-planning' instead of `:with-plannings', to keep in sync
with the corresponding option's name.
2013-04-10 14:57:41 +02:00
Nicolas Goaziou 5f48315568 ox: Add function returning row number in a table
* lisp/ox.el (org-export-table-row-number): New function.
(org-export-table-cell-address): Use new function.
* testing/lisp/test-ox.el: Add test.
2013-04-09 16:52:41 +02:00
Nicolas Goaziou d6d7bc55b8 ox/ox-html: Use a language agnostic and more neutral default creator
* lisp/ox-html.el (org-html-creator-string): Change default value.
* lisp/ox.el (org-export-creator-string): Change default value.
2013-04-07 20:21:58 +02:00
Nicolas Goaziou 2d6a90229d ox/ox-html: Fix defcustoms
* lisp/ox.el (org-export-with-archived-trees, org-export-with-author,
  org-export-with-clocks, org-export-with-date,
  org-export-creator-string, org-export-with-drawers,
  org-export-with-email, org-export-with-emphasize,
  org-export-exclude-tags, org-export-with-fixed-width,
  org-export-with-footnotes, org-export-with-latex,
  org-export-headline-levels, org-export-default-language,
  org-export-preserve-breaks, org-export-with-entities,
  org-export-with-inlinetasks, org-export-with-planning,
  org-export-with-priority, org-export-with-section-numbers,
  org-export-select-tags, org-export-with-smart-quotes,
  org-export-with-special-strings,
  org-export-with-statistics-cookies,
  org-export-with-sub-superscripts, org-export-with-toc,
  org-export-with-tables, org-export-with-tags,
  org-export-with-tasks, org-export-time-stamp-file,
  org-export-with-timestamps, org-export-with-todo-keywords): Fix
  docstrings.
* lisp/ox-html.el (org-html-postamble-format): Slightly change default
  value so "Generated by" string doesn't get duplicated.
(org-html-creator-string): Fix docstring.
2013-04-07 14:36:48 +02:00
Bastien Guerry 5e8f30f61e org-table.el (orgtbl-apply-fmt): Enhance docstring
* ox.el (org-export-table-row-group): Fix typo in docstring.
2013-04-07 10:05:13 +02:00
Bastien Guerry 3f4028312e ox.el: Fix typos
* org-table.el (orgtbl-apply-fmt): Enhance docstring.
2013-04-07 10:03:37 +02:00
Bastien Guerry 52ba37b8c8 Merge branch 'master' of orgmode.org:org-mode 2013-04-06 19:11:57 +02:00
Bastien Guerry 1e496cc8f9 ox.el (org-export-replace-region-by): New function
* ox.el (org-export-replace-region-by): New function.
* ox-texinfo.el (org-texinfo-convert-region-to-texinfo):
* ox-md.el (org-md-convert-region-to-md):
* ox-latex.el (org-latex-convert-region-to-latex):
* ox-html.el (org-html-convert-region-to-html): New functions
to replace the active region by its export into various
backends.
2013-04-06 19:09:38 +02:00
Nicolas Goaziou f2fd185175 ox: Inhibit startup process when calling `org-mode'
* lisp/ox.el (org-export--get-inbuffer-options,
  org-export--list-bound-variables, org-export--generate-copy-script,
  org-export-string-as, org-export-expand-include-keyword,
  org-export--prepare-file-contents): Inhibit startup process when
  calling `org-mode'.
2013-04-06 17:31:56 +02:00
Nicolas Goaziou 67cf80ae9a ox: Add a command to insert a default export template
* lisp/ox.el (org-export-insert-default-template): New function.
(org-export--dispatch-ui, org-export--dispatch-action): Access to the
function through the dispatcher.

From the dispatcher, if subtree export is selected, options will be
installed as node properties in current subtree.
2013-04-06 13:34:41 +02:00
Nicolas Goaziou 479c21336f Remove special behaviour for TARGET keyword
* lisp/org.el (org-store-link, org-link-search, org-options-keywords):
  Remove reference to TARGET keyword.
* lisp/ox.el (org-export-resolve-fuzzy-link, org-export-get-ordinal):
  Do not use TARGET as a destination for links anymore.
* testing/lisp/test-ox.el: Update tests.
* testing/lisp/test-org.el: Update tests.

Its specifications were not useful enough to keep maintaining this
feature.
2013-04-04 20:38:27 +02:00
Nicolas Goaziou 0bd6ccd6f9 ox: Add generic function to retrieve the date of a document
* lisp/ox.el (org-export-date-timestamp-format): New variable.
(org-export-get-date): New function.
* testing/lisp/test-ox.el: Add tests.
2013-04-02 23:55:28 +02:00
Nicolas Goaziou 55db57dc0a ox: Properly transfer bound variables through export process
* lisp/ox.el (org-export--list-bound-variables): Renamed from
  `org-export--install-letbind-maybe'.  Though, only return list of
  bound variables instead of installing them as buffer-local
  variables.
(org-export-get-environment): Use new function.  Take care of the
installation of bound variables.
(org-export--generate-copy-script): Make sure non-Org variables are
also installed in buffer copy.
* testing/lisp/test-ox.el: Add test.
2013-04-01 15:20:52 +02:00
Nicolas Goaziou 7736c2d7fb ox: Handle BIND keywords in SETUPFILE files
* lisp/ox.el (org-export-get-environment): Update comment.
(org-export--install-letbind-maybe): Go into SETUPFILE files and
handle BIND keywords there.
* testing/examples/setupfile.org: Update test file.
* testing/lisp/test-ox.el: Add tests.
2013-03-29 21:51:57 +01:00
Nicolas Goaziou a6d9fd82ea ox: White spaces after export snippets are never ignored
* lisp/ox.el (org-export-data): White spaces after export snippets are
  never ignored.
* testing/lisp/test-ox.el: Add test.

Back-end developers should pay attention to the fact that white spaces
before and after an ignored export snippet now are accumulated in the
output.
2013-03-25 20:29:31 +01:00
Nicolas Goaziou 7847b4d7a8 ox: Fix coding system problem in asynchronous export
* lisp/ox.el (org-export-async-start): Use correct coding system so
  unibyte characters do not appear in the resulting buffer or file.
2013-03-23 19:02:50 +01:00
Nicolas Goaziou fbb30a5e79 ox: Move a function in the file
* lisp/ox.el (org-export--copy-to-kill-ring-p): Move function
  elsewhere in the file.
2013-03-20 16:58:48 +01:00
Bastien Guerry 9c1ea74c2b Fix typo in commit a13b19e
Thanks to John Hendy for reporting the bug!
2013-03-20 00:57:56 +01:00
Bastien Guerry 9cd0810f90 ox.el (org-export-table-cell-alignment): Treat an empty cell as a number if it follows a number
* ox.el (org-export-table-cell-alignment): Treat an empty cell
as a number if it follows a number.

Thanks to Kodi Arfer for reporting this.
2013-03-19 19:39:35 +01:00
Bastien Guerry 492e20dbfa ox.el (org-export-as): Allow user functions in `org-export-before-parsing-hook' to modify the point
* ox.el (org-export-as): Allow user functions in
`org-export-before-parsing-hook' to modify the point.

Thanks to Charles Berry for reporting this.
2013-03-19 19:39:35 +01:00
Bastien Guerry a13b19e384 ox.el (org-export-define-backend, org-export-define-derived-backend): Use defuns
* ox.el (org-export-define-backend)
(org-export-define-derived-backend): Make defuns and update
docstrings.

* ox-texinfo.el (texinfo):
* ox-org.el (org):
* ox-odt.el (odt):
* ox-md.el (md):
* ox-man.el (man):
* ox-latex.el (latex):
* ox-icalendar.el (icalendar):
* ox-html.el (html):
* ox-beamer.el (beamer):
* ox-ascii.el (ascii): Use the defuns.
2013-03-19 19:39:34 +01:00
Bastien Guerry ce0473532d ox.el (org-export-copy-to-kill-ring): Default back to 'if-interactive
* ox.el (org-export--copy-to-kill-ring-p): New function.
(org-export-copy-to-kill-ring): Use 'if-interactive as the
default.
(org-export-to-buffer, org-export-to-file): Use
`org-export--copy-to-kill-ring-p' and fix docstrings.

* ox-odt.el (org-odt-export-as-odf): Use
`org-export--copy-to-kill-ring-p'.
2013-03-15 13:39:45 +01:00
Nicolas Goaziou 59cb22d638 ox: Simplify syntax for attributes
* lisp/ox.el (org-export-read-attribute): Do not use `read' to read
  attributes.  Instead, extract keywords and values from it, which
  means each value will be a string when non-nil.
* contrib/lisp/ox-groff.el (org-groff-link--inline-image): Use new
  attribute syntax.  Small refactoring.
* lisp/ox-ascii.el (org-ascii-horizontal-rule): Use new attribute
  syntax.
* lisp/ox-beamer.el (org-beamer-plain-list): Use new attribute syntax.
* lisp/ox-html.el (org-html--textarea-block): Use new attribute
  syntax.
* lisp/ox-latex.el (org-latex--inline-image, org-latex--org-table,
  org-latex--math-table): Use new attribute syntax.
* lisp/ox-man.el (org-man-table--org-table): Use new attribute syntax.
  Small refactoring.
* lisp/ox-odt.el (org-odt-link--inline-image, org-odt-table-cell): Use
  new attribute syntax.
* testing/lisp/test-ox.el: Add tests.

This patch introduces two changes.  To begin with, it removes the need
for quoting and escaping characters.  Also, all non-nil values are
stored as strings.  As an exception "nil" is stored as nil.
2013-03-11 08:33:10 +01:00
Nicolas Goaziou 69c617c998 ox: Remove code evaluation queries from asynchronous export
* lisp/ox.el (org-export-async-start): Remove code evaluation queries
  from asynchronous export.
2013-03-10 00:17:09 +01:00
Bastien Guerry 2ad8369015 org.el: Update `customize-package-emacs-version-alist' and fix :version/:package-version keywords
* org.el (customize-package-emacs-version-alist): Update
`customize-package-emacs-version-alist'.

* ox-texinfo.el (org-export-texinfo)
(org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-odt.el (org-odt-format-drawer-function)
(org-odt-format-headline-function)
(org-odt-format-inlinetask-function):
* ox-md.el (org-export-md, org-md-headline-style): Fix :version
and :package-version keywords.
2013-03-06 17:31:28 +01:00
Nicolas Goaziou e109a37ede Export framework: Add :version and :package-version informations to defcustoms
* lisp/ox-beamer.el (org-beamer-column-view-format, org-beamer-theme,
  org-beamer-environments-extra): Add :version and :package-version.
* lisp/ox-html.el (org-html-with-latex, org-html-inline-image-rules):
  Add :version and :package-version.
* lisp/ox-latex.el (org-latex-inline-image-rules,
  org-latex-default-table-environment, org-latex-default-table-mode,
  org-latex-tables-booktabs, org-latex-table-scientific-notation,
  org-latex-known-errors): Add :version and :package-version.
* lisp/ox-md.el (org-md-headline-style): Add :version
  and :package-version.
* lisp/ox-odt.el (org-odt-with-latex): Add :version
  and :package-version.
* lisp/ox.el (org-export-with-drawers, org-export-with-latex,
  org-export-with-inlinetasks, org-export-with-planning,
  org-export-with-smart-quotes, org-export-with-statistics-cookies,
  org-export-allow-bind-keywords, org-export-async-init-file):
  Add :version and :package-version.
2013-03-06 17:14:27 +01:00
Nicolas Goaziou 352ae504ec ox: Fix `org-map-entries' with a nil scope argument usage in hooks
* lisp/ox.el (org-export--generate-copy-script): Call `org-mode' when
  duplicating a buffer.  It will properly set every variable, like
  `comment-start'.
(org-export-async-start): Do not call `org-mode' since this is done
already in the previous function.
2013-03-06 14:26:09 +01:00
Bastien Guerry 8a2e3e2a79 Add :version and :package-version
* ox.el (org-export-snippet-translation-alist)
(org-export-coding-system, org-export-in-background)
(org-export-async-init-file, org-export-invisible-backends)
(org-export-dispatch-use-expert-ui):
* ox-texinfo.el (org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-man.el (org-man-tables-centered)
(org-man-table-scientific-notation)
(org-man-source-highlight, org-man-source-highlight-langs)
(org-man-pdf-process, org-man-logfiles-extensions):
* ox-html.el (org-html-allow-name-attribute-in-anchors)
(org-html-coding-system, org-html-divs):
* ox-ascii.el (org-ascii-text-width)
(org-ascii-headline-spacing, org-ascii-indented-line-width)
(org-ascii-paragraph-spacing, org-ascii-charset)
(org-ascii-underline, org-ascii-bullets)
(org-ascii-links-to-notes)
(org-ascii-table-keep-all-vertical-lines)
(org-ascii-table-widen-columns)
(org-ascii-table-use-ascii-art)
(org-ascii-format-drawer-function)
(org-ascii-format-inlinetask-function):
* org.el (org-modules, org-export-backends)
(org-highlight-latex-and-related, orgstruct-setup-hook):
* org-attach.el (org-attach-git-annex-cutoff):
* org-archive.el (org-archive-file-header-format):
* org-agenda.el (org-agenda-todo-ignore-time-comparison-use-seconds):
* ob-python.el (org-babel-python-hline-to)
(org-babel-python-None-to):
* ob-ditaa.el (org-ditaa-eps-jar-path):
* ob-core.el (org-babel-results-keyword): Add :version and
:package-version.

* ox-ascii.el: Use utf-8-emacs as the file coding system.
2013-03-05 16:38:33 +01:00
Nicolas Goaziou d3b8194069 ox: Store export options in :export-options porperty
* lisp/ox.el (org-export-as): Store export options in :export-options
  porperty within communication channel.

This patch allows export options activated to be available to export
back-ends.
2013-03-04 12:33:03 +01:00
Nicolas Goaziou 8f40d7f7a1 ox: Fix export of empty src blocks
* lisp/ox.el (org-export-format-code-default): Handle empty source
  blocks more gracefully.
* lisp/ox-ascii.el (org-ascii-src-block): Handle empty blocks more
  gracefully.
* testing/lisp/test-ox.el: Add tests.
2013-03-03 19:13:43 +01:00
Nicolas Goaziou 5a0239b9fc ox: Ignore inlinetasks with a :noexport: tag
* lisp/ox.el (org-export--selected-trees): Also mark inlinetasks with
  a select tag.
(org-export--skip-p): Skip inlinetasks with a :noexport: tag.
* testing/lisp/test-ox.el: Add tests.
2013-03-02 15:03:28 +01:00
Nicolas Goaziou ce3e6555d3 ox: Ignore `org-mode-hook' and `kill-emacs-hook' in asynchronous export
* lisp/ox.el (org-export-async-start): Ignore `org-mode-hook' and
  `kill-emacs-hook'.  The first one has been run in the original
  buffer.  The second is not necessary and can pollute output to
  a temporary buffer (e.g. with `org-clock-persistence-insinuate').
2013-03-01 08:31:39 +01:00