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

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

"Bad sexp" message using diary-remind


From: Andrew Kemp
Subject: "Bad sexp" message using diary-remind
Date: Thu, 27 Jan 2005 01:34:15 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

I have a diary file containing the single entry:

%%(diary-remind '(diary-anniversary 2 3 2003) 7) Testing diary reminder

Note that 3rd February is seven days from today.

If I start Emacs with the command line

         emacs -q --no-site-file

and then use the command `M-x diary', the message "Bad sexp at line 2 in
~/diary: (diary-remind '(diary-anniversary 2 3 2003) 7)" is displayed in
the echo area.

This appears to be due to the fact that `diary-anniversary' no longer
returns a string, so that when `diary-remind' maps `eval' over
`diary-remind-message', `diary-entry' is bound to the cons (nil .
"Testing diary reminder") instead of just "Testing diary reminder".

The attached patch fixes it for me.


Drew.


diff -cr orig/lisp/calendar/diary-lib.el mod/lisp/calendar/diary-lib.el
*** orig/lisp/calendar/diary-lib.el     2005-01-27 00:55:14.000000000 +0000
--- mod/lisp/calendar/diary-lib.el      2005-01-27 00:54:12.000000000 +0000
***************
*** 1626,1632 ****
        (let ((date (calendar-gregorian-from-absolute
                     (+ (calendar-absolute-from-gregorian date) days))))
          (if (setq diary-entry (eval sexp))
!             (mapconcat 'eval diary-remind-message ""))))
       ;; Diary entry may apply to one of a list of days before date
       ((and (listp days) days)
        (or (diary-remind sexp (car days) marking)
--- 1626,1635 ----
        (let ((date (calendar-gregorian-from-absolute
                     (+ (calendar-absolute-from-gregorian date) days))))
          (if (setq diary-entry (eval sexp))
!           (let ((diary-entry (if (consp diary-entry)
!                                  (cdr diary-entry)
!                                diary-entry)))
!             (mapconcat 'eval diary-remind-message "")))))
       ;; Diary entry may apply to one of a list of days before date
       ((and (listp days) days)
        (or (diary-remind sexp (car days) marking)
diff -cr orig/lisp/ChangeLog mod/lisp/ChangeLog
*** orig/lisp/ChangeLog 2005-01-27 01:17:31.000000000 +0000
--- mod/lisp/ChangeLog  2005-01-27 01:16:41.000000000 +0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2005-01-27  Andrew Kemp  <address@hidden>
+ 
+       * calendar/diary-lib.el (diary-remind): handle the case where
+       `sexp' evaluates to a cons instead of a string.
+ 
  2005-01-25  Roland Winkler  <address@hidden>
  
        * textmodes/bibtex.el (bibtex-format-entry): Use
In GNU Emacs 21.3.50.8 (i686-pc-linux-gnu, GTK+ Version 2.4.14)
 of 2005-01-27 on onyx
Distributor `The XFree86 Project, Inc', version 11.0.40300001
configured using `configure '--with-xpm' '--with-jpeg' '--with-tiff' 
'--with-gif' '--with-png' '--with-gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t


reply via email to

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