From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: ANN: org-super-agenda Date: Fri, 28 Jul 2017 20:00:40 -0500 Message-ID: <871sp0f45j.fsf@alphapapa.net> References: <87eft25n61.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbG7t-0005bw-Ki for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 21:01:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbG7o-0000s8-TI for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 21:01:05 -0400 Received: from [195.159.176.226] (port=58221 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbG7o-0000ps-MF for emacs-orgmode@gnu.org; Fri, 28 Jul 2017 21:01:00 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dbG7X-0005iK-FD for emacs-orgmode@gnu.org; Sat, 29 Jul 2017 03:00:43 +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" To: emacs-orgmode@gnu.org Eric S Fraga writes: > Hi Adam, > > have now given this a try. Looks really nice. Some questions, if I > may. I would like to have the following sections: Hi Eric, Thanks, I appreciate your feedback. > 1. items that have deadlines, any deadline for now and in the future, > whether scheduled or not. > 2. items that have a specific TODO type whether scheduled or not. Well, as it stands, this package is mainly a way to group together items that the standard agenda view (i.e. the org-agenda-list function) has gathered. The standard agenda view uses org-agenda-get-day-entries for that. What I think you're wanting is already provided by, e.g. the org-todo-list function. So you could add that as a separate section in a custom agenda series command. Now if you're wanting to use the grouping ability on the global TODO list provided by org-todo-list, that is a possibility, but it would require my essentially copying the org-todo-list function and making it available under a new name that does the grouping. This is what I did with the org-agenda-list function: I just copied it and made one change that calls my grouping/inserting functions instead of inserting results directly. The problem with this approach in general is that I end up copying large Org agenda functions (and they are large) and making minor changes to them, and then they will get out of sync when those functions change in Org. So the question becomes, how many Org agenda functions do I want to copy into my package and be responsible for fixing? I considered an alternative approach of post-processing agenda buffers, instead of doing the filtering and inserting myself, but considering all the special blocks that agenda buffers can have (e.g. clockreports, timelines, etc), I decided that down that path lies madness. ;) So I'm not sure how far I should go with adding these other agenda types to this package. It would be nice if the agenda functions in Org itself could be modified to accept grouping functions like this (it's a minor change, really, to call a function to do insertion instead of doing it directly), and that's something that I'd eventually like to propose to the maintainers. > 3. a clock summary (equivalent to what one gets with "v c" in standard > view) I confess that I have never used this feature before you mentioned it. :) I tried to investigate this, but I've hit somewhat of a dead end: the org-agenda-show-log-scoped variable, which is bound by org-agenda-list, for some reason becomes unbound in org-super-agenda, which doesn't seem to make sense, since it is just a copy of org-agenda-list. And even using edebug and stepping through everything I can find, I can't figure out why it becomes unbound. ...And, having written that, it suddenly occurred to me: I wonder if org-agenda-show-log-scoped is defined with defvar...and I see that it is not...and so I tried doing it...and it seems to have fixed that problem. I guess I don't realy know anything until I explain it to someone else. :) Now I can go ahead and add that defvar to my package for now, but it should probably be added to Org itself. It might be considered a bug fix, but on the other hand, if it only happens with my non-standard package... Anyway, I will add this to my package and upload it shortly. Please let me know if it fixes the clockcheck command for you. > 4. a clock report at the end (and really the end, after all other > items) As far as I know, this already works. Just press "R" in the agenda buffer. Please let me know if it doesn't work for you. After thinking about this some more, I have an idea: if I go ahead and import the agenda-building functions into my package and modify them, I can use a minor mode to override the standard functions with advice. That way users would only have to define the groups variable, and all the agenda commands would pick it up automatically, from the user's perspective. That would prevent users from having to define new agenda commands that call special functions; they could just use their existing custom agenda commands. I will look into this and push it to the repo if it works. Please let me know if you have any other ideas or suggestions. Thanks, Adam