org.el (org-entry-get): Fix inheritance problem

* org.el (org-entry-get): Only try to combine file properties
with local properties when the property drawer contains such
local property, not when the property drawer exists.

Before the fix, `org-entry-get' behavior was inconsistent,
returning `nil' when looking for a property in a subtree with
no property drawer, and returning the global properties in a
subtree with a property drawer, independantly of whether this
property drawer contained a reference to the property we are checking
against or not.

As a side-effect, inheritance was broken for the case that
Ilya reported in commit 475f2f53, because `org-entry-get' returned
a value (with the global properties of the file) too early.

Thanks to Ilya for raising this bug and to Achim for pointing
out that the previous fix was wrong.
Merge branch 'maint'
org.el (org-entry-get-with-inheritance): Remove wrong quote

* org.el (org-entry-get-with-inheritance): Remove wrong quote.
org-timer.el: Silent compiler warnings
Merge branch 'maint'
ox-latex.el (org-latex-link): Escape `%' characters

* ox-latex.el (org-latex-link): Escape `%' characters.
Merge branch 'maint'
org-attach.el: Allow to attach files starting with a dot

* org-attach.el (org-attach-sync, org-attach-file-list): Allow
to attach files starting with a dot.

Thanks to Oleh for requesting this and providing a patch.
org-agenda.el (org-agenda-open-link): Bugfix

* org-agenda.el (org-agenda-open-link): Don't throw an error
when trying to open a link when the point is on a place that
is not associated with a buffer.
Merge branch 'maint'
org-agenda.el (org-agenda-todo): Restore the window correctly

* org-agenda.el (org-agenda-todo): Always restore the window
state after `org-agenda-change-all-lines' has been called.

`org-agenda-change-all-lines' is narrowing to the line it needs to
update.  In the narrowed state, `org-agenda-finalize' is called,
which may lead to a change in the way the window is displayed.  We
use `save-window-excursion' to ensure the window state is restored
correctly.

Thanks to Francesco Pizzolante for reporting this with a
detailed recipe.
Merge branch 'maint'
org.el: Only set org-hide foreground if one is available

* org.el (org-mode): Add guard around set-face-foreground.

TINYCHANGE
Merge branch 'maint'
org-capture.el: Allow `:table-line-pos' to be a function name, a string or a variable

* lisp/org-capture.el (org-capture-place-table-line): If the value of
`:table-line-pos' is a function name, used its return value to set the
position inside the table.  The return value must be a string like
"II-3".  Else `:table-line-pos' is 'eval'ed.

TINYCHANGE
docu change for table-line-pos new feature

* org.texi (Template elements): Document new features of
`:table-line-pos' in capture templates.

TINYCHANGE
org-clock.el (org-clock-get-table-data): Bugfix

* org-clock.el (org-clock-get-table-data): When :link is `t'
in the clocktable parameters, bracket links in the clocktable
should only contain their description, other C-c C-o will try
to open the bracket link at point instead of the headline.

Thanks to Alexey Lebedeff for providing a preliminary patch for this.
Merge branch 'maint'
ox-html.el: Enhance docstrings

* ox-html.el (org-html-table-header-tags)
(org-html-table-data-tags): Enhance docstrings.
org.texi (Tables in HTML export): Enhance.

* org.texi (Tables in HTML export): Mention the grouping of
columns, add documentation for variables.