Commit Graph

75 Commits

Author SHA1 Message Date
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
Carsten Dominik 8f3a109a21 Use base buffer for storing export dispatch position
* lisp/ox.el (org-export-dispatch): Make sure the last position marker
  uses the base buffer if there is one.
2013-02-28 12:53:45 +01:00
Carsten Dominik 9c58082c46 Make repeating a subtree-restricted export command remember the subtree
Export commands can be restricted to a specific subtree.  When using a
prefix argument to org-export-dispatch, the restriction did not stick,
i.e. the command would be restricted to whatever note the cursor
happens to be in.  This made it difficult to repeat export of a
subtree while editing it.  This change introduces a new marker and
uses this marker to remember the cursor position of the previous
export command.  So repeating a subtree-restricted command will now
re-export the same subtree, provided you are still in the same
buffer.  To break this connection, just make a new export without
relying on the prefix argument.

* lisp/ox.el (org-export-dispatch-last-position): New variable
  (org-export-dispatch): Save position of cursor at the moment when
  the export command is called.  Restore that position temporarily
  when repeating the previous export command.
2013-02-28 09:35:34 +01:00
Nicolas Goaziou a7535ca353 ox: Fix min level computation
* lisp/ox.el (org-export--get-min-level): Ignore footnote section when
  computing minimal headline level.
2013-02-27 23:22:51 +01:00
Nicolas Goaziou 86563e0119 org-element: OPTIONAL_TITLE becomes ALT_TITLE property
* lisp/org-element.el (org-element-headline-parser):
  Rename :optional-title into :alt-title.
* lisp/ox.el (org-export-get-alt-title): Renamed from
  `org-export-get-optional-title'.
* lisp/ox-ascii.el (org-ascii--build-title): Apply name change.
* lisp/ox-html.el (org-html--format-toc-headline): Apply name change.
* lisp/ox-latex.el (org-latex-headline): Apply name change.
* lisp/ox-texinfo.el (org-texinfo--get-node,
  org-texinfo--generate-menu-items): Apply name change.
* testing/lisp/test-ox.el: Update tests.
* doc/org.texi (Table of contents): Update documentation.
2013-02-27 00:03:59 +01:00
Nicolas Goaziou 677433d9b4 ox: Fix bug where properties read from setupfile overwrite previous properties
* lisp/ox.el (org-export--get-inbuffer-options): Remove an optional
  argument.  Rewrite function.  Properties read from a setupfile do
  not overwrite anymore previously computed properties.
(org-export-get-environment): Apply changes to previous function.
* lisp/org.el (org-create-formula--latex-header): Apply arity change
  from `org-export--get-inbuffer-options'.
* testing/lisp/test-ox.el: Add test.
* testing/examples/setupfile.org: New file.
2013-02-26 23:35:36 +01:00
Nicolas Goaziou b0fd7a51ee Revert "ox: Use tabulated list mode for asynchronous stack"
This reverts commit a965c06213.
2013-02-26 09:46:02 +01:00
Nicolas Goaziou 367e680582 ox: Change order of retured elements in `org-export-get-previous-element'
* lisp/ox.el (org-export-get-previous-element): Change order of
  retured elements in `org-export-get-previous-element'.
* testing/lisp/test-ox.el: Update test.
2013-02-25 23:17:42 +01:00
Nicolas Goaziou a965c06213 ox: Use tabulated list mode for asynchronous stack
* lisp/ox.el (org-export-stack): Rewrite.
(org-export-stack-refresh): Refactor.
(org-export-stack-remove, org-export-stack-view): Apply renaming.
(org-export-stack-mode-map): Use tabulated list map as a basis.
(org-export-stack--generate, org-export-stack--num-predicate): New
function.
2013-02-24 13:51:49 +01:00
Nicolas Goaziou a15a657bfb ox: Better return value for `org-export-get-optional-title'
* lisp/ox.el (org-export-get-optional-title): Return regular title
  when no optional title is found.
* lisp/ox-ascii.el (org-ascii--build-title): Apply change to
  `org-export-get-optional-title'.
* lisp/ox-html.el (org-html--format-toc-headline): Apply change to
  `org-export-get-optional-title'.
* lisp/ox-latex.el (org-latex-headline): Apply change to
  `org-export-get-optional-title'.
* testing/lisp/test-ox.el: Add tests.
2013-02-24 09:20:35 +01:00
Nicolas Goaziou e5a249b327 org-element/ox: Introduce :optional-title property and an accessor
* lisp/org-element.el (org-element-headline-parser): Node
  property :OPTIONAL_TITLE: in a headline will be parsed and stored
  under :optional-title property.
* lisp/ox.el (org-export-get-optional-title): New function.
2013-02-23 22:41:30 +01:00
Bastien Guerry 8ee6c13c7f Fix typo: an headline -> a headline. 2013-02-23 13:47:44 +01:00
Bastien Guerry 917cc1d516 Merge branch 'master-wip' 2013-02-23 11:48:21 +01:00
Nicolas Goaziou 65bacaac73 ox: Fix coding system error
* lisp/ox.el (org-export--generate-copy-script): Clone
  `buffer-file-coding-system' when creating a buffer copy.

This patches makes sure the output will share the same encoding as the
original buffer.
2013-02-23 11:22:58 +01:00
Bastien Guerry e9e32173cc Update headers. 2013-02-23 09:56:24 +01:00
Bastien Guerry 5ea1322c99 org-compat.el (org-file-equal-p): New compatibility function
* org-compat.el (org-file-equal-p): New compatibility function.

* ox.el (org-export-output-file-name): Use the new function.

Thanks to Mark Edgington for reporting this.
2013-02-19 18:01:03 +01:00
Nicolas Goaziou 27da9a2a0f Revert "Export: Prevent babel src blocks from being evaluated if org-export-babel-evaluate is nil"
This reverts commit 12d592b732.  When
the variable is nil, no block will be processed, which is a bug.
2013-02-18 21:14:00 +01:00
Nicolas Goaziou f541bff087 ox: Prevent invisible cursor from highlighting brackets in UI
* lisp/ox.el (org-export--dispatch-ui): Prevent invisible cursor from
  highlighting brackets in UI

This is another try following f849239d73.
2013-02-18 18:35:21 +01:00