Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Hi, I believe this is superseded by the hack in org-hacks.org, so I have marked this patch off on the patchwork server. - Carsten On Jan 12, 2011, at 8:19 AM, Suvayu Ali wrote: Hi Kiwon, On Wed, 12 Jan 2011 12:23:48 +0900 Kiwon Um um.ki...@gmail.com wrote: Dear org users, The recent function for showing current time in agenda view is quite cool. I have a question about it. When the agenda view is being shown, is there any way to refresh it automatically so that makes the current time line always recent? I have thought about that, I even worked up a small minor mode for that (attached). But it doesn't seem to work very well. It updates only the first time but fails subsequently. I am still a lisp newbie. If someone could guide me, I could give it another try. Right now it only updates if any of the agenda file buffers change but I would also like to put a timer. Then if no agenda files have been edited in a while (say 5 mins) the agenda buffer is refreshed anyway. But I don't know how to do that. Any suggestions would be welcome. Thanks. Thanks -- Kiwon Um -- Suvayu Open source is the future. It sets us free. 0001-Implement-org-agenda-refresh-mode-minor- mode.patch___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Hi Kiwon, Kiwon Um um.ki...@gmail.com writes: ;; refresh agenda view regurally (defun kiwon/org-agenda-redo-in-other-window () Call org-agenda-redo function even in the non-agenda buffer. (interactive) (let ((agenda-window (get-buffer-window org-agenda-buffer-name t))) (when agenda-window (with-selected-window agenda-window (org-agenda-redo) (run-at-time nil 300 'kiwon/org-agenda-redo-in-other-window) I added this to org-hacks.org, thanks! -- Bastien ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Suvayu Ali fatkasuvayu+li...@gmail.com wrote: Hi Kiwon, On Wed, 12 Jan 2011 12:23:48 +0900 Kiwon Um um.ki...@gmail.com wrote: Dear org users, The recent function for showing current time in agenda view is quite cool. I have a question about it. When the agenda view is being shown, is there any way to refresh it automatically so that makes the current time line always recent? I have thought about that, I even worked up a small minor mode for that (attached). But it doesn't seem to work very well. It updates only the first time but fails subsequently. I am still a lisp newbie. If someone could guide me, I could give it another try. Right now it only updates if any of the agenda file buffers change but I would also like to put a timer. Then if no agenda files have been edited in a while (say 5 mins) the agenda buffer is refreshed anyway. But I don't know how to do that. Any suggestions would be welcome. You can probably use run-with-timer or run-with-idle-timer to do things like this, but I'm with Detlef Steuer: pressing 'g' in the agenda to refresh it is simple and does not consume any extra resources - you do it when you need to and it's done. I just find the idea of running a timer in order to update a time line in the agenda every once in a while somewhat distasteful, but maybe it's just me. OTOH, I'm being somewhat hypocritical here because I run two visible clocks: one in the gnome panel and one in the emacs mode line with display-time. Having three of them however is clearly overkill :-) Nick ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Hi Nick, On Wed, 12 Jan 2011 03:23:44 -0500 Nick Dokos nicholas.do...@hp.com wrote: You can probably use run-with-timer or run-with-idle-timer to do things like this, but I'm with Detlef Steuer: pressing 'g' in the agenda to refresh it is simple and does not consume any extra resources - you do it when you need to and it's done. I just find the idea of running a timer in order to update a time line in the agenda every once in a while somewhat distasteful, but maybe it's just me. Thanks for the hint. I tried it, works fine. But on reflecting on it some more, I agree with you seems an overkill specially when a simple g does the job. -- Suvayu Open source is the future. It sets us free. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
I would guess that the simple use of 'g' for refreshing was inspired by the Emacs buffer list (induced by C-c C-b; you enter Buffer Menu mode while in that *Buffer List* buffer's window). Discovering 'g' for the buffer list took me a long time, but I was so delighted when I did. -Tommy On Jan 12, 2011 1:33 PM, Suvayu Ali fatkasuvayu+li...@gmail.comfatkasuvayu%2bli...@gmail.com wrote: ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Suvayu Ali fatkasuvayu+li...@gmail.com writes: Hi Nick, On Wed, 12 Jan 2011 03:23:44 -0500 Nick Dokos nicholas.do...@hp.com wrote: You can probably use run-with-timer or run-with-idle-timer to do things like this, but I'm with Detlef Steuer: pressing 'g' in the agenda to refresh it is simple and does not consume any extra resources - you do it when you need to and it's done. I just find the idea of running a timer in order to update a time line in the agenda every once in a while somewhat distasteful, but maybe it's just me. Thanks for the hint. I tried it, works fine. But on reflecting on it some more, I agree with you seems an overkill specially when a simple g does the job. Thanks. Here is my hack for it. It works fine. ;; in the emacs init file ;; refresh agenda view regurally (defun kiwon/org-agenda-redo-in-other-window () Call org-agenda-redo function even in the non-agenda buffer. (interactive) (let ((agenda-window (get-buffer-window org-agenda-buffer-name t))) (when agenda-window (with-selected-window agenda-window (org-agenda-redo) (run-at-time nil 300 'kiwon/org-agenda-redo-in-other-window) -- Kiwon Um ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Dear org users, The recent function for showing current time in agenda view is quite cool. I have a question about it. When the agenda view is being shown, is there any way to refresh it automatically so that makes the current time line always recent? Thanks. -- Kiwon Um ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] org-agenda-show-current-time-in-grid and automatic refresh
Hi Kiwon, On Wed, 12 Jan 2011 12:23:48 +0900 Kiwon Um um.ki...@gmail.com wrote: Dear org users, The recent function for showing current time in agenda view is quite cool. I have a question about it. When the agenda view is being shown, is there any way to refresh it automatically so that makes the current time line always recent? I have thought about that, I even worked up a small minor mode for that (attached). But it doesn't seem to work very well. It updates only the first time but fails subsequently. I am still a lisp newbie. If someone could guide me, I could give it another try. Right now it only updates if any of the agenda file buffers change but I would also like to put a timer. Then if no agenda files have been edited in a while (say 5 mins) the agenda buffer is refreshed anyway. But I don't know how to do that. Any suggestions would be welcome. Thanks. Thanks -- Kiwon Um -- Suvayu Open source is the future. It sets us free. From 82a240bd0af7ac4e7e5935bf38892972f4c7 Mon Sep 17 00:00:00 2001 From: Suvayu Ali fatkasuvayu+li...@gmail.com Date: Tue, 11 Jan 2011 23:17:08 -0800 Subject: [PATCH] Implement org-agenda-refresh-mode minor mode * lisp/org-agenda.el: (org-agenda-refresh-mode) New minor mode to auto-refresh the agenda buffer (org-agenda-refresh-changed) The function used to refresh the Agenda buffer Issue: updates only the first time. --- lisp/org-agenda.el | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index bf36758..d5f11eb 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6780,6 +6780,31 @@ if it was hidden in the outline. (org-back-to-heading) (recenter n))) +(defvar org-agenda-refresh-mode) +(defvar org-agenda-refresh-changed-buffers nil) + +(define-minor-mode org-agenda-refresh-mode + Turn on refresh for Agenda buffer. + nil nil nil + (unless (derived-mode-p 'org-agenda-mode) +(error Not in an Org Agenda buffer)) + (frame-or-buffer-changed-p 'org-agenda-refresh-changed-buffers) + (add-hook 'post-command-hook 'org-agenda-refresh-changed)) + +(defun org-agenda-refresh-changed () + Update Org Agenda buffer. + (interactive) + (when (frame-or-buffer-changed-p 'org-agenda-refresh-changed-buffers) +(let* ((agenda-buf (get-buffer *Org Agenda*))) + (dolist (buf (org-buffer-list 'agenda)) + (ignore-errors + (if (and (buffer-modified-p buf) + (with-current-buffer buf (eq 'org-mode major-mode))) + (with-current-buffer agenda-buf + (when (and org-agenda-refresh-mode + (derived-mode-p 'org-agenda-mode)) + (org-agenda-redo) + (defvar org-agenda-cycle-counter nil) (defun org-agenda-cycle-show (optional n) Show the current entry in another window, with default settings. -- 1.7.3.4 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode