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

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

Re: error in calendar


From: Frederik Fouvry
Subject: Re: error in calendar
Date: Tue, 8 Mar 2005 19:45:09 +0100 (CET)

Symptoms:

I narrowed down the settings that cause the problem with the calendar:

- a diary file with at least one #include directive

- the following setup (for emacs -q --no-site-file):

(custom-set-variables
 '(diary-file "~/.calendar/diary.el")
 '(mark-diary-entries-hook (quote (mark-included-diary-files)))
 '(mark-diary-entries-in-calendar t)
)
(autoload 'european-calendar "calendar")
(european-calendar)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
(calendar)

If either of mark-diary-entries-in-calendar and
mark-diary-entries-hook are commented out, the error does not occur
(but the #include'd entries are never marked; the ones in diary-file
are marked when mark-diary-entries-hook is nil (as expected)).

With the following changes, I tried to find out what happened with
point:

Index: lisp/calendar/calendar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/calendar.el,v
retrieving revision 1.162
diff -c -B -b -r1.162 calendar.el
*** lisp/calendar/calendar.el   1 Mar 2005 10:24:33 -0000       1.162
--- lisp/calendar/calendar.el   8 Mar 2005 17:54:57 -0000
***************
*** 2083,2093 ****
  ;;;         (calendar-date-is-legal-p today) ; useful for BC dates
           (mark-calendar-holidays)
           (and in-calendar-window (sit-for 0)))
      (unwind-protect
!         (if mark-diary-entries-in-calendar (mark-diary-entries))
        (if today-visible
            (run-hooks 'today-visible-calendar-hook)
!         (run-hooks 'today-invisible-calendar-hook)))))
  
  (defun generate-calendar (month year)
    "Generate a three-month Gregorian calendar centered around MONTH, YEAR."
--- 2083,2098 ----
  ;;;         (calendar-date-is-legal-p today) ; useful for BC dates
           (mark-calendar-holidays)
           (and in-calendar-window (sit-for 0)))
+     (let ((myp (point)))
      (unwind-protect
!       (prog2
!         (message "%s 1) %d" diary-file myp)
!         (if mark-diary-entries-in-calendar (mark-diary-entries)))
!       (goto-char myp)
!       (message "%s 2) %d" diary-file (point))
        (if today-visible
            (run-hooks 'today-visible-calendar-hook)
!         (run-hooks 'today-invisible-calendar-hook))))))
  
  (defun generate-calendar (month year)
    "Generate a three-month Gregorian calendar centered around MONTH, YEAR."

This prints the value of point, and avoids the error.  (Surprisingly,
save-excursion does _not_ help in this case.)  It does not, however,
mark any diary entries (during the execution of `calendar', some
entries are marked, but the face is removed later on).

If (goto-char myp) is commented out, we see that the last call to
message prints a value of 1 for point, after which things go wrong.  I
do not find an explanation why point suddenly moves (does
unwind-protect make it harder to follow?).  I have noticed that during
stepping of generate-calendar-window, just before the error occurs,
the execution is suddenly moved to just after mark-diary-entries (a
sign of unwinding after an error?).

I also noticed that diary-file is processed twice.  `calendar' begins,
and processes diary-file.  It then recursively processes diary-file
again, followed by all #include'd files.  Then it returns from the
recursion, back to diary-file, writes the message "Marking diary
entries...done", and runs into the error.  The output from the above
patch is given below (the number is the point value)

Marking holidays...done
~/.calendar/diary.el 1) 265
Marking holidays...done
~/.calendar/diary.el 1) 265
~/.calendar/diary.el 2) 265
Marking diary entries...
Marking holidays...done
diary-past.el 1) 265
diary-past.el 2) 265
Marking diary entries...done
Marking holidays...done
diary-regular.el 1) 265
diary-regular.el 2) 265
Marking diary entries...done
Marking holidays...done
uni-calendar.el 1) 265
uni-calendar.el 2) 265
Marking diary entries...done
Marking holidays...done
reminders.el 1) 265
reminders.el 2) 265
Marking diary entries...done [2 times]
~/.calendar/diary.el 2) 265

The last line, when the avoidance code is not used, gives as the value
of point 1.


In GNU Emacs 22.0.50.16 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2005-03-07 on cc.at.coli.uni-sb.de
Distributor `The XFree86 Project, Inc', version 11.0.40201000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: 
address@hidden:de_DE.utf-8:de_DE:address@hidden:nl_BE.utf-8:nl_BE:address@hidden:de_BE.utf-8:de_BE:address@hidden:fr_BE.utf-8:fr_BE:address@hidden:nl_NL.utf-8:nl_NL:address@hidden:en_GB.utf-8:en_GB:address@hidden:fr_FR.utf-8:fr_FR:address@hidden:en_US.utf-8:en_US
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: 
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Shell

Minor modes in effect:
  auto-image-file-mode: t
  desktop-save-mode: t
  global-auto-revert-mode: t
  iswitchb-mode: t
  show-paren-mode: t
  recentf-mode: t
  display-time-mode: t
  auto-insert-mode: t
  auto-compression-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-c r C-x C-f ~ . c <backspace> <backspace> / . c a 
l <tab> <return> g <up> <return> C-x C-g <escape> x 
s h e l l <return> g r e p SPC i n c l u d e SPC * 
. e l <backspace> <backspace> <backspace> <return> 
C-h v t o d a y - v i <tab> <return> <help-echo> <help-echo> 
<help-echo> <down-mouse-1> <mouse-movement> <mouse-movement> 
<help-echo> <mouse-movement> <mouse-movement> <drag-mouse-1> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> C-x 
1 <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<help-menu> <report-emacs-bug>

Recent messages:
Quit
Expunging deleted messages...done
(No changes need to be saved)
Reverting buffer `calendar.el'.
Getting mail from the remote server ... [2 times]
(No new mail has arrived)
Reverting buffer `calendar.el'.
Directory has changed on disk; type g to update Dired
Reverting buffer `calendar.el'. [5 times]
Type C-x 1 to remove help window.  C-M-v to scroll the help.




reply via email to

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