Emacs calendar mode: M-x diary fails to produce diary listing, shows diary file instead

Bug #475602 reported by Charles Curley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
emacs23 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: emacs23

When in Calendar mode, with a well populated ~/diary file, I should be able to put point on a date, and then hit "d", or run "M-x diary". This should produce a listing of diary entries in another window in the same frame. What I see instead is the diary file, the same as though I had hit s instead.

Putting point on a known holiday (e.g. 11 November) and then hitting "d" gets a message:

--------------------------------------------------
No diary entries for Wednesday, November 11, 2009: Veteran's Day
--------------------------------------------------

But that's not what I should see.

All of this works in Emacs 22 on Jaunty. I have not tested whether this works on Emacs 22 on Karmic.

Relevant portion of .emacs:

--------------------------------------------------
;; Calendar stuff:
(if (or ;; (system-is-charlesc)
     (system-is-dzur)
     (system-is-dragon))
        (progn
          ;; set my home co-ordinates for sunrise/sunset calculations
          (setq calendar-latitude 43.6)
          (setq calendar-longitude -108.2)
          (setq calendar-location-name "Thermopolis, Wyo")
          (calendar) ; fire up the calendar display.
          (setq show-trailing-whitespace nil)
          (setq cal-tex-diary t)
          (setq cal-tex-rules t)
          (if (> emacs-major-version 22)
              (calendar-mark-holidays)
            (mark-calendar-holidays)
            )

          (mark-diary-entries)
          (other-window 1) ; Now switch to the main window on this frame.

          ;; Add the appointment generator to the diary hook. Then set a vector for
          ;; the number of days in advance to show appointments. Then turn the diary
          ;; mode on.
          (setq number-of-diary-entries [2 3 3 3 3 5 2])
          (add-hook 'diary-hook 'appt-make-list)
          (if (> emacs-major-version 22)
              (add-hook 'diary-display-function 'diary-fancy-display)
            (add-hook 'diary-display-hook 'fancy-diary-display)
            )
          ;; If this is non-nil, Emacs rings the terminal bell for appointment
          ;; reminders. The default is t.
          ;; (setq appt-audible nil)
          (if (< emacs-major-version 23)
              (diary)
            )
          )
  )
;; end calendar/diary stuff
--------------------------------------------------

The two system-is functions identify the system that emacs is running on. This lets me use the same .emacs file on multiple computers. The calendar code runs on the test machine.

--------------------------------------------------
ccurley@dragon:~$ pre emacs
emacs23 23.1+1-4ubuntu3@|i386
emacs23-bin-common 23.1+1-4ubuntu3@|i386
emacs23-common 23.1+1-4ubuntu3@|all
emacsen-common 1.4.19ubuntu1@|all
ccurley@dragon:~$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10
ccurley@dragon:~$
--------------------------------------------------

While we're at it, I notice that the function calendar-mark-holidays produces a slew of error messages of the form:

--------------------------------------------------
Bad holiday list item: (holiday-fixed 1 1 New Year's Day)
Bad holiday list item: (holiday-float 1 1 3 Martin Luther King Day)
Bad holiday list item: (holiday-fixed 2 2 Groundhog Day)
...
--------------------------------------------------

None the less, those dates get marked.

ProblemType: Bug
Architecture: i386
Date: Thu Nov 5 09:47:04 2009
DistroRelease: Ubuntu 9.10
Package: emacs23 23.1+1-4ubuntu3
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: emacs23
Uname: Linux 2.6.31-14-generic i686
XsessionErrors:
 (gnome-settings-daemon:2123): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:2123): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (polkit-gnome-authentication-agent-1:2230): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (nautilus:2209): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (gnome-panel:2206): Gdk-WARNING **: /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

Revision history for this message
Charles Curley (charlescurley) wrote :
Revision history for this message
Charles Curley (charlescurley) wrote :

emacs 22 on Karmic works correctly.

Revision history for this message
Charles Curley (charlescurley) wrote :

Eliminating the fancy diary display allows display of the diary.

--------------------------------------------------
          ;; (if (> emacs-major-version 22)
          ;; (add-hook 'diary-display-function 'diary-fancy-display)
          ;; (add-hook 'diary-display-hook 'fancy-diary-display)
          ;; )
--------------------------------------------------

However this has problems, as blocks of dates are shown with the block code, not the dates. e.g:

--------------------------------------------------
%%(diary-float t 4 3) 17:20 leave for Business After Hours, 17:30, various places.
--------------------------------------------------

Apparently the non-fancy diary display uses folding mode, which has problems for copy and paste.

Revision history for this message
Charles Curley (charlescurley) wrote :

RTFM. That's what I did. It turns out that diary-display-function is a variable. While it has been used as a list in the past, the doc warns that that use will go away. Apparently it did. I tried initializing it as follows:

--------------------------------------------------
            (setq diary-display-function 'diary-fancy-display)
--------------------------------------------------

instead of the old code:

--------------------------------------------------
            (add-hook 'diary-display-function 'diary-fancy-display)
--------------------------------------------------

The new works just fine.

This was after upgrading to the latest version of emacs23 in karmic-proposed, per https://bugs.launchpad.net/ubuntu/+source/emacs22/+bug/415101. I don't know if that upgrade affected this problem or not. See comment 42 for details on how to do that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.