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.
Export back-ends: Apply changes to export functions

* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
  org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
  org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
  org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
  org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
  org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
  org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
  org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
  org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
  org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
  org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
Rewrite org-insert-heading for maintainability

* lisp/org.el (org-insert-heading): Rewritten from scratch.
(org-N-empty-lines-before-current): New function
(org-insert-heading-respect-content): Set the correct argument to
force a heading even in lists.
save-restriction in `org-mobile-push'

* lisp/org-mobile.el (org-mobile-push): add `save-restriction'

The fact that pushing org-file loses my narrow context annoys me.

TINYCHANGE
Allow to specify the names of automatic bookmarks

* lisp/org.el (org-bookmark-names-plist): New user option.
(org-set-regexps-and-options-for-tags): Use `org-bookmark-names-plist'.
(org-refile): Use `org-bookmark-names-plist'.
* lisp/org-capture.el (org-capture-bookmark-last-stored-position): Use
`org-bookmark-names-plist'.

Patch modified from a proposal by Oleh.
org-clock: Fix defcustom type for two variables

* lisp/org-clock.el (org-clock-total-time-cell-format,
  org-clock-file-time-cell-format): Use correct type.
Merge branch 'maint'
ox-publish: Fix prefix for some variables

* lisp/ox-publish.el (org-publish-sitemap-sort-files,
  org-publish-sitemap-sort-folders, org-publish-sitemap-ignore-case,
  org-publish-sitemap-requested, org-publish-sitemap-date-format,
  org-publish-sitemap-file-entry-format): Set prefix to
  "org-publish-sitemap" instead of "org-sitemap".
(org-publish-compare-directory-files, org-publish-get-base-files-1,
org-publish-projects, org-publish-format-file-entry): Use new prefix.
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.
Merge branch 'maint'

Conflicts:
	lisp/ox.el
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).
Timestamps: Handle sub-10-min ranges when updating timestamps

* lisp/org.el (org-get-compact-tod): Always pad minutes to two places.

TINYCHANGE
Merge branch 'maint'
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.
ob-python

From 8f3c510f43e458a1bbb58b126fc4e402007e6cfe Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Mon, 12 Aug 2013 21:10:27 +0200
Subject: [PATCH] ob-python: run-python requires argument cmd

* lisp/ob-python.el: Supply non-optional argument `cmd' to all
  invocations of `run-python'.  Invert a condition of to remove an
  expendable progn form.

46d05e4d08 corrected the signatore in the declaration of run-python,
but the call without an argument was left in.
Latex export: Fix the position of captions on unfontified src blocks

* lisp/ox-latex (org-latex-src-block): Change format string to
  position caption after figure content.

Note: This is now consistent with the caption positioning for
formatted src blocks, later in the same function.

TINYCHANGE
Merge branch 'refs/heads/master' into latex-numbering