summaryrefslogtreecommitdiff
path: root/lisp/ldg-new.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2011-10-06 22:07:01 -0700
committerCraig Earls <enderw88@gmail.com>2011-10-06 22:07:01 -0700
commitb400d65be082165f44e769605aa6a78133cf6d9a (patch)
tree27b18ee35a5c4f60a10cf4f626e15ac30276040b /lisp/ldg-new.el
parente9ccb012c2c5ffe0e9f4916ee859bda95d9d4248 (diff)
parentf0791bbd7297e737d9e13d0b0bb21473b173b2a7 (diff)
downloadfork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.gz
fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.bz2
fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.zip
Merge remote branch 'upstream/next' into next
Diffstat (limited to 'lisp/ldg-new.el')
-rw-r--r--lisp/ldg-new.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/lisp/ldg-new.el b/lisp/ldg-new.el
index 84863c95..64377bb9 100644
--- a/lisp/ldg-new.el
+++ b/lisp/ldg-new.el
@@ -53,4 +53,30 @@
(provide 'ledger)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun ledger-create-test ()
+ (interactive)
+ (save-restriction
+ (org-narrow-to-subtree)
+ (save-excursion
+ (let (text beg)
+ (goto-char (point-min))
+ (forward-line 1)
+ (setq beg (point))
+ (search-forward ":PROPERTIES:")
+ (goto-char (line-beginning-position))
+ (setq text (buffer-substring-no-properties beg (point)))
+ (goto-char (point-min))
+ (re-search-forward ":ID:\\s-+\\([^-]+\\)")
+ (find-file-other-window
+ (format "~/src/ledger/test/regress/%s.test" (match-string 1)))
+ (sit-for 0)
+ (insert text)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (goto-char (line-beginning-position))
+ (delete-char 3)
+ (forward-line 1))))))
+
;;; ledger.el ends here