Fix payees and accounts matching to themselves

This would sometimes cause a double tab to be necessary for completion,
although did also provide an accidental "feature" that repeated tabs would
cycle all the way back to the original input
This commit is contained in:
George Kettleborough 2013-04-16 16:12:30 +01:00
parent 2c07d4152a
commit a052898b60

View file

@ -124,6 +124,7 @@ Return list."
root (cdr xact))
(setq root nil elements nil)))
(setq elements (cdr elements)))
(setq root (delete (list (car elements) t) root))
(and root
(sort
(mapcar (function
@ -144,9 +145,12 @@ Return list."
(if (eq (save-excursion
(ledger-thing-at-point)) 'transaction)
(if (null current-prefix-arg)
(ledger-payees-in-buffer) ;; this completes against payee names
(delete
(caar (ledger-parse-arguments))
(ledger-payees-in-buffer)) ;; this completes against payee names
(progn
(let ((text (buffer-substring-no-properties (line-beginning-position)
(let ((text (buffer-substring-no-properties
(line-beginning-position)
(line-end-position))))
(delete-region (line-beginning-position)
(line-end-position))