I came up with this:

(defun my-sort-buffer ()
  (interactive)
  (mark-whole-buffer)
  (org-sort-entries t ?K)
  (org-overview))

Seems to do what I want. This is most excellent. Making some great progress here. Thanks. And I will send you a token of my gratitude at the end of the month, when I have funds available. 




On 17 April 2014 14:26, Bastien <bzg@gnu.org> wrote:
Noah Slater <nslater@tumbolia.org> writes:

> Okay, wow. Thanks for writing that. Do you have a Gittip or
> something? I would love to support your OSS work in some way or
> otherwise show my gratitude beyond words in an email!

You can use my paypal account: bastien.guerry@free.fr

Thanks!

> Anyway. I tried your function and it works. But afterwards, the node
> is completely folded. So I added (org-cycle) to the sequence of
> functions inside save-restriction. That seems to work, but I'm no
> elisp/Org pro. Is this how you would have done it?

Well, quite long explanations would follow... I'll let you discover by
reading the code and by trial-and-error for now, need to run!

--
 Bastien