Jean Louis <[email protected]> writes: > Some people maybe access multiple Org files through Agenda, me I > don't. Some items are "non existent" and I do not know how to ask > agenda to refresh itself.
Simply press the letter g.
For my own setup I run code in a hook to update the agenda whenever I
change a TODO state, clock in or clock out, but that has performance
problems when I do it while the Agenda is shown.
(defvar todo-modified-from-agenda nil "Indicates whether org-mode todo
state changes were triggered from the agenda. Check this to avoid trying to
propagate the change back into the agenda")
;; continuously update agenda view, from
http://thomasf.github.io/solarized-css/test/org-hacks.html
(defun kiwon/org-agenda-redo-in-other-window ()
"Call org-agenda-redo function even in the non-agenda buffer."
(interactive)
(when (not (and (boundp 'todo-modified-from-agenda)
todo-modified-from-agenda)) ; org-state non-nil means we’re coming from the
org-after-todo-state-change-hook, which would throw when changing todo states
from agenda due to a circular action
(let ((agenda-window (get-buffer-window (or (and (boundp
'org-agenda-buffer-name) org-agenda-buffer-name) "plan.org") t)))
(when agenda-window
(with-selected-window agenda-window
(org-agenda-redo))))))
;; advice agenda todo to avoid redo, thanks to
http://nullprogram.com/blog/2013/01/22/
(defadvice org-agenda-todo (before org-agenda-disable-redo activate)
(setq todo-modified-from-agenda t))
(defadvice org-agenda-todo (after org-agenda-enable-redo activate)
(setq todo-modified-from-agenda nil))
(add-hook 'org-clock-in-hook 'kiwon/org-agenda-redo-in-other-window)
(add-hook 'org-clock-out-hook 'kiwon/org-agenda-redo-in-other-window)
(add-hook 'org-after-todo-state-change-hook
'kiwon/org-agenda-redo-in-other-window)
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
signature.asc
Description: PGP signature
