From 9ca8a5a0ed3c42ef75d1fca3e457a78edbca1fe6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Nov 2001 15:50:05 +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 8fe3b20fae8..b8f44cf28bd 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-02 Stefan Monnier * international/mule-diag.el (list-character-sets) 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.5