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))
|
||||
(when (looking-at
|
||||
(concat "\\(Y\\s-+\\([0-9]+\\)\\|"
|
||||
"\\([0-9]\\{4\\}+\\)?[./]?"
|
||||
"\\([0-9]+\\)[./]\\([0-9]+\\)\\s-+"
|
||||
"\\([0-9]\\{4\\}+\\)?[./-]?"
|
||||
"\\([0-9]+\\)[./-]\\([0-9]+\\)\\s-+"
|
||||
"\\(\\*\\s-+\\)?\\(.+\\)\\)"))
|
||||
(let ((found (match-string 2)))
|
||||
(if found
|
||||
|
|
@ -215,7 +215,7 @@ correct chronological place in the buffer."
|
|||
exit-code)
|
||||
(unless insert-at-point
|
||||
(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
|
||||
(encode-time 0 0 0 (string-to-number (match-string 3 date))
|
||||
(string-to-number (match-string 2 date))
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
(new-end end))
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(goto-char beg)
|
||||
(ledger-next-record-function) ;; make sure point is at the
|
||||
;; beginning of a xact
|
||||
(setq new-beg (point))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue