summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-27 10:08:59 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-27 10:08:59 -0700
commita3c958a191b558e6b969c152b319c0211334db32 (patch)
tree099fc67860f4d684144dcf25fdadd2b8f91e4064
parenta40d9f721fa237ed61b6dda7d18e86d18d150db7 (diff)
parent1e3c795935dc5c938b78fc367ee19e1a259b0fb3 (diff)
downloadfork-ledger-a3c958a191b558e6b969c152b319c0211334db32.tar.gz
fork-ledger-a3c958a191b558e6b969c152b319c0211334db32.tar.bz2
fork-ledger-a3c958a191b558e6b969c152b319c0211334db32.zip
Merge branch 'next' into ledger-mode-automatic-transactions
-rw-r--r--doc/ledger3.texi2
-rw-r--r--lisp/ldg-commodities.el1
-rw-r--r--lisp/ldg-regex.el2
-rw-r--r--lisp/ldg-xact.el4
4 files changed, 6 insertions, 3 deletions
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index dbc25d8f..8a78b2f0 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -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
diff --git a/lisp/ldg-commodities.el b/lisp/ldg-commodities.el
index 612350b3..6f835221 100644
--- a/lisp/ldg-commodities.el
+++ b/lisp/ldg-commodities.el
@@ -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
diff --git a/lisp/ldg-regex.el b/lisp/ldg-regex.el
index 680063f7..e81394ef 100644
--- a/lisp/ldg-regex.el
+++ b/lisp/ldg-regex.el
@@ -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
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el
index f5a38ef6..8db50df2 100644
--- a/lisp/ldg-xact.el
+++ b/lisp/ldg-xact.el
@@ -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]+")))