From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Sort TODOs in agenda day Date: Wed, 01 Feb 2012 07:51:59 -0500 Message-ID: <87ipjqhg28.fsf@norang.ca> References: <9d834356-f72b-440a-91af-fee555f76c32@CERNFE22.cern.ch> <87mx94lnjy.fsf@norang.ca> <4d473cc8-5801-4545-8b93-2b72157878de@CERNFE22.cern.ch> <8762frkbyz.fsf@norang.ca> <944812b5-d705-48d5-8ad0-aa5305f43352@CERNFE23.cern.ch> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsZfg-0000lV-Tz for emacs-orgmode@gnu.org; Wed, 01 Feb 2012 07:52:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsZfa-0003PC-Tq for emacs-orgmode@gnu.org; Wed, 01 Feb 2012 07:52:20 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:53949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsZfa-0003Ob-Rc for emacs-orgmode@gnu.org; Wed, 01 Feb 2012 07:52:14 -0500 In-Reply-To: <944812b5-d705-48d5-8ad0-aa5305f43352@CERNFE23.cern.ch> (Jacek Generowicz's message of "Wed, 1 Feb 2012 11:02:31 +0100") 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: Jacek Generowicz Cc: emacs-orgmode@gnu.org Jacek Generowicz writes: > At Tue, 31 Jan 2012 12:39:48 -0500, > Bernt Hansen wrote: >> >> Jacek Generowicz writes: >> >> > Yes, but how do I instruct it to apply one strategy (time-up) to those >> > items which appear in the time-grid portion of the day's display (the >> > appointments), and a different one to the other entries (scheduled >> > TODOs, deadlines)? Specifically, by adding a command to >> > >> > org-agenda-custom-commands >> > >> > which contains something like >> > >> > ((agenda "" >> > ((org-agenda-sorting-strategy '(effort-up))))) >> > >> > messes up the time ordering of appointments for that command. >> >> I have a fairly complicated sorting function which gets the order of >> items exactly how I want to see them on the agenda. >> >> The gory details are here: >> >> http://doc.norang.ca/org-mode.html#AgendaViewTweaks > > I see. Should I infer that org-mode doesn't provide any features for > applying different strategies to different portions of single day's > display in the agenda? > > In other words there are no hooks into the standard agenda sorting > strategy, and if you want to modify its behaviour you essentially have > to roll your own from scratch, duplicating much of the original > effort? Not necessarily, if the standard sorting mechanism with an appropriate setting for org-agenda-sorting-strategy does what you need then there is no reason to create a user-defined sorting function (which is what I did). You can add BOTH time-up and effort-up to the sorting strategy for the agenda and time will prevail - for items with a time, and effort will be the next sorting criteria. Have you tried this? ;; Sorting order for tasks on the agenda (setq org-agenda-sorting-strategy (quote ((agenda time-up effort-up)))) When I was first experimented with the sorting strategy I used the customize interface to set it for the current session only and looked at the result of my agenda with the new setting. The reason I define and use a user-defined-up sorting function is I want complete control over where each type of item goes in my agenda. My setting for the agenda is below: (setq org-agenda-sorting-strategy (quote ((agenda habit-down time-up user-defined-up priority-down effort-up category-keep) (todo category-up priority-down effort-up) (tags category-up priority-down effort-up) (search category-up)))) so for the agenda daily view habits are at the bottom, and timed items are at the top, then my user-defined sorting function sorts what is left for the middle section of the list in the following order: - items with no schedule/deadline and timestamped for today - deadlines for today - late deadlines - scheduled items for today - late scheduled items - and pending deadlines last Regards, Bernt > >> HTH, > > Yup. > > Thanks.