Added ability to add xact with date only.

ledger-add-entry now checks to see if more than the date was given at the prompt. If there is only a date it inserts the dat at the correct place in the ledger and puts the point at the end of the line for entering transaction details
This commit is contained in:
Craig Earls 2013-02-07 22:40:57 -07:00
parent 867b84c52e
commit 29f409ce72

View file

@ -193,6 +193,7 @@ Return the difference in the format of a time value."
(string-to-number (match-string 2 date)) (string-to-number (match-string 2 date))
(string-to-number (match-string 1 date))))) (string-to-number (match-string 1 date)))))
(ledger-find-slot date))) (ledger-find-slot date)))
(if (> (length args) 1)
(save-excursion (save-excursion
(insert (insert
(with-temp-buffer (with-temp-buffer
@ -203,7 +204,10 @@ Return the difference in the format of a time value."
(if (looking-at "Error: ") (if (looking-at "Error: ")
(error (buffer-string)) (error (buffer-string))
(buffer-string))) (buffer-string)))
"\n")))) "\n"))
(progn
(insert (car args) " \n\n")
(end-of-line -1)))))
(defun ledger-current-entry-bounds () (defun ledger-current-entry-bounds ()
(save-excursion (save-excursion