summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-mode.el4
-rw-r--r--lisp/ldg-new.el26
2 files changed, 28 insertions, 2 deletions
diff --git a/lisp/ldg-mode.el b/lisp/ldg-mode.el
index 3e9a9106..cc9e8d92 100644
--- a/lisp/ldg-mode.el
+++ b/lisp/ldg-mode.el
@@ -10,8 +10,8 @@
;;("^[0-9]+[-/.=][-/.=0-9]+\\s-+\\(([^)]+)\\s-+\\)?\\([*].+?\\)\\(\\( ;\\| ;\\|$\\)\\)"
;; 2 font-lock-type-face)
("^\\s-+\\([*]\\s-*\\)?\\(\\([[(]\\)?[^*:
- ]+?:[^]);
- ]+?\\([])]\\)?\\)\\( \\| \\|$\\)"
+ ]+?:\\([^]);
+ ]\\|\\s-\\)+?\\([])]\\)?\\)\\( \\| \\|$\\)"
2 font-lock-keyword-face)
("^\\([~=].+\\)" 1 font-lock-function-name-face)
("^\\([A-Za-z]+ .+\\)" 1 font-lock-function-name-face))
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