ox-bibtex: Port for "org-exp-bibtex.el"

* contrib/lisp/ox-bibtex.el: New file
ox-taskjuggler.el: Fix byte compiler warnings

* ox-taskjuggler.el (org-taskjuggler-get-project)
(org-taskjuggler-resolve-dependencies): Fix references to free
variables.
ox-taskjuggler: Small fix

* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-assign-task-ids):
  Small fix.
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.
Merge branch 'maint'
org-element: Fix a docstring

* lisp/org-element.el (org-element--remove-indentation): Fix
  docstring.
Merge branch 'maint'
org-element: Small optimization

* lisp/org-element.el (org-element--remove-indentation): Small
  optimization.
Merge branch 'maint'
org.el (orgstruct-setup): Bind all intermediate key translations.

* org.el (orgstruct-setup): Bind all intermediate key
translations.
Fix TOC link references.

* contrib/lisp/ox-deck.el: TOC link references were being generated as
  "outline-container-{digit}". They need to be
  "outline-container-sec-{digit}".
Fix handling of internal links and new html doctype option.

* contrib/lisp/ox-deck.el (deck): Add deck specific link function.
(org-deck-toc): Generate correct link to slide for custom ids as well
as default section ids.
(org-deck-link): HTML custom ids link to the headline. deck.js
requires linking to the wrapper (slide) so modify the link to point at
the container instead of the headline.
(org-deck-template): Fix doctype handling to use alist option instead
of literal string.
Fix handling of author and email in koma exporter.

* ox-koma-letter.el (org-koma-letter-author): defaults to a function
that returns =`user-full-name'=.

Setting the variables `org-koma-letter-author' and
`org-koma-letter-email' to the values of `user-full-name' and
`user-mail-address' respectively, allows the user to skip =#+AUTHOR:=
and =#+EMAIL:= lines when configuring a letter.  However, if the user
wishes to set this information in LCO files, these variables need to
be set to nil.

With the old after-init-hook method my user name was always set to "".
Now org-koma-letter will (i) allow for default nil values (good if you
use LCO files); (ii) default to =`user-full-name'= and
=`user-mail-address'= like =ox-latex.el=.  These values are obtained
on-the-fly.

The two variables in question can also be strings or functions
returning strings.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
Added support for after closing and after document entities in ox-koma-letter.

* ox-koma-letter.el (org-koma-letter-special-tags-after-closing):
  specials tags inserted after =\end{closing}=.
* ox-koma-letter.el (org-koma-letter-special-tags): collect
  the special lists.
* ox-koma-letter.el (org-koma-letter-headline): stores content
  in of headline if the first tag is special.  Otherwise return content.
* ox-koma-letter.el (org-koma-letter-special-content): holds special
  content temporarily.
* ox-koma-letter.el (org-koma-letter--format-string-as-macro): format a string as
  a macro or don't.
* ox-koma-letter.el (org-koma-letter-template): added support
  for the headings with special tags.

The following example will now export a sensible manner.

* my letter
  here's a letter
* PS :ps:
  it's requires this patch
* CC :cc:
  Nicolas, Viktor and Alan
* ENCL :encl:
  many patches
  1. this patch
  2. another patch.
* include patches :after_letter:
  \myspecialmacro

  \includepdf{pdf}

Namely, content of ps, encl and cc headings will be exported after
\closing{.}  in the order prescribed by
=`org-koma-letter-special-tags-after-closing'= as a (LaTeX) macro
removing trailing and leading newlines.  The macro is the same as the
tag, althogh the case is determined by the special list.

The concents of the =after_letter= heading will be inserted after
=\end{letter}= and newlines are preserved.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
Change default of org-koma-letter-signature to nil.

* ox-koma-letter.el(org-koma-letter-signature): set to nil.

The previoues value corresponds to the default value cf. the the koma
manual pp. 183.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
ox-koma-letter: changed handling of subject.

* ox-koma-letter.el: =`org-koma-letter-subject-format'= can now be a list.  Default is t.
   If nil neither subject format nor type is exported.
* ox-koma-letter.el (org-koma-letter-template): better subject handling.
* ox-koma-letter.el (org-koma-letter-template): allow for t value of =#+OPTIONS: subject:VALUE=
* ox-koma-letter.el (org-koma-letter-template): export of subject format is independent
of title, but title is not independent of =:with-subject=.

The issue was with =#+OPTIONS: subject:t= one would get a LaTeX error.

New behavior:

If =#+OPTIONS: subject:(x,y)= then =\KOMAoption{subject}{x, y}=.

If =subject:x= then =\KOMAoption{subject}{x}=.

If =subject:t= then =\KOMAoption{subject}{...}= is not set but
\setkomavar{subject}{...} is set (in the output file)

If =subject:nil= neither are printed.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
ox-md: Fix error when exporting underline objects

* lisp/ox-md.el (md): Delegate underscore transcoding to HTML
  back-end.
Merge branch 'maint'
Fix issues with TOC, internal links and html-doctype.

* contrib/lisp/ox-deck.el (deck): add new deck specific link handler.
(org-deck-toc): Add "sec-" to non-custom link ids.
(org-deck-link): New function. Rename internal link to point at
container instead of heading.
(org-deck-template): Use alist doctype instead of string (per changes
to ox-html).
Refactor fetching html doctype from alist into function so it can be reused in inherited exporters.

* lisp/ox-html.el (org-html-doctype): Add new function `org-html-doctype'.
(org-html-template): Use `org-html-doctype' function instead of inline
code.

* contrib/lisp/ox-deck.el (org-deck-template): Use `org-html-doctype'
  function instead of inline code.

* contrib/lisp/ox-s5.el (org-s5-template): Use `org-html-doctype'
  function instead of inline code.