From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Sexton Subject: Re: Agenda in the mode-line? Date: Fri, 02 Aug 2013 12:49:00 -0500 Message-ID: References: <874nb86txq.fsf@bzg.ath.cx> <87haf86myt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5JTU-0005Cx-9X for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5JTO-0005Gd-BH for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:49:12 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:54853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5JTO-0005GR-4M for emacs-orgmode@gnu.org; Fri, 02 Aug 2013 13:49:06 -0400 Received: by mail-pd0-f173.google.com with SMTP id p11so910242pdj.4 for ; Fri, 02 Aug 2013 10:49:05 -0700 (PDT) In-Reply-To: <87haf86myt.fsf@gmail.com> (Nick Dokos's message of "Fri, 02 Aug 2013 13:07:06 -0400") 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: Nick Dokos Cc: emacs-orgmode@gnu.org Nick Dokos writes: > 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. That part is beyond my elisp ability, but good to know that the feature doesn't currently exist. > 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. I already have a function for org-mobile to sync, could something like that be hooked into? #+BEGIN_SRC emacs-lisp ;; Push to mobile-org ;; moble sync (defvar org-mobile-sync-timer nil) (defvar org-mobile-sync-idle-secs (* 60 10)) (defun org-mobile-sync () (interactive) (org-mobile-pull) (org-mobile-push)) (defun org-mobile-sync-enable () "enable mobile org idle sync" (interactive) (setq org-mobile-sync-timer (run-with-idle-timer org-mobile-sync-idle-secs t 'org-mobile-sync))) (defun org-mobile-sync-disable () "disable mobile org idle sync" (interactive) (cancel-timer org-mobile-sync-timer)) (org-mobile-sync-enable) #+END_SRC -- Kyle Sexton