summaryrefslogtreecommitdiff
path: root/lisp/ldg-texi.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ldg-texi.el')
-rw-r--r--lisp/ldg-texi.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/ldg-texi.el b/lisp/ldg-texi.el
index 9d5383eb..b0334099 100644
--- a/lisp/ldg-texi.el
+++ b/lisp/ldg-texi.el
@@ -2,6 +2,26 @@
(defvar ledger-sample-doc-path "/Users/johnw/src/ledger/doc/sample.dat")
(defvar ledger-normalization-args "--args-only --columns 80")
+(defun ledger-update-test ()
+ (interactive)
+ (goto-char (point-min))
+ (let ((command (buffer-substring (point-min) (line-end-position)))
+ input)
+ (re-search-forward "^<<<\n")
+ (let ((beg (point)) end)
+ (re-search-forward "^>>>")
+ (setq end (match-beginning 0))
+ (forward-line 1)
+ (let ((output-beg (point)))
+ (re-search-forward "^>>>")
+ (goto-char (match-beginning 0))
+ (delete-region output-beg (point))
+ (apply #'call-process-region
+ beg end (expand-file-name "~/Products/ledger/debug/ledger")
+ nil t nil
+ "-f" "-" "--args-only" "--columns=80" "--no-color"
+ (split-string command " "))))))
+
(defun ledger-texi-write-test (name command input output &optional category)
(let ((buf (current-buffer)))
(with-current-buffer (find-file-noselect