[comp.emacs] Calendar.el Bug Report with Fix

acy@calvin.icd.abnet.COM (Adnan Yaqub) (02/08/89)

The newest release of the calendar package from Edward M. Reingold has
a bug.  When one exits  calendar, it kills  the holiday buffer without
checking to see  if  one exists.   If  one has  not attempted to  view
holidays, there is no holiday buffer and kill-buffer is invoked with a
nil which kills off the current buffer.  Here is a fix to the problem:

*** calendar.el	Tue Feb  7 12:20:39 1989
--- calendar.el.OLD	Tue Feb  7 11:18:39 1989
***************
*** 572,586 ****
      (if (not diary-buffer)
          (progn
            (kill-buffer calendar-buffer)
!           (if (bufferp (get-buffer holiday-buffer))
! 	      (kill-buffer (get-buffer holiday-buffer)))
            (set-window-configuration calendar-window-configuration))
        (if (or (not (buffer-modified-p diary-buffer))
                (yes-or-no-p "Diary modified; do you really want to exit the calendar? "))
            (progn
              (kill-buffer calendar-buffer)
! 	    (if (bufferp (get-buffer holiday-buffer))
! 		(kill-buffer (get-buffer holiday-buffer)))
              (set-buffer diary-buffer)
              (set-buffer-modified-p nil)
              (kill-buffer diary-buffer)
--- 572,584 ----
      (if (not diary-buffer)
          (progn
            (kill-buffer calendar-buffer)
!           (kill-buffer (get-buffer holiday-buffer))
            (set-window-configuration calendar-window-configuration))
        (if (or (not (buffer-modified-p diary-buffer))
                (yes-or-no-p "Diary modified; do you really want to exit the calendar? "))
            (progn
              (kill-buffer calendar-buffer)
!             (kill-buffer (get-buffer holiday-buffer))
              (set-buffer diary-buffer)
              (set-buffer-modified-p nil)
              (kill-buffer diary-buffer)
--
Adnan Yaqub
[cvedc|cwjcc|decvax|masscomp|mrmarx|pyramid|uunet]!abvax!acy
Allen-Bradley Company
747 Alpha Dr. Highland Hts. OH 44143 USA (216) 646-4409