Re: [O] [PATCH] fix appointment warn time
Ivan Kanis writes: > Have you tried emacs -Q ? Yes... -- Bastien
Re: [O] [PATCH] fix appointment warn time
Le 14 Mai à 16h08, Bastien a écrit : > Hi Miguel, > > Miguel Ruiz writes: > >> Yes, I can. Both Emacs 24.3 with Org-mode version 7.9.4 >> (7.9.4-1-ga5435f-elpa) and Org-mode version 8.0.2 >> (release_8.0.2-71-g5a1400) exhibits the problem than Ivan reports. >> >> For me it is solved with Bastien patch, i.e. >> >> http://lists.gnu.org/archive/html/emacs-orgmode/2013-04/txt0omoVnE86i.txt > > I applied this patch, thanks for confirming. Thanks! > FWIW I still cannot reproduce the bug... weird. Have you tried emacs -Q ? -- Les mots sont les fantômes des imaginations malades, au-dessus desquels il y a la vie qu'il faut vivre sans penser aux mots. -- Charles-Louis Philippe J'écoute « The Mamas & the Papas - I Call Your Name ».
Re: [O] [PATCH] fix appointment warn time
Hi Miguel, Miguel Ruiz writes: > Yes, I can. Both Emacs 24.3 with Org-mode version 7.9.4 > (7.9.4-1-ga5435f-elpa) and Org-mode version 8.0.2 > (release_8.0.2-71-g5a1400) exhibits the problem than Ivan reports. > > For me it is solved with Bastien patch, i.e. > > http://lists.gnu.org/archive/html/emacs-orgmode/2013-04/txt0omoVnE86i.txt I applied this patch, thanks for confirming. FWIW I still cannot reproduce the bug... weird. -- Bastien
Re: [O] [PATCH] fix appointment warn time
--- El mar, 14/5/13, Ivan Kanis escribió: > De: Ivan Kanis > Asunto: Re: [O] [PATCH] fix appointment warn time > Para: "Bastien" > CC: "org mode" > Fecha: martes, 14 de mayo, 2013 14:10 > Le 14 Mai à 13h49, Bastien a > écrit : > > >>> Can anyone else reproduce Ivan's problem? Yes, I can. Both Emacs 24.3 with Org-mode version 7.9.4 (7.9.4-1-ga5435f-elpa) and Org-mode version 8.0.2 (release_8.0.2-71-g5a1400) exhibits the problem than Ivan reports. For me it is solved with Bastien patch, i.e. http://lists.gnu.org/archive/html/emacs-orgmode/2013-04/txt0omoVnE86i.txt > > >> > >> Are you using bzr emacs? > > > > Now I recall it happens on 24.1 and bzr. Let's hope someone > else can > reproduce. > -- > La différence entre un bon et un mauvais architecte réside > en ce que > le mauvais succombe à toutes les tentations quand le bon > leur tient > tête. > > -- Ludwig Wittgenstein > >
Re: [O] [PATCH] fix appointment warn time
Le 14 Mai à 13h49, Bastien a écrit : >>> Can anyone else reproduce Ivan's problem? >> >> Are you using bzr emacs? > Now I recall it happens on 24.1 and bzr. Let's hope someone else can reproduce. -- La différence entre un bon et un mauvais architecte réside en ce que le mauvais succombe à toutes les tentations quand le bon leur tient tête. -- Ludwig Wittgenstein
Re: [O] [PATCH] fix appointment warn time
Ivan Kanis writes: > Le 14 Mai à 10h36, Bastien a écrit : > >>> I tried it again on a more recent emacs (bzr from two weeks ago). Same >>> result. Are you sure you removed your patch? :D >> >> Mhh... yes, I'm sure. >> >> Can anyone else reproduce Ivan's problem? > > Are you using bzr emacs? Yes. GNU Emacs 24.3.50.3 (i686-pc-linux-gnu, GTK+ Version 3.8.1) of 2013-05-12 on bzg -- Bastien
Re: [O] [PATCH] fix appointment warn time
Le 14 Mai à 10h36, Bastien a écrit : >> I tried it again on a more recent emacs (bzr from two weeks ago). Same >> result. Are you sure you removed your patch? :D > > Mhh... yes, I'm sure. > > Can anyone else reproduce Ivan's problem? Are you using bzr emacs? -- D'autres civilisations que la nôtre ont pu, infiniment mieux que nous ne l'avons fait, résoudre les problèmes qui se posent à l'homme. -- Alfred Métraux
Re: [O] [PATCH] fix appointment warn time
Hi Ivan, Ivan Kanis writes: > April, 28 at 10:59 Bastien wrote: > >>> Without your patch you should see that warntime is nil. >> >> Mhh... I don't see this. The call to (org-agenda) in your (progn...) >> will refresh the text-properties in foo.org and C-u C-x = show the >> property in both the agenda and foo.org. I clearly miss something >> here :/ > > I tried it again on a more recent emacs (bzr from two weeks ago). Same > result. Are you sure you removed your patch? :D Mhh... yes, I'm sure. Can anyone else reproduce Ivan's problem? -- Bastien
Re: [O] [PATCH] fix appointment warn time
April, 28 at 10:59 Bastien wrote: >> Without your patch you should see that warntime is nil. > > Mhh... I don't see this. The call to (org-agenda) in your (progn...) > will refresh the text-properties in foo.org and C-u C-x = show the > property in both the agenda and foo.org. I clearly miss something > here :/ I tried it again on a more recent emacs (bzr from two weeks ago). Same result. Are you sure you removed your patch? :D I have attached a screen shot. <>
Re: [O] [PATCH] fix appointment warn time
Ivan Kanis writes: > April, 27 at 14:02 Bastien wrote: > >>> It works great and it looks less expensive. Thank you! >> >> Great -- thanks for testing this. >> >> Still, I need to really understand what real problem it fixes... >> is it because some of your functions needs to check the property >> or is it during regular use of Org? Sorry if I missed this in >> one of your previous message... and thanks in advance! > > I am doing regular use of Org. Put the attached foo.org in your home > directory. Eval the progn. Pick agenda for the day. > > Go to the test entry and do M-x describe-text-properties > > Without your patch you should see that warntime is nil. Mhh... I don't see this. The call to (org-agenda) in your (progn...) will refresh the text-properties in foo.org and C-u C-x = show the property in both the agenda and foo.org. I clearly miss something here :/ -- Bastien
Re: [O] [PATCH] fix appointment warn time
April, 27 at 14:02 Bastien wrote: >> It works great and it looks less expensive. Thank you! > > Great -- thanks for testing this. > > Still, I need to really understand what real problem it fixes... > is it because some of your functions needs to check the property > or is it during regular use of Org? Sorry if I missed this in > one of your previous message... and thanks in advance! I am doing regular use of Org. Put the attached foo.org in your home directory. Eval the progn. Pick agenda for the day. Go to the test entry and do M-x describe-text-properties Without your patch you should see that warntime is nil. ** TPIT with Jean-Philippe at San Francisco <2013-01-19 Fri 15:00 +1w> :PROPERTIES: :APPT_WARNTIME: 5 :END: (progn (setq org-agenda-files '("~/foo.org")) (org-agenda))
Re: [O] [PATCH] fix appointment warn time
Ivan Kanis writes: > April, 26 at 19:01 Bastien wrote: > >>> The patch adds a function that goes at the beginning of the header to >>> get the property. As a bonus it turns the string into a number. >>> >>> Please let me know if the patch is accepted or needs improvement. >> >> Can you try the attached patch instead? > > It works great and it looks less expensive. Thank you! Great -- thanks for testing this. Still, I need to really understand what real problem it fixes... is it because some of your functions needs to check the property or is it during regular use of Org? Sorry if I missed this in one of your previous message... and thanks in advance! -- Bastien
Re: [O] [PATCH] fix appointment warn time
April, 26 at 19:01 Bastien wrote: >> The patch adds a function that goes at the beginning of the header to >> get the property. As a bonus it turns the string into a number. >> >> Please let me know if the patch is accepted or needs improvement. > > Can you try the attached patch instead? It works great and it looks less expensive. Thank you! -- Sand fleas eating the Internet cables. -- BOFH excuse #59
Re: [O] [PATCH] fix appointment warn time
Hi Ivan, Ivan Kanis writes: > It seemed to be a boundary error. (point) was at the end of the > timestamp which doesn't hold the org-appt-warntime property. It does not hold the text property until this property has been set. E.g., `org-agenda-prepare-buffers' sets this property. So I'm still curious: under which circumstances do you expect APPT_WARNTIME to have an effect while it does not? `org-agenda-to-appt' do refresh the 'org-appt-warntime property, so it will not appear here. > foo.org illustrate what I have seen. Evaling the get-property sexp > returns nil. Yep, as expected. > The patch adds a function that goes at the beginning of the header to > get the property. As a bonus it turns the string into a number. > > Please let me know if the patch is accepted or needs improvement. Can you try the attached patch instead? diff --git a/lisp/org.el b/lisp/org.el index 2bb6127..fe64f14 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9245,7 +9245,7 @@ property to set." (save-excursion (org-back-to-heading t) (put-text-property - (point-at-bol) (point-at-eol) tprop p + (point-at-bol) (org-end-of-subtree t t) tprop p Link Stuff -- Bastien
[O] [PATCH] fix appointment warn time
It seemed to be a boundary error. (point) was at the end of the timestamp which doesn't hold the org-appt-warntime property. foo.org illustrate what I have seen. Evaling the get-property sexp returns nil. The patch adds a function that goes at the beginning of the header to get the property. As a bonus it turns the string into a number. Please let me know if the patch is accepted or needs improvement. diff --git a/emacs/org/org-agenda.el b/emacs/org/org-agenda.el index 631c6d0..a826b26 100644 --- a/emacs/org/org-agenda.el +++ b/emacs/org/org-agenda.el @@ -5425,6 +5425,14 @@ the documentation of `org-diary'." (org-end-of-subtree 'invisible (nreverse ee))) +(defun org-agenda-get-warntime () + "Return warn time number when the property exists." + (save-excursion +(org-back-to-heading t) +(let ((warntime (get-text-property (point) 'org-appt-warntime))) + (when warntime +(string-to-number warntime) + (defun org-agenda-todo-custom-ignore-p (time n) "Check whether timestamp is farther away than n number of days. This function is invoked if `org-agenda-todo-ignore-deadlines', @@ -5570,7 +5578,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', clockp (and org-agenda-include-inactive-timestamps (or (string-match org-clock-string tmp) (string-match "]-+\\'" tmp))) - warntime (get-text-property (point) 'org-appt-warntime) + warntime (org-agenda-get-warntime) donep (member todo-state org-done-keywords)) (if (or scheduledp deadlinep closedp clockp (and donep org-agenda-skip-timestamp-if-done)) @@ -5659,7 +5667,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (memq 'agenda org-agenda-use-tag-inheritance tags (org-get-tags-at nil (not inherited-tags)) todo-state (org-get-todo-state) - warntime (get-text-property (point) 'org-appt-warntime) +warntime (org-agenda-get-warntime) extra nil) (dolist (r (if (stringp result) @@ -6059,7 +6067,7 @@ specification like [h]h:mm." (not (= diff 0 (setq txt nil) (setq category (org-get-category) - warntime (get-text-property (point) 'org-appt-warntime) + warntime (org-agenda-get-warntime) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward "^\\*+[ \t]+" nil t)) (throw :skip nil) ** TPIT with Jean-Philippe at San Francisco <2013-01-18 Fri 15:00 +1w> :PROPERTIES: :APPT_WARNTIME: 5 :END: (get-text-property 71 'org-appt-warntime) (goto-char 71)