From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noah Slater Subject: Re: Sorting nodes by clocked time Date: Sun, 20 Apr 2014 11:48:25 +0200 Message-ID: References: <87zjjk5p9q.fsf@bzg.ath.cx> <87ioq82pk9.fsf@bzg.ath.cx> <87a9bk2pbc.fsf@bzg.ath.cx> <87lhv442xy.fsf@bzg.ath.cx> <87mwfkb26u.fsf@bzg.ath.cx> <87eh0wb0qh.fsf@bzg.ath.cx> <86k3an8pmm.fsf@sachachua.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11381bdec1496f04f776487c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WboMR-0007zp-IR for emacs-orgmode@gnu.org; Sun, 20 Apr 2014 05:48:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WboMM-0008Oa-Ec for emacs-orgmode@gnu.org; Sun, 20 Apr 2014 05:48:31 -0400 Received: from mail-yh0-x233.google.com ([2607:f8b0:4002:c01::233]:54115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WboMM-0008OV-9G for emacs-orgmode@gnu.org; Sun, 20 Apr 2014 05:48:26 -0400 Received: by mail-yh0-f51.google.com with SMTP id f10so2712584yha.24 for ; Sun, 20 Apr 2014 02:48:25 -0700 (PDT) In-Reply-To: <86k3an8pmm.fsf@sachachua.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sacha Chua Cc: emacs-orgmode@gnu.org --001a11381bdec1496f04f776487c Content-Type: text/plain; charset=ISO-8859-1 Thanks Sacha, that's great! On 18 April 2014 02:09, Sacha Chua wrote: > Noah Slater writes: > > Hello, Noah, all! > > > Using this a bit, it doesn't quite do what I want it to do. > > Is there any way to sort recursively? > > At the moment, calling org-sort-entries on the whole buffer only sorts > the > > top level nodes. > > Here's a rather inefficient hack (but hey, it seems to work =) ): > > (defun sacha/org-sort-recursively (type) > (org-map-entries > (lambda () > (condition-case nil > (org-sort-entries nil type) > (error nil))))) > > Call with M-: (sacha/org-sort-recursively ?K) or merge the code into > your own. > > Sacha > > > --001a11381bdec1496f04f776487c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Sacha, that's great!


On 18 April 2014 02:09, Sacha Chua= <sacha@sachachua.com> wrote:
Noah Slater <nslater@tumbolia.org> writes:

Hello, Noah, all!

> Using this a bit, it doesn't quite do what I want it to do.
> Is there any way to sort recursively?
> At the moment, calling org-sort-entries on the whole buffer only sorts= the
> top level nodes.

Here's a rather inefficient hack (but hey, it seems to work =3D) = ):

(defun sacha/org-sort-recursively (type)
=A0 =A0 =A0 =A0 (org-map-entries
=A0 =A0 =A0 =A0 =A0(lambda ()
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(condition-case nil
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-sor= t-entries nil type)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(error nil)))))

Call with M-: (sacha/org-sort-recursively ?K) or merge the code into
your own.

Sacha



--001a11381bdec1496f04f776487c--