diff options
Diffstat (limited to 'lisp/ledger-schedule.el')
-rw-r--r-- | lisp/ledger-schedule.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/ledger-schedule.el b/lisp/ledger-schedule.el index 723fa2b3..ae08ad36 100644 --- a/lisp/ledger-schedule.el +++ b/lisp/ledger-schedule.el @@ -30,10 +30,11 @@ ;; function slot of the symbol VARNAME. Then use VARNAME as the ;; function without have to use funcall. + (require 'ledger-init) -(eval-when-compile - (require 'cl)) +(require 'cl-macs) +(declare-function ledger-mode "ledger-mode") ;;; Code: (defgroup ledger-schedule nil @@ -101,15 +102,15 @@ COUNT 0) means EVERY day-of-week (eg. every Saturday)" (cond ((zerop count) ;; Return true if day-of-week matches `(eq (nth 6 (decode-time date)) ,day-of-week)) ((> count 0) ;; Positive count - (let ((decoded (gensym))) + (let ((decoded (cl-gensym))) `(let ((,decoded (decode-time date))) (and (eq (nth 6 ,decoded) ,day-of-week) (between (nth 3 ,decoded) ,(* (1- count) 7) ,(* count 7)))))) ((< count 0) - (let ((days-in-month (gensym)) - (decoded (gensym))) + (let ((days-in-month (cl-gensym)) + (decoded (cl-gensym))) `(let* ((,decoded (decode-time date)) (,days-in-month (ledger-schedule-days-in-month (nth 4 ,decoded) @@ -134,9 +135,9 @@ For example every second Friday, regardless of month." (defun ledger-schedule-constrain-date-range (month1 day1 month2 day2) "Return a form of DATE that is true if DATE falls between MONTH1 DAY1 and MONTH2 DAY2." - (let ((decoded (gensym)) - (target-month (gensym)) - (target-day (gensym))) + (let ((decoded (cl-gensym)) + (target-month (cl-gensym)) + (target-day (cl-gensym))) `(let* ((,decoded (decode-time date)) (,target-month (nth 4 decoded)) (,target-day (nth 3 decoded))) |