Merge pull request #163 from davidkeegan/next
Fixed bug 913 ledger mode C-c C-a and ISO dates. I need to reorganize the regexes, anytime you have to fix the same problem in more than one place you know you could do better...
This commit is contained in:
commit
b4fafbc94d
2 changed files with 4 additions and 3 deletions
|
|
@ -167,8 +167,8 @@ MOMENT is an encoded date"
|
||||||
(while (not (eobp))
|
(while (not (eobp))
|
||||||
(when (looking-at
|
(when (looking-at
|
||||||
(concat "\\(Y\\s-+\\([0-9]+\\)\\|"
|
(concat "\\(Y\\s-+\\([0-9]+\\)\\|"
|
||||||
"\\([0-9]\\{4\\}+\\)?[./]?"
|
"\\([0-9]\\{4\\}+\\)?[./-]?"
|
||||||
"\\([0-9]+\\)[./]\\([0-9]+\\)\\s-+"
|
"\\([0-9]+\\)[./-]\\([0-9]+\\)\\s-+"
|
||||||
"\\(\\*\\s-+\\)?\\(.+\\)\\)"))
|
"\\(\\*\\s-+\\)?\\(.+\\)\\)"))
|
||||||
(let ((found (match-string 2)))
|
(let ((found (match-string 2)))
|
||||||
(if found
|
(if found
|
||||||
|
|
@ -215,7 +215,7 @@ correct chronological place in the buffer."
|
||||||
exit-code)
|
exit-code)
|
||||||
(unless insert-at-point
|
(unless insert-at-point
|
||||||
(let ((date (car args)))
|
(let ((date (car args)))
|
||||||
(if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)" date)
|
(if (string-match "\\([0-9]+\\)[-/]\\([0-9]+\\)[-/]\\([0-9]+\\)" date)
|
||||||
(setq date
|
(setq date
|
||||||
(encode-time 0 0 0 (string-to-number (match-string 3 date))
|
(encode-time 0 0 0 (string-to-number (match-string 3 date))
|
||||||
(string-to-number (match-string 2 date))
|
(string-to-number (match-string 2 date))
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@
|
||||||
(new-end end))
|
(new-end end))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(save-restriction
|
(save-restriction
|
||||||
|
(goto-char beg)
|
||||||
(ledger-next-record-function) ;; make sure point is at the
|
(ledger-next-record-function) ;; make sure point is at the
|
||||||
;; beginning of a xact
|
;; beginning of a xact
|
||||||
(setq new-beg (point))
|
(setq new-beg (point))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue