* org-mode and appointments @ 2008-02-25 23:09 Bernt Hansen 2008-02-26 16:06 ` Carsten Dominik 2008-02-26 16:19 ` Bastien 0 siblings, 2 replies; 15+ messages in thread From: Bernt Hansen @ 2008-02-25 23:09 UTC (permalink / raw) To: emacs-orgmode Hi Bastien, I'm using your function for creating appointments: ,----[ my-org-agenda-to-appt in .emacs ] | ;; Make appt aware of appointments from the agenda | (defun my-org-agenda-to-appt (&optional filter) | "Activate appointments found in `org-agenda-files'. | When prefixed, prompt for a regular expression and use it as a | filter: only add entries if they match this regular expression. | | FILTER can be a string. In this case, use this string as a | regular expression to filter results. | | FILTER can also be an alist, with the car of each cell being | either 'headline or 'category. For example: | | '((headline \"IMPORTANT\") | (category \"Work\")) | | will only add headlines containing IMPORTANT or headlines | belonging to the category \"Work\"." | (interactive "P") | (require 'org) | (require 'calendar) | (if (equal filter '(4)) | (setq filter (read-from-minibuffer "Regexp filter: "))) | (let* ((cnt 0) ; count added events | (today (org-date-to-gregorian | (time-to-days (current-time)))) | (files org-agenda-files) entries file) | ;; Get all entries which may contain an appt | (while (setq file (pop files)) | (setq entries | (append entries | (org-agenda-get-day-entries | file today | :timestamp :scheduled :deadline)))) | (setq entries (delq nil entries)) | ;; Map thru entries and find if they pass thru the filter | (mapc | (lambda(x) | (let* ((evt (org-trim (get-text-property 1 'txt x))) | (cat (get-text-property 1 'org-category x)) | (tod (get-text-property 1 'time-of-day x)) | (ok (or (null filter) | (and (stringp filter) (string-match filter evt)) | (and (listp filter) | (or (string-match | (cadr (assoc 'category filter)) cat) | (string-match | (cadr (assoc 'headline filter)) evt)))))) | ;; FIXME Shall we remove text-properties for the appt text? | ;; (setq evt (set-text-properties 0 (length evt) nil evt)) | (when (and ok tod) | (setq tod (number-to-string tod) | tod (when (string-match | "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod) | (concat (match-string 1 tod) ":" | (match-string 2 tod)))) | (appt-add tod evt) | (setq cnt (1+ cnt))))) entries) | (message "Added %d event%s for today" cnt (if (> cnt 1) "s" "")))) `---- and this has been working pretty well for me. I really appreciate you posting this on the list (a long time ago :) ) I have a function key binding to rerun this function when I add new appointments for today. ,----[ Activate the appointments in .emacs ] | (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) | ;; Get appointments for today | (my-org-agenda-to-appt) | (appt-activate t) `---- I have the following wishlist items for this function but don't currently have the lisp skills to fix it. - [ ] Clear the appointment list when rerunning the my-org-agenda-to-appt If I move an appointment to anther day and use f9-a the old appointment reminder is still there and bugs me when the time rolls around. I only use org appointment entries so clearing the list should be trivial. I don't use diary entries anymore. - [ ] Future deadlines are reported for today. I have an installation deadline at 8PM on Thursday. Since it's a deadline it shows up in my agenda today with a 3 day warning... and my-org-agenda-to-appt picks this up and makes an appointment for today -- which is incorrect. I don't need an appointment for this until Thursday. - [ ] If I leave Emacs running overnight is there a good way to reset the appointment list at midnight? What do I need to do to this function to fix these issues? Any input is greatly appreciated :) Regards, Bernt ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-25 23:09 org-mode and appointments Bernt Hansen @ 2008-02-26 16:06 ` Carsten Dominik 2008-02-26 16:09 ` Carsten Dominik 2008-02-26 16:19 ` Bastien 1 sibling, 1 reply; 15+ messages in thread From: Carsten Dominik @ 2008-02-26 16:06 UTC (permalink / raw) To: Bernt Hansen; +Cc: emacs-orgmode Hi Bernt, Bastien is quite busy, so let me replay On Feb 26, 2008, at 12:09 AM, Bernt Hansen wrote: > Hi Bastien, > > I'm using your function for creating appointments: > > ,----[ my-org-agenda-to-appt in .emacs ] > | ;; Make appt aware of appointments from the agenda > | (defun my-org-agenda-to-appt (&optional filter) > | "Activate appointments found in `org-agenda-files'. > | When prefixed, prompt for a regular expression and use it as a > | filter: only add entries if they match this regular expression. > | > | FILTER can be a string. In this case, use this string as a > | regular expression to filter results. > | > | FILTER can also be an alist, with the car of each cell being > | either 'headline or 'category. For example: > | > | '((headline \"IMPORTANT\") > | (category \"Work\")) > | > | will only add headlines containing IMPORTANT or headlines > | belonging to the category \"Work\"." > | (interactive "P") > | (require 'org) > | (require 'calendar) > | (if (equal filter '(4)) > | (setq filter (read-from-minibuffer "Regexp filter: "))) > | (let* ((cnt 0) ; count added events > | (today (org-date-to-gregorian > | (time-to-days (current-time)))) > | (files org-agenda-files) entries file) > | ;; Get all entries which may contain an appt > | (while (setq file (pop files)) > | (setq entries > | (append entries > | (org-agenda-get-day-entries > | file today > | :timestamp :scheduled :deadline)))) > | (setq entries (delq nil entries)) > | ;; Map thru entries and find if they pass thru the filter > | (mapc > | (lambda(x) > | (let* ((evt (org-trim (get-text-property 1 'txt x))) > | (cat (get-text-property 1 'org-category x)) > | (tod (get-text-property 1 'time-of-day x)) > | (ok (or (null filter) > | (and (stringp filter) (string-match filter evt)) > | (and (listp filter) > | (or (string-match > | (cadr (assoc 'category filter)) cat) > | (string-match > | (cadr (assoc 'headline filter)) evt)))))) > | ;; FIXME Shall we remove text-properties for the appt text? > | ;; (setq evt (set-text-properties 0 (length evt) nil evt)) > | (when (and ok tod) > | (setq tod (number-to-string tod) > | tod (when (string-match > | "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod) > | (concat (match-string 1 tod) ":" > | (match-string 2 tod)))) > | (appt-add tod evt) > | (setq cnt (1+ cnt))))) entries) > | (message "Added %d event%s for today" cnt (if (> cnt 1) "s" > "")))) > `---- > > and this has been working pretty well for me. I really appreciate you > posting this on the list (a long time ago :) ) > > I have a function key binding to rerun this function when I add new > appointments for today. > > ,----[ Activate the appointments in .emacs ] > | (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > | ;; Get appointments for today > | (my-org-agenda-to-appt) > | (appt-activate t) > `---- > > I have the following wishlist items for this function but don't > currently have the lisp skills to fix it. > > - [ ] Clear the appointment list when rerunning the > my-org-agenda-to-appt > If I move an appointment to anther day and use f9-a the old > appointment reminder is still there and bugs me when the time > rolls around. > I only use org appointment entries so clearing the list should > be > trivial. I don't use diary entries anymore. In this case, setting `appt-time-msg-list' to nil before calling my- org-agenda-to-appt should be fine. BTW, org.el contains `org-agenda-to-appt' which is a very slightly improved version of this function, so no need to keep it in .emacs. > - [ ] Future deadlines are reported for today. > I have an installation deadline at 8PM on Thursday. Since > it's a > deadline it shows up in my agenda today with a 3 day warning... > and my-org-agenda-to-appt picks this up and makes an appointment > for today -- which is incorrect. I don't need an appointment > for > this until Thursday. Do (let ((org-deadline-warning-days 0)) around the call. Actually, yes, this should be part f org-agenda-to- appt, I will put it in. But for now you can do it in your update function. There is a bug in the documentation of org-deadline-warning-days saying that only negative numbers will be enforced. In fact, 0 will also be enforced. > - [ ] If I leave Emacs running overnight is there a good way to reset > the appointment list at midnight? Take a look at the function `run-at-time'. This could be set up in .emacs, better to not execute this each time you update your appointment list. So to summarize, this is really all you need in .emacs: ;; Get appointments for today (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) (defun my-org-agenda-to-appt () (interactive) (let ((org-deadline-warning-days 0)) ;; will be automatic in org 5.23 (org-agenda-to-appt))) (my-org-agenda-to-appt) (appt-activate t) (run-at-time "24:01" nil 'my-org-agenda-to-appt) ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-26 16:06 ` Carsten Dominik @ 2008-02-26 16:09 ` Carsten Dominik 2008-02-26 16:14 ` Bernt Hansen 2008-02-27 1:01 ` Russell Adams 0 siblings, 2 replies; 15+ messages in thread From: Carsten Dominik @ 2008-02-26 16:09 UTC (permalink / raw) To: Carsten Dominik; +Cc: Bernt Hansen, emacs-orgmode On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: [...] I forgot to clear the list: So to summarize, this is really all you need in .emacs: ;; Get appointments for today (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) (defun my-org-agenda-to-appt () (interactive) (setq appt-time-msg-list nil) (let ((org-deadline-warning-days 0)) ;; will be automatic in org 5.23 (org-agenda-to-appt))) (my-org-agenda-to-appt) (appt-activate t) (run-at-time "24:01" nil 'my-org-agenda-to-appt) > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-26 16:09 ` Carsten Dominik @ 2008-02-26 16:14 ` Bernt Hansen 2008-02-27 1:01 ` Russell Adams 1 sibling, 0 replies; 15+ messages in thread From: Bernt Hansen @ 2008-02-26 16:14 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Carsten Dominik <carsten.dominik@gmail.com> writes: > On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: > > [...] > > I forgot to clear the list: > > So to summarize, this is really all you need in .emacs: > > ;; Get appointments for today > (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > (defun my-org-agenda-to-appt () > (interactive) > (setq appt-time-msg-list nil) > (let ((org-deadline-warning-days 0)) ;; will be automatic in org > 5.23 > (org-agenda-to-appt))) > (my-org-agenda-to-appt) > (appt-activate t) > (run-at-time "24:01" nil 'my-org-agenda-to-appt) > >> Thanks!! -Bernt ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-26 16:09 ` Carsten Dominik 2008-02-26 16:14 ` Bernt Hansen @ 2008-02-27 1:01 ` Russell Adams 2008-02-28 0:55 ` Russell Adams 1 sibling, 1 reply; 15+ messages in thread From: Russell Adams @ 2008-02-27 1:01 UTC (permalink / raw) To: emacs-orgmode Great combined feature: http://alfredobuttari.wordpress.com/2008/02/08/emacs-appt-mode-reminders-with-gtk-popups/ I'm still trying to get this to work reliably, either appointments or calling out to a gtk popup, but I look forward to using it soon. Thanks. On Tue, Feb 26, 2008 at 05:09:39PM +0100, Carsten Dominik wrote: > > On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: > > [...] > > I forgot to clear the list: > > So to summarize, this is really all you need in .emacs: > > ;; Get appointments for today > (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > (defun my-org-agenda-to-appt () > (interactive) > (setq appt-time-msg-list nil) > (let ((org-deadline-warning-days 0)) ;; will be automatic in org > 5.23 > (org-agenda-to-appt))) > (my-org-agenda-to-appt) > (appt-activate t) > (run-at-time "24:01" nil 'my-org-agenda-to-appt) > > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-27 1:01 ` Russell Adams @ 2008-02-28 0:55 ` Russell Adams 2008-02-28 1:04 ` Bernt Hansen 0 siblings, 1 reply; 15+ messages in thread From: Russell Adams @ 2008-02-28 0:55 UTC (permalink / raw) To: emacs-orgmode Ok, so how far in advance is appt supposed to alert you? I'm testing this, and I've gotten zenity to do a popup, and I've tied the refresh of the appt list to the agenda refresh with: (add-hook 'org-finalize-agenda-hook 'my-org-agenda-to-appt) I'm testing a series of timings before I start relying on this, and trying to understand the behavior. Any comments? Thanks. On Tue, Feb 26, 2008 at 07:01:15PM -0600, Russell Adams wrote: > Great combined feature: > > http://alfredobuttari.wordpress.com/2008/02/08/emacs-appt-mode-reminders-with-gtk-popups/ > > I'm still trying to get this to work reliably, either appointments or > calling out to a gtk popup, but I look forward to using it soon. > > Thanks. > > On Tue, Feb 26, 2008 at 05:09:39PM +0100, Carsten Dominik wrote: > > > > On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: > > > > [...] > > > > I forgot to clear the list: > > > > So to summarize, this is really all you need in .emacs: > > > > ;; Get appointments for today > > (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > > (defun my-org-agenda-to-appt () > > (interactive) > > (setq appt-time-msg-list nil) > > (let ((org-deadline-warning-days 0)) ;; will be automatic in org > > 5.23 > > (org-agenda-to-appt))) > > (my-org-agenda-to-appt) > > (appt-activate t) > > (run-at-time "24:01" nil 'my-org-agenda-to-appt) > > > > > > > > > > > > > _______________________________________________ > > Emacs-orgmode mailing list > > Remember: use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-28 0:55 ` Russell Adams @ 2008-02-28 1:04 ` Bernt Hansen 2008-02-28 1:06 ` Bernt Hansen 2008-02-28 22:38 ` Russell Adams 0 siblings, 2 replies; 15+ messages in thread From: Bernt Hansen @ 2008-02-28 1:04 UTC (permalink / raw) To: emacs-orgmode It's configurable (as is almost anything else in Emacs) The following variables set to behaviour appt-message-warning-time (12 minutes for me) appt-display-interval ( 3 minutes for me) I get warnings at 12, 9, 6, 3, and 0 minutes. HTH, -Bernt Russell Adams <RLAdams@AdamsInfoServ.Com> writes: > Ok, so how far in advance is appt supposed to alert you? > > I'm testing this, and I've gotten zenity to do a popup, and I've tied > the refresh of the appt list to the agenda refresh with: > > (add-hook 'org-finalize-agenda-hook 'my-org-agenda-to-appt) > > I'm testing a series of timings before I start relying on this, and > trying to understand the behavior. > > Any comments? > > Thanks. > > On Tue, Feb 26, 2008 at 07:01:15PM -0600, Russell Adams wrote: >> Great combined feature: >> >> http://alfredobuttari.wordpress.com/2008/02/08/emacs-appt-mode-reminders-with-gtk-popups/ >> >> I'm still trying to get this to work reliably, either appointments or >> calling out to a gtk popup, but I look forward to using it soon. >> >> Thanks. >> >> On Tue, Feb 26, 2008 at 05:09:39PM +0100, Carsten Dominik wrote: >> > >> > On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: >> > >> > [...] >> > >> > I forgot to clear the list: >> > >> > So to summarize, this is really all you need in .emacs: >> > >> > ;; Get appointments for today >> > (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) >> > (defun my-org-agenda-to-appt () >> > (interactive) >> > (setq appt-time-msg-list nil) >> > (let ((org-deadline-warning-days 0)) ;; will be automatic in org >> > 5.23 >> > (org-agenda-to-appt))) >> > (my-org-agenda-to-appt) >> > (appt-activate t) >> > (run-at-time "24:01" nil 'my-org-agenda-to-appt) >> > >> > > >> > >> > >> > >> > _______________________________________________ >> > Emacs-orgmode mailing list >> > Remember: use `Reply All' to send replies to the list. >> > Emacs-orgmode@gnu.org >> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >> >> ------------------------------------------------------------------ >> Russell Adams RLAdams@AdamsInfoServ.com >> >> PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ >> >> Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-28 1:04 ` Bernt Hansen @ 2008-02-28 1:06 ` Bernt Hansen 2008-02-28 22:38 ` Russell Adams 1 sibling, 0 replies; 15+ messages in thread From: Bernt Hansen @ 2008-02-28 1:06 UTC (permalink / raw) To: emacs-orgmode Bernt Hansen <bernt@norang.ca> writes: > The following variables set to behaviour set to -> set the ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-02-28 1:04 ` Bernt Hansen 2008-02-28 1:06 ` Bernt Hansen @ 2008-02-28 22:38 ` Russell Adams 2008-02-28 23:17 ` Nick Dokos 1 sibling, 1 reply; 15+ messages in thread From: Russell Adams @ 2008-02-28 22:38 UTC (permalink / raw) To: emacs-orgmode Thanks for the information! Thats exactly what I was trying to figure out. I've got one last problem, then I'll post the complete howto somewhere... I'm kicking off zenity (GUI notification window) via shell-command and putting it in the background. Emacs keeps opening a new window called *Async Shell Command*, even though I thought I disabled that by passing nil to the output buffer argument. Any suggestions? Thanks. On Wed, Feb 27, 2008 at 08:04:51PM -0500, Bernt Hansen wrote: > It's configurable (as is almost anything else in Emacs) > > The following variables set to behaviour > > appt-message-warning-time (12 minutes for me) > appt-display-interval ( 3 minutes for me) > > I get warnings at 12, 9, 6, 3, and 0 minutes. > > HTH, > -Bernt > > Russell Adams <RLAdams@AdamsInfoServ.Com> writes: > > > Ok, so how far in advance is appt supposed to alert you? > > > > I'm testing this, and I've gotten zenity to do a popup, and I've tied > > the refresh of the appt list to the agenda refresh with: > > > > (add-hook 'org-finalize-agenda-hook 'my-org-agenda-to-appt) > > > > I'm testing a series of timings before I start relying on this, and > > trying to understand the behavior. > > > > Any comments? > > > > Thanks. > > > > On Tue, Feb 26, 2008 at 07:01:15PM -0600, Russell Adams wrote: > >> Great combined feature: > >> > >> http://alfredobuttari.wordpress.com/2008/02/08/emacs-appt-mode-reminders-with-gtk-popups/ > >> > >> I'm still trying to get this to work reliably, either appointments or > >> calling out to a gtk popup, but I look forward to using it soon. > >> > >> Thanks. > >> > >> On Tue, Feb 26, 2008 at 05:09:39PM +0100, Carsten Dominik wrote: > >> > > >> > On Feb 26, 2008, at 5:06 PM, Carsten Dominik wrote: > >> > > >> > [...] > >> > > >> > I forgot to clear the list: > >> > > >> > So to summarize, this is really all you need in .emacs: > >> > > >> > ;; Get appointments for today > >> > (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > >> > (defun my-org-agenda-to-appt () > >> > (interactive) > >> > (setq appt-time-msg-list nil) > >> > (let ((org-deadline-warning-days 0)) ;; will be automatic in org > >> > 5.23 > >> > (org-agenda-to-appt))) > >> > (my-org-agenda-to-appt) > >> > (appt-activate t) > >> > (run-at-time "24:01" nil 'my-org-agenda-to-appt) > >> > > >> > > > >> > > >> > > >> > > >> > _______________________________________________ > >> > Emacs-orgmode mailing list > >> > Remember: use `Reply All' to send replies to the list. > >> > Emacs-orgmode@gnu.org > >> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >> > >> > >> ------------------------------------------------------------------ > >> Russell Adams RLAdams@AdamsInfoServ.com > >> > >> PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > >> > >> Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > >> > >> > >> _______________________________________________ > >> Emacs-orgmode mailing list > >> Remember: use `Reply All' to send replies to the list. > >> Emacs-orgmode@gnu.org > >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > > > ------------------------------------------------------------------ > > Russell Adams RLAdams@AdamsInfoServ.com > > > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > > > > > _______________________________________________ > > Emacs-orgmode mailing list > > Remember: use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-02-28 22:38 ` Russell Adams @ 2008-02-28 23:17 ` Nick Dokos 2008-03-02 10:13 ` Russell Adams 0 siblings, 1 reply; 15+ messages in thread From: Nick Dokos @ 2008-02-28 23:17 UTC (permalink / raw) To: Russell Adams; +Cc: emacs-orgmode Russell Adams <RLAdams@AdamsInfoServ.Com> wrote: > I'm kicking off zenity (GUI notification window) via shell-command and > putting it in the background. Emacs keeps opening a new window called > *Async Shell Command*, even though I thought I disabled that by > passing nil to the output buffer argument. > Try the following instead: (setq appt-display-format 'window) (setq appt-disp-window-function (function my-appt-disp-window)) (defun my-appt-disp-window (min-to-app new-time msg) (call-process "/home/nick/bin/popup.py" nil 0 nil min-to-app msg new-time)) This one calls my home-grown ``popupper'', so just change the string to call zenity, and change the args to what is needed. The 0 in the "nil 0 nil" part means discard any output and don't wait for the process to finish - see the documentation for call-process for more details. For more, check the list archives or worg: I had posted my method for popups to the list and Bastien has apparently put a pointer to it on worg somewhere. HTH, Nick ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-02-28 23:17 ` Nick Dokos @ 2008-03-02 10:13 ` Russell Adams 2008-03-02 17:51 ` Richard G Riley 2008-03-03 1:31 ` Bastien 0 siblings, 2 replies; 15+ messages in thread From: Russell Adams @ 2008-03-02 10:13 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1.1: Type: text/plain, Size: 1693 bytes --] Ok, so I've got appt working with org, along with Gnome popups with zenity to alert me of events. I wanted to aggregate the advice I'd received into one place, which could be posted later to wiki or worg, etc. I would welcome feedback, as I'm currently vetting this configuration. I'll post any updates if I find a problem. Thanks. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; For org appointment reminders ;; Get appointments for today (defun my-org-agenda-to-appt () (interactive) (setq appt-time-msg-list nil) (let ((org-deadline-warning-days 0)) ;; will be automatic in org 5.23 (org-agenda-to-appt))) ;; Run once, activate and schedule refresh (my-org-agenda-to-appt) (appt-activate t) (run-at-time "24:01" nil 'my-org-agenda-to-appt) ; 5 minute warnings (setq appt-message-warning-time '15) (setq appt-display-interval '5) ; Update appt each time agenda opened. (add-hook 'org-finalize-agenda-hook 'my-org-agenda-to-appt) ; Setup zenify, we tell appt to use window, and replace default function (setq appt-display-format 'window) (setq appt-disp-window-function (function my-appt-disp-window)) (defun my-appt-disp-window (min-to-app new-time msg) (save-window-excursion (shell-command (concat "/usr/bin/zenity --info --title='Appointment' --text='" msg "' &" ) nil nil) )) ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] [-- Attachment #2: Type: text/plain, Size: 204 bytes --] _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-03-02 10:13 ` Russell Adams @ 2008-03-02 17:51 ` Richard G Riley 2008-03-02 19:33 ` Russell Adams 2008-03-03 1:31 ` Bastien 1 sibling, 1 reply; 15+ messages in thread From: Richard G Riley @ 2008-03-02 17:51 UTC (permalink / raw) To: emacs-orgmode Russell Adams <RLAdams@AdamsInfoServ.Com> writes: v> Ok, so I've got appt working with org, along with Gnome popups with > zenity to alert me of events. > > I wanted to aggregate the advice I'd received into one place, which > could be posted later to wiki or worg, etc. > > I would welcome feedback, as I'm currently vetting this > configuration. I'll post any updates if I find a problem. > > Thanks. > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ; For org appointment reminders > > ;; Get appointments for today > (defun my-org-agenda-to-appt () > (interactive) > (setq appt-time-msg-list nil) > (let ((org-deadline-warning-days 0)) ;; will be automatic in org 5.23 > (org-agenda-to-appt))) > > ;; Run once, activate and schedule refresh > (my-org-agenda-to-appt) > (appt-activate t) > (run-at-time "24:01" nil 'my-org-agenda-to-appt) > > ; 5 minute warnings > (setq appt-message-warning-time '15) > (setq appt-display-interval '5) > > ; Update appt each time agenda opened. > (add-hook 'org-finalize-agenda-hook 'my-org-agenda-to-appt) > > ; Setup zenify, we tell appt to use window, and replace default function > (setq appt-display-format 'window) > (setq appt-disp-window-function (function my-appt-disp-window)) > > (defun my-appt-disp-window (min-to-app new-time msg) > (save-window-excursion (shell-command (concat > "/usr/bin/zenity --info --title='Appointment' --text='" > msg > "' &" > ) nil nil) > )) I just tried it. Excellent. BTW, one small problem - when I updated a schedule in the agenda interface, the agenda file doesn't update in the buffer. Closing it and reopening it showed the new time. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-03-02 17:51 ` Richard G Riley @ 2008-03-02 19:33 ` Russell Adams 0 siblings, 0 replies; 15+ messages in thread From: Russell Adams @ 2008-03-02 19:33 UTC (permalink / raw) To: emacs-orgmode I don't know if that is related to this code. For the list, what version are you running? On Sun, Mar 02, 2008 at 06:51:42PM +0100, Richard G Riley wrote: > BTW, one small problem - when I updated a schedule in the agenda > interface, the agenda file doesn't update in the buffer. Closing it and > reopening it showed the new time. > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: org-mode and appointments 2008-03-02 10:13 ` Russell Adams 2008-03-02 17:51 ` Richard G Riley @ 2008-03-03 1:31 ` Bastien 1 sibling, 0 replies; 15+ messages in thread From: Bastien @ 2008-03-03 1:31 UTC (permalink / raw) To: emacs-orgmode Russell Adams <RLAdams@AdamsInfoServ.Com> writes: > Ok, so I've got appt working with org, along with Gnome popups with > zenity to alert me of events. Works nice here, thanks. > I wanted to aggregate the advice I'd received into one place, which > could be posted later to wiki or worg, etc. I posted this here: http://www.legito.net/worg/org-adhoc-code.php It should appear in a few minutes, I'm not uploading the HTML export of Worg manually. -- Bastien ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: org-mode and appointments 2008-02-25 23:09 org-mode and appointments Bernt Hansen 2008-02-26 16:06 ` Carsten Dominik @ 2008-02-26 16:19 ` Bastien 1 sibling, 0 replies; 15+ messages in thread From: Bastien @ 2008-02-26 16:19 UTC (permalink / raw) To: org-mode list; +Cc: Bernt Hansen (Resending to the list) Hi Bernt, Bernt Hansen <bernt@norang.ca> writes: > I'm using your function for creating appointments: > > ,----[ my-org-agenda-to-appt in .emacs ] This function is now part of org-mode and is named `org-agenda-to-appt'. It is safer to use the version shipped with Org than the one on the web. > I have a function key binding to rerun this function when I add new > appointments for today. > > ,----[ Activate the appointments in .emacs ] > | (global-set-key (kbd "<f9> a") 'my-org-agenda-to-appt) > | ;; Get appointments for today > | (my-org-agenda-to-appt) > | (appt-activate t) > `---- > > I have the following wishlist items for this function but don't > currently have the lisp skills to fix it. > > - [ ] Clear the appointment list when rerunning the > my-org-agenda-to-appt Yes, I've fixed this. This should also handle the case where people still use diary appointments. > - [ ] Future deadlines are reported for today. I've also fixed this. > - [ ] If I leave Emacs running overnight is there a good way to reset > the appointment list at midnight? Maybe we should consider having `org-agenda-to-appt-activate' doing a similar job than `appt-activate': check for new appts (in agendas) at a specific time and when agenda files are saved. In the meantime, you can do this manually with a cron job or `run-at-time' (See C-h f run-at-time RET) Hope this helps... -- Bastien ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2008-03-03 1:31 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-25 23:09 org-mode and appointments Bernt Hansen 2008-02-26 16:06 ` Carsten Dominik 2008-02-26 16:09 ` Carsten Dominik 2008-02-26 16:14 ` Bernt Hansen 2008-02-27 1:01 ` Russell Adams 2008-02-28 0:55 ` Russell Adams 2008-02-28 1:04 ` Bernt Hansen 2008-02-28 1:06 ` Bernt Hansen 2008-02-28 22:38 ` Russell Adams 2008-02-28 23:17 ` Nick Dokos 2008-03-02 10:13 ` Russell Adams 2008-03-02 17:51 ` Richard G Riley 2008-03-02 19:33 ` Russell Adams 2008-03-03 1:31 ` Bastien 2008-02-26 16:19 ` Bastien
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.