unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4065: 23.1.50; org includes calendar entries on the wrong day
@ 2009-08-06 12:11 Leo
  2009-08-06 13:07 ` bug#4066: " Carsten Dominik
  2010-03-17 12:44 ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries (was: bug#4065: 23.1.50; org includes calendar entries on the wrong day) Leo
  0 siblings, 2 replies; 6+ messages in thread
From: Leo @ 2009-08-06 12:11 UTC (permalink / raw)
  To: emacs-pretest-bug; +Cc: Carsten Dominik

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

This only happens for the first time running org-agenda in a fresh emacs
session.

Settings to reproduce the bug with Emacs -q:

(define-key mode-specific-map [?a] 'org-agenda)
(define-key mode-specific-map [?l] 'org-store-link)
(setq org-agenda-include-diary t)

(setq calendar-date-style 'european)
(setq diary-number-of-entries 7)
(add-hook 'diary-hook 'appt-make-list)

Add an entry to the diary file such as:

    8 Aug 2009 Test2

--------------------------------
Week-agenda (W32):
Monday      3 August 2009 W32
  Diary:      Test2
  Diary:      
  Diary:      Thursday, 6 August 2009
  Diary:      =======================
Tuesday     4 August 2009
Wednesday   5 August 2009
Thursday    6 August 2009
Friday      7 August 2009
Saturday    8 August 2009
  Diary:      Test2
Sunday      9 August 2009
--------------------------------

Running org-agend a second time does not have this problem. This also
happens in org 6.21b.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4066: 23.1.50; org includes calendar entries on the wrong day
  2009-08-06 12:11 bug#4065: 23.1.50; org includes calendar entries on the wrong day Leo
@ 2009-08-06 13:07 ` Carsten Dominik
  2010-03-17 12:44 ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries (was: bug#4065: 23.1.50; org includes calendar entries on the wrong day) Leo
  1 sibling, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2009-08-06 13:07 UTC (permalink / raw)
  To: Leo; +Cc: emacs-pretest-bug

Hi Leo,

I don't know what is causing this, but it has to do with the
appt-make-list call.  That seems to leave behind some garbage that Org  
finds.  I have not been able to figure out what exactly is causing this.

- Carsten

On Aug 6, 2009, at 2:11 PM, Leo wrote:

> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
> This only happens for the first time running org-agenda in a fresh  
> emacs
> session.
>
> Settings to reproduce the bug with Emacs -q:
>
> (define-key mode-specific-map [?a] 'org-agenda)
> (define-key mode-specific-map [?l] 'org-store-link)
> (setq org-agenda-include-diary t)
>
> (setq calendar-date-style 'european)
> (setq diary-number-of-entries 7)
> (add-hook 'diary-hook 'appt-make-list)
>
> Add an entry to the diary file such as:
>
>    8 Aug 2009 Test2
>
> --------------------------------
> Week-agenda (W32):
> Monday      3 August 2009 W32
>  Diary:      Test2
>  Diary:
>  Diary:      Thursday, 6 August 2009
>  Diary:      =======================
> Tuesday     4 August 2009
> Wednesday   5 August 2009
> Thursday    6 August 2009
> Friday      7 August 2009
> Saturday    8 August 2009
>  Diary:      Test2
> Sunday      9 August 2009
> --------------------------------
>
> Running org-agend a second time does not have this problem. This also
> happens in org 6.21b.

=======================
PLEASE NOTE NEW ADDRESS
=======================
prof.dr. Carsten Dominik				dominik@uva.nl
Astronomical Institute 'Anton Pannekoek' 	 	www.astro.uva.nl/~dominik
Faculty of Science, University of Amsterdam		phone 	+31-20-5257477/7491
SCIENCE PARK 904, ROOM C4-106			fax   	+31-20-5257484
1098 XH Amsterdam, The Netherlands
mail: PO BOX 94249, 1090GE, Amsterdam









^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4065: Possible circular calls in appt-make-list and diary-list-entries (was: bug#4065: 23.1.50; org includes calendar entries on the wrong day)
  2009-08-06 12:11 bug#4065: 23.1.50; org includes calendar entries on the wrong day Leo
  2009-08-06 13:07 ` bug#4066: " Carsten Dominik
@ 2010-03-17 12:44 ` Leo
  2010-03-20 18:21   ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries Glenn Morris
  1 sibling, 1 reply; 6+ messages in thread
From: Leo @ 2010-03-17 12:44 UTC (permalink / raw)
  To: 4065; +Cc: Carsten Dominik

Hello,

I investigated this problem a bit and found it is not due to org. It is
a bug in diary and appt.

Appt tries to maintain some sort of backward compatibility by allowing:
(add-hook 'diary-hook 'appt-make-list) to activate appt.

When appt is not activated and appt-make-list is in diary-hook, the
return value of diary-list-entries may be incorrect due to the
following circular calls:

diary-list-entries -> appt-make-list -> appt-activate -> appt-check ->
diary -> diary-list-entries

So one is getting a return value of the second call which can be
different from the first one and that's exactly why org place diary
entries wrongly.

I think a proper fix may probably lie in diary-list-entries or
appt-check/activate.

I have been using the following minimal workaround.

diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index b403b70..782b163 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -518,7 +518,8 @@ For backwards compatibility, this function activates
the
 appointment package (if it is not already active)."
   ;; See comments above appt-activate defun.
   (if (not appt-timer)
-      (appt-activate 1)
+      (let (appt-display-diary)
+        (appt-activate 1))
     ;; We have something to do if the range of dates that the diary is
     ;; considering includes the current date.
     (if (and (not (calendar-date-compare

Thanks.

Leo

On 2009-08-06 13:11 +0100, Leo wrote:
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
> This only happens for the first time running org-agenda in a fresh emacs
> session.
>
> Settings to reproduce the bug with Emacs -q:
>
> (define-key mode-specific-map [?a] 'org-agenda)
> (define-key mode-specific-map [?l] 'org-store-link)
> (setq org-agenda-include-diary t)
>
> (setq calendar-date-style 'european)
> (setq diary-number-of-entries 7)
> (add-hook 'diary-hook 'appt-make-list)
>
> Add an entry to the diary file such as:
>
>     8 Aug 2009 Test2
>
> --------------------------------
> Week-agenda (W32):
> Monday      3 August 2009 W32
>   Diary:      Test2
>   Diary:      
>   Diary:      Thursday, 6 August 2009
>   Diary:      =======================
> Tuesday     4 August 2009
> Wednesday   5 August 2009
> Thursday    6 August 2009
> Friday      7 August 2009
> Saturday    8 August 2009
>   Diary:      Test2
> Sunday      9 August 2009
> --------------------------------






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#4065: Possible circular calls in appt-make-list and diary-list-entries
  2010-03-17 12:44 ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries (was: bug#4065: 23.1.50; org includes calendar entries on the wrong day) Leo
@ 2010-03-20 18:21   ` Glenn Morris
  2010-03-20 20:01     ` Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2010-03-20 18:21 UTC (permalink / raw)
  To: Leo; +Cc: 4065

Leo wrote:

> I investigated this problem a bit and found it is not due to org. It is
> a bug in diary and appt.

Please give an example starting from emacs -Q and not involving org
that shows the problem. Thanks.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4065: Possible circular calls in appt-make-list and diary-list-entries
  2010-03-20 18:21   ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries Glenn Morris
@ 2010-03-20 20:01     ` Leo
  2010-09-30  2:24       ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2010-03-20 20:01 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4065

On 2010-03-20 18:21 +0000, Glenn Morris wrote:
> Leo wrote:
>
>> I investigated this problem a bit and found it is not due to org. It is
>> a bug in diary and appt.
>
> Please give an example starting from emacs -Q and not involving org
> that shows the problem. Thanks.

1. Emacs -q and eval the following lines one by one
(setq calendar-date-style 'european)
(require 'diary-lib)
(setq diary-file "~/diary")
(add-hook 'diary-hook 'appt-make-list)
(setq diary-number-of-entries 100)

2. insert some entries into the diary and then eval

(diary-list-entries '(3 16 2010) 1)

3. I was able to get the return value of (diary-list-entries '(3 16
2010) 100) but not (diary-list-entries '(3 16 2010) 1).

Cheers,

Leo






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#4065: Possible circular calls in appt-make-list and diary-list-entries
  2010-03-20 20:01     ` Leo
@ 2010-09-30  2:24       ` Glenn Morris
  0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2010-09-30  2:24 UTC (permalink / raw)
  To: 4065-done

Version: 24.1
stop

The obsolete method of enabling the appt package has been removed, so
this issue cannot occur any more.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-30  2:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06 12:11 bug#4065: 23.1.50; org includes calendar entries on the wrong day Leo
2009-08-06 13:07 ` bug#4066: " Carsten Dominik
2010-03-17 12:44 ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries (was: bug#4065: 23.1.50; org includes calendar entries on the wrong day) Leo
2010-03-20 18:21   ` bug#4065: Possible circular calls in appt-make-list and diary-list-entries Glenn Morris
2010-03-20 20:01     ` Leo
2010-09-30  2:24       ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).