summaryrefslogtreecommitdiff
path: root/ledger.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2003-10-13 06:55:15 +0000
committerJohn Wiegley <johnw@newartisans.com>2003-10-13 06:55:15 +0000
commit0d29133f8abee4cd24ca2eecce7f82be7534d5a9 (patch)
tree64c0889f634e2e733a4021ca803d5aafd8951cfe /ledger.el
parentfb4fed00ba3dede4c649e21ce64cf29a8244c8bd (diff)
downloadfork-ledger-0d29133f8abee4cd24ca2eecce7f82be7534d5a9.tar.gz
fork-ledger-0d29133f8abee4cd24ca2eecce7f82be7534d5a9.tar.bz2
fork-ledger-0d29133f8abee4cd24ca2eecce7f82be7534d5a9.zip
*** empty log message ***
Diffstat (limited to 'ledger.el')
-rw-r--r--ledger.el16
1 files changed, 16 insertions, 0 deletions
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)))