Fix xact-find-slot at end of buffer
Using `ledger-add-transaction` to add a transaction with a date that places it at the end of the buffer will "forget" to insert the newline between it and the previous transaction. This error occurs in `ledger-xact-find-slot` where the `(when (and (eobp) last-xact-start)` is entered, but subsequently the `(if (eobp))` is false because the point has been moved to the end of the prior exact, which is not the end of the buffer. The `if` expression is superfluous because the `when` expression has already been entered, and it is broken becase the point gets moved. Removing it fixes the behavior for transactions added at the end of the buffer, and does not break the behavior for transactions added elsewhere. This was observed with Emacs 24.5.50.1 and Ledger 3.1.0-20141005. [ci skip]
This commit is contained in:
parent
9627e2a97b
commit
6fe913aa87
1 changed files with 2 additions and 3 deletions
|
|
@ -89,9 +89,8 @@ MOMENT is an encoded date"
|
|||
(when (and (eobp) last-xact-start)
|
||||
(let ((end (cadr (ledger-navigate-find-xact-extents last-xact-start))))
|
||||
(goto-char end)
|
||||
(if (eobp)
|
||||
(insert "\n")
|
||||
(forward-line))))))
|
||||
(insert "\n")
|
||||
(forward-line)))))
|
||||
|
||||
(defun ledger-xact-iterate-transactions (callback)
|
||||
"Iterate through each transaction call CALLBACK for each."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue