summaryrefslogtreecommitdiff
path: root/lisp/ledger-schedule.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2016-01-11 19:34:32 -0700
committerCraig Earls <enderw88@gmail.com>2016-01-11 19:34:32 -0700
commit443b12921e1adb86ef9abc6ad380d12570e31f27 (patch)
tree12fcc92081534da9f49f19619c607484b7d124de /lisp/ledger-schedule.el
parentd24be7446dc77cbdd80db6a105ad3b7a8fd919aa (diff)
parentd50ac1722f9450d4963dbd044d555d31b3c44ed2 (diff)
downloadfork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.tar.gz
fork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.tar.bz2
fork-ledger-443b12921e1adb86ef9abc6ad380d12570e31f27.zip
Merge branch 'fix-warnings' of https://github.com/ecraven/ledger into ecraven-fix-warning
# Conflicts: # lisp/ledger-occur.el # lisp/ledger-report.el # lisp/ledger-schedule.el # lisp/ledger-sort.el
Diffstat (limited to 'lisp/ledger-schedule.el')
-rw-r--r--lisp/ledger-schedule.el17
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)))