summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-07-03 13:56:44 -0700
committerCraig Earls <enderw88@gmail.com>2013-07-03 13:56:44 -0700
commitbb529381c745c9ed9e4476c1245db84dac4ede71 (patch)
treeac013f082674974e06c84bf075b97e979e08f985 /lisp
parent0d4641acc2748f5f25a1e6207c4bc5ef86d0cba6 (diff)
downloadfork-ledger-bb529381c745c9ed9e4476c1245db84dac4ede71.tar.gz
fork-ledger-bb529381c745c9ed9e4476c1245db84dac4ede71.tar.bz2
fork-ledger-bb529381c745c9ed9e4476c1245db84dac4ede71.zip
Add Schedule Upcoming to Ledger menu
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-mode.el2
-rw-r--r--lisp/ledger-schedule.el2
2 files changed, 3 insertions, 1 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index b0f61d5d..6ad9baf7 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -172,6 +172,7 @@ Can indent, complete or align depending on context."
(define-derived-mode ledger-mode text-mode "Ledger"
"A mode for editing ledger data files."
(ledger-check-version)
+ (ledger-schedule-check-available)
(ledger-post-setup)
(set (make-local-variable 'comment-start) " ; ")
@@ -270,6 +271,7 @@ Can indent, complete or align depending on context."
(define-key map [delete-xact] '(menu-item "Delete Transaction" ledger-delete-current-transaction))
(define-key map [cmp-xact] '(menu-item "Complete Transaction" ledger-fully-complete-xact))
(define-key map [add-xact] '(menu-item "Add Transaction (ledger xact)" ledger-add-transaction :enable ledger-works))
+ (define-key map [add-xact] '(menu-item "Show upcoming transactions" ledger-schedule-upcoming :enable ledger-schedule-available))
(define-key map [sep3] '(menu-item "--"))
(define-key map [stats] '(menu-item "Ledger Statistics" ledger-display-ledger-stats :enable ledger-works))
(define-key map [fold-buffer] '(menu-item "Narrow to REGEX" ledger-occur))))
diff --git a/lisp/ledger-schedule.el b/lisp/ledger-schedule.el
index ce6694d4..53152f39 100644
--- a/lisp/ledger-schedule.el
+++ b/lisp/ledger-schedule.el
@@ -59,7 +59,7 @@
(defsubst between (val low high)
(and (>= val low) (<= val high)))
-(defun ledger-check-schedule-available ()
+(defun ledger-schedule-check-available ()
(setq ledger-schedule-available (and ledger-schedule-file
(file-exists-p ledger-schedule-file))))