ob-exp: Fix export of src blocks with flags

* lisp/ob-exp.el (org-babel-exp-code): Fix export of src blocks with
  flags.
* testing/lisp/test-ob-exp.el (ob-export/export-src-block-with-flags):
  New test.

Thanks to Giuseppe Lipari for reporting it.
org.el: New command org-insert-last-stored-link bound to `C-c M-l'

* org.el (org-insert-all-links): New parameters `pre' and
`post' to specify a string to preprend and append.
(org-insert-last-stored-link): New command.
(org-mode-map): Bind the new command to `C-c M-l'.

Thanks to Sébastien Vauban for requesting this and to Nick
Dokos for testing and fixing the patch.
org.el (org-provide-todo-statistics): Allow to set to a list of two lists, for TODO and DONE keywords

* org.el (org-provide-todo-statistics): Allow to set to a list
of two lists, one with TODO keywords, the other one with DONE
keywords.
(org-update-parent-todo-statistics): Correctly handle
`org-provide-todo-statistics' when it is set as a list of two
lists, for TODO and DONE keywords.

Thanks to Fletcher Charest for reporting this and requesting
this feature.
Merge branch 'maint'
ob-exp: Fix a failing test

* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
  Fix a test
Merge branch 'maint'
org-element: Comply to Emacs 23 signature requirements

* lisp/org-element.el (org-element--cache-sync): Call
  `avl-tree-delete' with 2 arguments only as a 4-arguments call is
  only compatible with Emacs 24.1 and later.
org-agenda.el: Fix buglets

* org-agenda.el (org-agenda-next-item)
(org-agenda-previous-item, org-agenda-toggle-archive-tag)
(org-agenda-todo, org-agenda-priority, org-agenda-clock-in)
(org-agenda-clock-out): Put the cursor back on the correct
column, when possible.
(org-agenda-todo): When `org-clock-out-when-done' is `t', also
remove the current clock overlay.
org.el (org-priority): Don't use `org-preserve-lc'

* org.el (org-priority): Don't use `org-preserve-lc' as it is
not necessary here.
Merge branch 'maint'
mention ob-sh renamed to ob-shell in ORG-NEWS
org-element: Preserve Emacs 23 compatibility

* lisp/org-element.el (org-element--cache-mapc): New function.
(org-element--cache-sync): Use new function.

`avl-tree-mapc' exists in Emacs 24's "avl-tree" but not in Emacs
23's. The new function implements it.
ox-md: Set correctly blank lines between elements

* lisp/ox-md (org-md-separate-elements): Fix blank line insertion
  between elements.
* lisp/ox-md.el (org-md-inner-template): New function.
Merge branch 'maint'
org-compat.el (org-set-transient-map): New alias

* org-compat.el (org-set-transient-map): Alias pointing at
`set-transient-map' if defined, at `set-temporary-overlay-map'
otherwise.

Thanks to Eric Abrahamsen for reporting this.
Merge branch 'maint'
ox: Reorder keywords in export templates

* lisp/ox.el (org-export-insert-default-template): Do not hard-code
  alphabetical order for keywords in templates.  Instead, follow order
  specified in back-ends or `org-export-options-alist' for the default
  case.
export back-ends: Reorder options in templates

* lisp/ox-beamer.el: Be more cautious about the order in which options
  are defined, at this order will be the same when creating an export
  template (see `org-export-insert-default-template').
* lisp/ox-html.el: Ditto.
* lisp/ox-latex.el: Ditto.
* lisp/ox.el: Ditto.
ox-koma-letter: Reorder keywords in template

* contrib/lisp/ox-koma-letter.el (koma-letter): Reorder keywords in
  a more logical way when `org-export-insert-default-template' is
  called.
Fix dac6d8