From: Roland McGrath Date: Tue, 5 Apr 1994 01:34:09 +0000 (+0000) Subject: (calendar-cursor-to-date): Fix to signal error when appropriate. X-Git-Tag: emacs-19.34~9180 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1beddd9bb17be71824d52b6a6d4bf7cb045f456a;p=emacs.git (calendar-cursor-to-date): Fix to signal error when appropriate. --- diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index b1495c45633..124125f88df 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1962,12 +1962,12 @@ ERROR is t, otherwise just returns nil." (list month (string-to-int (buffer-substring (1+ (point)) (+ 4 (point)))) year)) - (if (looking-at "\\*") - (save-excursion - (re-search-backward "[^*]") - (if (looking-at ".\\*\\*") - (list month starred-day year) - (if error (error "Cursor is not on a date!")))))))) + (if (and (looking-at "\\*") + (save-excursion + (re-search-backward "[^*]") + (looking-at ".\\*\\*"))) + (list month starred-day year) + (if error (error "Cursor is not on a date!")))))) (defun calendar-cursor-to-nearest-date () "Move the cursor to the closest date.