bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4065: Possible circular calls in appt-make-list and diary-list-entri


From: Leo
Subject: 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)
Date: Wed, 17 Mar 2010 12:44:10 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

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
> --------------------------------






reply via email to

[Prev in Thread] Current Thread [Next in Thread]