Fix issue in ledger-fully-complete-xact to deal with possible trailing spaces after a payee

This commit is contained in:
Craig Earls 2014-01-13 13:14:02 -07:00
parent 3b5f496536
commit aec2c7af3f

View file

@ -171,11 +171,16 @@ Return list."
(throw 'pcompleted t)))
(ledger-accounts)))))
(defun ledger-trim-trailing-whitespace (str)
(let ((s str))
(when (string-match "[ \t]*$" s)
(replace-match "" nil nil s))))
(defun ledger-fully-complete-xact ()
"Completes a transaction if there is another matching payee in the buffer.
Does not use ledger xact"
(interactive)
(let* ((name (caar (ledger-parse-arguments)))
(let* ((name (ledger-trim-trailing-whitespace (caar (ledger-parse-arguments))))
(rest-of-name name)
xacts)
(save-excursion