summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-schedule.el24
1 files changed, 19 insertions, 5 deletions
diff --git a/lisp/ledger-schedule.el b/lisp/ledger-schedule.el
index 8790399d..ce77f26b 100644
--- a/lisp/ledger-schedule.el
+++ b/lisp/ledger-schedule.el
@@ -297,12 +297,26 @@ returns true if the date meets the requirements"
(ledger-mode))
(length candidates)))
-(defun ledger-schedule-upcoming ()
- (interactive)
+(defun ledger-schedule-upcoming (file look-backward look-forward)
+ "Generate upcoming transaction
+
+FILE is the file containing the scheduled transaction,
+default to `ledger-schedule-file'.
+LOOK-BACKWARD is the number of day in the past to look at
+default to `ledger-schedule-look-backward'
+LOOK-FORWARD is the number of day in the futur to look at
+default to `ledger-schedule-look-forward'
+
+Use a prefix arg to change the default value"
+ (interactive (if current-prefix-arg
+ (list (read-file-name "Schedule File: " () ledger-schedule-file t)
+ (read-number "Look backward: " ledger-schedule-look-backward)
+ (read-number "Look forward: " ledger-schedule-look-forward))
+ (list ledger-schedule-file ledger-schedule-look-backward ledger-schedule-look-forward)))
(ledger-schedule-create-auto-buffer
- (ledger-schedule-scan-transactions ledger-schedule-file)
- ledger-schedule-look-backward
- ledger-schedule-look-forward
+ (ledger-schedule-scan-transactions file)
+ look-backward
+ look-forward
(current-buffer))
(pop-to-buffer ledger-schedule-buffer-name))