From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Agenda TODO sorting by date Date: Fri, 02 Mar 2012 21:48:42 -0500 Message-ID: <87399qielx.fsf@norang.ca> References: <87pqcu4duz.wl%jamshark70@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3f1d-00083Q-7G for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 21:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3f1b-0003wc-Eo for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 21:48:48 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:10719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3f1b-0003wT-BU for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 21:48:47 -0500 In-Reply-To: <87pqcu4duz.wl%jamshark70@dewdrop-world.net> (James Harkins's message of "Sat, 03 Mar 2012 10:28:36 +0800") 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: James Harkins Cc: emacs-orgmode@gnu.org James Harkins writes: > Given this: > > * Category 1 > ** TODO First todo in file <2012-03-30 Fri> :Tag: > ** TODO Second todo in file <2012-03-29 Thu> :Tag: > * Category 2 > ** TODO Third todo in file <2012-03-28 Wed> :Tag: > ** TODO Fourth todo in file <2012-03-31 Sat> :Tag: > > I do C-c a < M Tag and get: > > Headlines with TAGS match: Tag > Press `C-u r' to search again with new search string > todo_sort: TODO First todo in file <2012-03-30 Fri> :Tag: > todo_sort: TODO Second todo in file <2012-03-29 Thu> :Tag: > todo_sort: TODO Third todo in file <2012-03-28 Wed> :Tag: > todo_sort: TODO Fourth todo in file <2012-03-31 Sat> :Tag: > > I want to configure a custom agenda command so that I get: > > Headlines with TAGS match: Tag > Press `C-u r' to search again with new search string > todo_sort: TODO Third todo in file <2012-03-28 Wed> :Tag: > todo_sort: TODO Second todo in file <2012-03-29 Thu> :Tag: > todo_sort: TODO First todo in file <2012-03-30 Fri> :Tag: > todo_sort: TODO Fourth todo in file <2012-03-31 Sat> :Tag: > > How do I do this? You could write a custom sorting function that parses out the date from the heading and compares them. There may be a better way to do this that I'm not aware of for this. Set this function up in org-agenda-cmp-user-defined and org-agenda-sorting-strategy to get the results you want. HTH, Bernt