From: Eli Zaretskii Date: Sat, 3 Nov 2001 15:44:53 +0000 (+0000) Subject: (timeclock-out): Signal an error if timeclock-last-event is nil. X-Git-Tag: emacs-21.2~371 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35a5c2e9ebdefa596ad8b46225d34b7c1b472e1b;p=emacs.git (timeclock-out): Signal an error if timeclock-last-event is nil. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dac92352498..2cc6cce8e79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-11-03 Eli Zaretskii + + * calendar/timeclock.el (timeclock-out): Signal an error if + timeclock-last-event is nil. + 2001-11-01 Richard M. Stallman * files.el (find-backup-file-name): Use make-backup-file-name. diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index e570f9bf2f7..a7f3c73d32d 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -370,6 +370,8 @@ FIND-REASON is non-nil -- or the user calls `timeclock-out' interactively -- call the function `timeclock-get-reason-function' to discover the reason." (interactive "P") + (or timeclock-last-event + (error "You haven't clocked in!")) (if (equal (downcase (car timeclock-last-event)) "o") (error "You've already clocked out!") (timeclock-log