summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-01 21:59:51 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-01 21:59:51 -0700
commitc875de881a3998ec9a9815acded80f381701e711 (patch)
tree26e69e81f82dd21653f6c275adfcb7a84e3a456a /lisp
parent37ea7f9b1fdb4fda416f1e35141e4778f1a3c138 (diff)
downloadfork-ledger-c875de881a3998ec9a9815acded80f381701e711.tar.gz
fork-ledger-c875de881a3998ec9a9815acded80f381701e711.tar.bz2
fork-ledger-c875de881a3998ec9a9815acded80f381701e711.zip
Fixed key-binges
The fancy lambdas detecting whether or not the command could be run weren't passing interactive arguments
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-mode.el34
1 files changed, 15 insertions, 19 deletions
diff --git a/lisp/ldg-mode.el b/lisp/ldg-mode.el
index 91bfb973..c6d899de 100644
--- a/lisp/ldg-mode.el
+++ b/lisp/ldg-mode.el
@@ -41,14 +41,6 @@ customizable to ease retro-entry.")
(defvar ledger-mode-abbrev-table)
-(defmacro ledger-run-if-works (func-to-call)
- "Macro to run func-to-call only if the ledger-works variable is non-nil"
- `(lambda ()
- (interactive)
- (if ledger-works
- (funcall ,func-to-call)
- (message "Cannot run ledger, check your ledger executable"))))
-
;;;###autoload
(define-derived-mode ledger-mode text-mode "Ledger"
"A mode for editing ledger data files."
@@ -70,25 +62,29 @@ customizable to ease retro-entry.")
(set (make-local-variable 'pcomplete-termination-string) "")
(let ((map (current-local-map)))
- (define-key map [(control ?c) (control ?a)] (ledger-run-if-works 'ledger-add-entry))
+; (define-key map [(control ?c) (control ?a)] '(lambda (account)
+; (interactive "sAccount:")
+; (if ledger-works
+; (ledger-add-entry account))))
+ (define-key map [(control ?c) (control ?a)] 'ledger-add-entry)
(define-key map [(control ?c) (control ?d)] 'ledger-delete-current-entry)
- (define-key map [(control ?c) (control ?y)] (ledger-run-if-works 'ledger-set-year))
- (define-key map [(control ?c) (control ?m)] (ledger-run-if-works 'ledger-set-month))
+ (define-key map [(control ?c) (control ?y)] 'ledger-set-year)
+ (define-key map [(control ?c) (control ?m)] 'ledger-set-month)
(define-key map [(control ?c) (control ?c)] 'ledger-toggle-current)
(define-key map [(control ?c) (control ?e)] 'ledger-toggle-current-entry)
- (define-key map [(control ?c) (control ?r)] (ledger-run-if-works 'ledger-reconcile))
+ (define-key map [(control ?c) (control ?r)] 'ledger-reconcile)
(define-key map [(control ?c) (control ?s)] 'ledger-sort-region)
- (define-key map [(control ?c) (control ?t)] (ledger-run-if-works 'ledger-test-run))
+ (define-key map [(control ?c) (control ?t)] 'ledger-test-run)
(define-key map [tab] 'pcomplete)
(define-key map [(control ?i)] 'pcomplete)
(define-key map [(control ?c) tab] 'ledger-fully-complete-entry)
(define-key map [(control ?c) (control ?i)] 'ledger-fully-complete-entry)
- (define-key map [(control ?c) (control ?o) (control ?r)] (ledger-run-if-works 'ledger-report))
- (define-key map [(control ?c) (control ?o) (control ?g)] (ledger-run-if-works 'ledger-report-goto))
- (define-key map [(control ?c) (control ?o) (control ?a)] (ledger-run-if-works 'ledger-report-redo))
- (define-key map [(control ?c) (control ?o) (control ?s)] (ledger-run-if-works 'ledger-report-save))
- (define-key map [(control ?c) (control ?o) (control ?e)] (ledger-run-if-works 'ledger-report-edit))
- (define-key map [(control ?c) (control ?o) (control ?k)] (ledger-run-if-works 'ledger-report-kill))
+ (define-key map [(control ?c) (control ?o) (control ?r)] 'ledger-report)
+ (define-key map [(control ?c) (control ?o) (control ?g)] 'ledger-report-goto)
+ (define-key map [(control ?c) (control ?o) (control ?a)] 'ledger-report-redo)
+ (define-key map [(control ?c) (control ?o) (control ?s)] 'ledger-report-save)
+ (define-key map [(control ?c) (control ?o) (control ?e)] 'ledger-report-edit)
+ (define-key map [(control ?c) (control ?o) (control ?k)] 'ledger-report-kill)
(define-key map [menu-bar] (make-sparse-keymap "ldg-menu"))