From 0d29133f8abee4cd24ca2eecce7f82be7534d5a9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 13 Oct 2003 06:55:15 +0000 Subject: *** empty log message *** --- ledger.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ledger.el (limited to 'ledger.el') diff --git a/ledger.el b/ledger.el new file mode 100644 index 00000000..42be85a6 --- /dev/null +++ b/ledger.el @@ -0,0 +1,16 @@ +(defun ledger-add-entry (entry) + (interactive + (list (read-string "Entry: " + (format-time-string "%m.%d " (current-time))))) + (let ((args (mapcar 'shell-quote-argument (split-string entry)))) + (shell-command + (concat "ledger entry " + (mapconcat 'identity args " ")) t) + (delete-char 5) + (exchange-point-and-mark))) + +(define-derived-mode ledger-mode text-mode "Ledger" + "A mode for editing ledger data files." + (setq comment-start ";" comment-end nil) + (let ((map (current-local-map))) + (define-key map [(control ?c) ?n] 'ledger-add-entry))) -- cgit v1.2.3