From 35a5c2e9ebdefa596ad8b46225d34b7c1b472e1b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Nov 2001 15:44:53 +0000 Subject: [PATCH] (timeclock-out): Signal an error if timeclock-last-event is nil. --- lisp/ChangeLog | 5 +++++ lisp/calendar/timeclock.el | 2 ++ 2 files changed, 7 insertions(+) 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 -- 2.39.2