From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Agenda in the mode-line? Date: Fri, 02 Aug 2013 13:07:06 -0400 Message-ID: <87haf86myt.fsf@gmail.com> References: <874nb86txq.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5Ip6-0001S2-Cg for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:07:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5Ip1-0007kn-GP for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:07:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:38813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5Ip1-0007kL-AT for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:07:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V5Iow-0008H6-0G for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 19:07:18 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Aug 2013 19:07:18 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Aug 2013 19:07:18 +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 Kyle Sexton writes: > Bastien writes: > >> Kyle Sexton writes: >> >>> Does anyone know if there is a feature to show something like 'Tasks: 4' >>> on the mode-line for tasks that are currently open? >> >> This is the default behavior since long: hitting "I" to clock in a >> task in the agenda or C-c C-x C-i in an Org buffer will append the >> task name to the modeline, together with the time spent. >> >> Don't you have this? Even with emacs -Q? >> > > Sorry, it appears I didn't make my use case very clear. What you are > speaking of is clocking into a task, and indeed that does show up on the > modeline. > > What I am after is more of a overview of "How many total TODO tasks do I > have", ideally with some function to limit or match based on tag. > > Something like this in the modeline: > > #+BEGIN_EXAMPLE > [Work: 3/10 Home: 2/20] > ^--- Total number of TODOs in home.org > ^------ Total number of TODOs due today in home.org > #+END_EXAMPLE > > That way I have a constant reminder of the number of things left without > having to pull up the agenda. > I don't think the feature exists but it should be buildable - although I think it is not exactly simple. It should be easy to write a function that uses the org mapping API to produce a string of the form "[Work: 3/10 Home: 2/20]" and assign it to a variable, say mode-line-org-tasks. The variable can be added to mode-line-format. The problem is to force mode-line redisplay when things change, e.g. when you mark a TODO task DONE, or add another task to work.org. If the file gets modified, then filenotify.el can be used, but since the agenda files are kept open, the buffer is modified but the file is not (until the buffer is saved) and I'm not sure how to detect such changes and propagate them to the mode line. I thought there must be a hook to allow this, but I haven't found one yet. The rather yucky alternative is to poll the relevant buffers (say once a minute) to see if they are modified and if so, run the function to set the variable and force mode-line redisplay. -- Nick