Merge branch 'next' into ledger-mode-documentation

This commit is contained in:
Craig Earls 2013-02-27 10:07:59 -07:00
commit 3db3d23765
4 changed files with 6 additions and 3 deletions

View file

@ -1559,7 +1559,7 @@ whose market value disregards any future changes in the price of
gasoline.
If you do not want price fixing, you can specify this same transaction
in one of two ways, both equivalent (note the lack of the equal sing
in one of two ways, both equivalent (note the lack of the equal sign
from the transaction above):
@smallexample

View file

@ -36,6 +36,7 @@
This only has effect interfacing to calc mode in edit amount"
:type 'boolean
:group 'ledger)
(defun ledger-split-commodity-string (str)
"Split a commoditized amount into two parts"
(let (val

View file

@ -24,6 +24,8 @@
(eval-when-compile
(require 'cl))
(defvar ledger-date-regex "\\([0-9]+\\)[/-]\\([0-9]+\\)[/-]\\([0-9]+\\)")
(defmacro ledger-define-regexp (name regex docs &rest args)
"Simplify the creation of a Ledger regex and helper functions."
(let ((defs

View file

@ -106,7 +106,7 @@ within the transaction."
(extents (ledger-find-xact-extents (point)))
(transaction (buffer-substring (car extents) (cadr extents)))
encoded-date)
(if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)" date)
(if (string-match ledger-date-regex date)
(setq encoded-date
(encode-time 0 0 0 (string-to-number (match-string 3 date))
(string-to-number (match-string 2 date))
@ -114,7 +114,7 @@ within the transaction."
(ledger-find-slot encoded-date)
(insert transaction "\n")
(backward-paragraph)
(re-search-forward "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)")
(re-search-forward ledger-date-regex)
(replace-match date)
(re-search-forward "[1-9][0-9]+\.[0-9]+")))