Backport Emacs trunk revno r116039
Merge branch 'maint'
Fix ff902c
Merge branch 'maint'
ox-latex: Fix items starting with a square bracket

* lisp/ox-latex.el (org-latex-headline, org-latex-item): Fix items
  starting with a square bracket.

Thanks to Jon Degenhardt, Vladimir Lomov and Eric S Fraga for
contributing to the discussion.
Merge branch 'maint'
ox-ascii: Convert `length' to `string-width'

* lisp/ox-ascii.el (org-ascii--current-text-width): Convert `length'
  to `string-width'.
  (org-ascii--build-title, org-ascii--build-toc)
  (org-ascii--list-listings, org-ascii--list-tables)
  (org-ascii-template--document-title)
  (org-ascii-inner-template, org-ascii-format-inlinetask-default)
  (org-ascii-format-inlinetask-default, org-ascii-item
  (org-ascii--table-cell-width, org-ascii-table-cell)
  (org-ascii--current-text-width): Likewise.

I've checked all occurrences of the function `length' in ox-ascii.el.
It turns out that the most of them are calculating the width of given
string.  To support fullwidth characters, we better use `string-width'
instead of `length'.

Some characters in UCS are categorized as "East Asian Ambiguous"[1].
The return value of `string-width' with those characters depends on
how Emacs is setup.  We leave those ambiguous character handling to
Emacs.

Two usages of `length' in `ox-ascii.el' were left as-is, because those
were used for:

 - bullet depth calculation in `org-ascii-headline', and
 - cell position calculation in `org-ascii--table-cell-width'.

[1]: http://www.unicode.org/reports/tr11/#Ambiguous
Merge branch 'maint'
ox-koma-letter: Cleanup some docstrings

* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
  org-koma-letter-email, org-koma-letter-place,
  org-koma-letter-prefer-special-headings, org-koma-letter-signature,
  org-koma-letter-subject-format, org-koma-letter-use-backaddress,
  org-koma-letter-use-phone, org-koma-letter-use-email,
  org-koma-letter-use-place,
  org-koma-letter-headline-is-opening-maybe,
  org-koma-letter--get-tagged-contents,
  org-koma-letter--format-string-as-macro,
  org-koma-letter--normalize-string): Cleanup docstrings.
Fix missing export option in override.
Use an overridable list of available doctypes for customization.

* lisp/ox-html.el (org-html-doctype): Use choice of available
  doctypes (from `org-html-doctype-alist) plus user-entered string.
Add better svg support to html exporter.

* lisp/ox-html.el (org-html--format-image): If image is an svg file,
  format as "object" using new function `org-html--svg-image' instead
  of "img".
Fix title page template.

* contrib/lisp/ox-s5.el (org-s5-title-slide-template): Per Arne
  Babenhauserheide, the heading levels on the default title slide
  template were wrong per the S5 spec.
ox-koma-letter: Fix customizable variables values

* contrib/lisp/ox-koma-letter.el (org-koma-letter-from-address):
(org-koma-letter-phone-number, org-koma-letter-place,
org-koma-letter-subject-format, org-koma-letter-opening,
org-koma-letter-closing, org-koma-letter-signature,
org-koma-letter-default-class, org-koma-letter-subject-format): Fix
value.
ox-koma-letter: Fix a docstring

* contrib/lisp/ox-koma-letter.el (org-koma-letter-closing): Fix
  docstring.
ox-koma-letter: Fix global settings handling

* contrib/lisp/ox-koma-letter.el (koma-letter): Rewrite function.
  Global variables are no longer ignored.
(org-koma-letter--build-settings): New function.
ox-koma-letter: Fix customizable variable

* contrib/lisp/ox-koma-letter.el (org-koma-letter-use-foldmarks): Use
  correct type and improve docstring.
ox-koma-letter: Fix a variable type

* contrib/lisp/ox-koma-letter.el (org-koma-letter-subject-format):
  Make it clear that lists of symbols are allowed.
(org-koma-letter-template): Refactor subject-related part.
ox-koma-letter: Small refactoring

* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Add
  comments.
(org-koma-letter--build-settings): Rename internal bindings and
reorder insertion.
ox-koma-letter: Change value for folding marks

* contrib/lisp/ox-koma-letter.el (org-koma-letter-use-foldmarks):
  Change value to symbols or list of symbols.
(org-koma-letter--build-settings): Use new value for folding marks.