From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Sort TODOs in agenda day Date: Thu, 02 Feb 2012 21:06:35 -0500 Message-ID: <87fweseklw.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> <87ipjqhg28.fsf@norang.ca> <58b1290a-d578-477e-b5ad-c9d77cb02a52@CERNFE23.cern.ch> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt8Y3-00064j-KJ for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 21:06:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt8Y2-0002iX-7Y for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 21:06:47 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:20514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt8Y2-0002iL-4g for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 21:06:46 -0500 In-Reply-To: <58b1290a-d578-477e-b5ad-c9d77cb02a52@CERNFE23.cern.ch> (Jacek Generowicz's message of "Thu, 2 Feb 2012 10:24:56 +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 Wed, 1 Feb 2012 07:51:59 -0500, > Bernt Hansen wrote: > >> 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. > > Yes, setting configurations for current session only is a huge boon > for trials, but the clunky customize interface for manipulating the > values is a bit annoying compared to Emacs' built in sexpr > manipulation. Swapping the order of two sorting strategy entries, for > example, is very painful compared to C-M-t. Is there some convenient > way of, say, swapping entries in the customize interface? I would probably show the current customize setting, paste it to the scratch buffer and wrap it in a (setq VARIABLE-NAME ...) and then edit it and C-M-t, then go back to the customize view to tweak other settings. The main advantage of customize is it won't break the format. I used customize almost exclusively for 2 years when I was working with my org-mode files and have since moved to setq's only since I'm now comfortable with the elisp sexp settings. > >> (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: > > It's still not entirely clear to me how these options work. Take > habit-down, at the beginning. What do the '-down' and '-up' mean? I > infer that they might have one of two meanings: in 'habit-down' the > '-down' seems to mean that habits should be placed at the bottom, > while in 'effort-down' I infer that it means that items with an effort > property should be sorted by decreasing effort, relative to eachother. > > There's clearly some confusion in my mind about how these work. I came up with my current settings with a bunch of trial and error until it did what I wanted - then I moved on to something else. I'm not sure I understand all of it either :) > >> - 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 > > Incidentally, why did you need to create a macro which captures num-a, > num-b result, for your implementation of bh/agenda-sort? AFAICT, > functions which return +1,-1 or nil would have been adeqate here. What > have I missed? Honestly I can't remember... I was experimenting with macros for the first time when I wrote this. The function that is called is passed in as the first argument but if an elisp function can do the job then the macro probably isn't required. What I have works now... so I'm not sure I want to try to fix it :) Regards, Bernt