From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Dimming ancestors in the agenda (relevant to indenting nested TODOs in agenda views) Date: Wed, 24 Aug 2011 15:07:17 +0800 Message-ID: <87mxez8eze.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw7Yn-0004pl-3v for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 03:07:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qw7Ym-0004VR-61 for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 03:07:37 -0400 Received: from lo.gmane.org ([80.91.229.12]:37605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw7Yl-0004VE-Pg for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 03:07:36 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qw7Yk-0008GY-T3 for emacs-orgmode@gnu.org; Wed, 24 Aug 2011 09:07:34 +0200 Received: from 123.115.194.157 ([123.115.194.157]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 09:07:34 +0200 Received: from eric by 123.115.194.157 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 09:07:34 +0200 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: emacs-orgmode@gnu.org On Wed, Aug 24 2011, Samuel Wales wrote: > Here is a different solution. It is from my notes from long ago. > > To me, one issue with indenting is that you expect the previous line > to be a direct parent, analogously with the outline. This conflicts > with sorting and non-child descendents. > > If you sort, you can't take advantage of the feature and have it look > right. If it's not a direct child, you can't take advantage of it > either because you either confusingly indent too much or modify the > semantics. Also, indenting interferes with putting as much > information on the line as possible. Those with large fonts or small > (e.g. mobile) displays value the real estate. > > === > > Here is an alternate, which might or might not satisfy the OP's needs > tangentially, but might spark discussion in either case. > > One feature I have long wanted, but have not been able to implement, > is to dim (or color) any agenda entry that has a descendant in the > same agenda view. > > === > > This is a completely different thing from dimming blocked > tasks, because it only looks at other tasks in the same > view, and doesn't care about todo keywords. > > The pseudocode is this: > > loop for i in all headlines in agenda (even a combined agenda) > if i has an ancestor in agenda, dim that ancestor > This is interesting, and certainly could be a potential display option. It still sort of begs the question of how to get level and/or child/ancestor information attached to the collected TODOs as they're being produced for the agenda views. I'm starting with the easiest use-case: attaching a "level" text property to each TODO. I'm trying to do this for TODOs produced by `org-todo-list' (used by the ?t and ?T dispatch commands) and `org-tags-view' (used by the ?m and ?M dispatchers). The former employs `org-agenda-get-day-entries' and then `org-agenda-get-todos' to find its TODOs, the latter uses `org-scan-tags'. I've put code into both `org-agenda-get-todos' and `org-scan-tags' that attaches a "level" property to outgoing TODOs, and so far that's working okay. A smarter thing to do would probably be attaching a "parent" property that points to the parent headline. Different display options could then use that information to munge the agenda display in different ways: dimming, indenting, prefixing a path, etc. Anyway, I'm just thinking out loud here! If the org gurus have any pointers or warnings, that would be appreciated… Eric