Org sometimes hits a "Before first heading" error. This error happens
when `outline-back-to-heading' is called before the first heading in a
buffer. In normal use, this is something easy to fix, because of
course you know where you are and you can identify the problem.
However, when Org scans many different buffers, for example to collect
agenda entries, you may not be able to tell easily where this error
happened. This patch introduces a wrapper around
`outline-back-to-heading', with improving the error message by
spelling out buffer and location.
These are changes that where made in the Emacs CVS.
The change in org-publish is not final, it is still being
discussed - however, the current change should make it possible
to compile and run the code with the latest CVS version of Emacs.