[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Agenda in the mode-line?

From: Kyle Sexton
Subject: Re: [O] Agenda in the mode-line?
Date: Fri, 02 Aug 2013 12:49:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin)

Nick Dokos <address@hidden> 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 ()
(defun org-mobile-sync-enable ()
  "enable mobile org idle sync"
  (setq org-mobile-sync-timer
        (run-with-idle-timer org-mobile-sync-idle-secs t
(defun org-mobile-sync-disable ()
  "disable mobile org idle sync"
  (cancel-timer org-mobile-sync-timer))

Kyle Sexton

reply via email to

[Prev in Thread] Current Thread [Next in Thread]