Completion improvements
This commit is contained in:
parent
fda778f2c0
commit
30fe6afebf
2 changed files with 8 additions and 8 deletions
|
|
@ -174,18 +174,18 @@ Return list."
|
||||||
Does not use ledger xact"
|
Does not use ledger xact"
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((name (caar (ledger-parse-arguments)))
|
(let* ((name (caar (ledger-parse-arguments)))
|
||||||
(rest-of-name name)
|
(rest-of-name name)
|
||||||
xacts)
|
xacts)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(when (eq 'transaction (ledger-thing-at-point))
|
(when (eq 'transaction (ledger-thing-at-point))
|
||||||
(delete-region (point) (+ (length name) (point)))
|
(delete-region (point) (+ (length name) (point)))
|
||||||
;; Search backward for a matching payee
|
;; Search backward for a matching payee
|
||||||
(when (re-search-backward
|
(when (re-search-backward
|
||||||
(concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.*"
|
(concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.*"
|
||||||
(regexp-quote name) ".*\\)" ) nil t)
|
(regexp-quote name) ".*\\)" ) nil t)
|
||||||
(setq rest-of-name (match-string 3))
|
(setq rest-of-name (match-string 3))
|
||||||
;; Start copying the postings
|
;; Start copying the postings
|
||||||
(forward-line)
|
(forward-line)
|
||||||
(while (looking-at ledger-account-any-status-regex)
|
(while (looking-at ledger-account-any-status-regex)
|
||||||
(setq xacts (cons (buffer-substring-no-properties
|
(setq xacts (cons (buffer-substring-no-properties
|
||||||
(line-beginning-position)
|
(line-beginning-position)
|
||||||
|
|
@ -196,7 +196,7 @@ Does not use ledger xact"
|
||||||
;; Insert rest-of-name and the postings
|
;; Insert rest-of-name and the postings
|
||||||
(when xacts
|
(when xacts
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(insert rest-of-name ?\n)
|
(insert rest-of-name ?\n)
|
||||||
(while xacts
|
(while xacts
|
||||||
(insert (car xacts) ?\n)
|
(insert (car xacts) ?\n)
|
||||||
(setq xacts (cdr xacts))))
|
(setq xacts (cdr xacts))))
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ Can indent, complete or align depending on context."
|
||||||
(if (= (point) (line-beginning-position))
|
(if (= (point) (line-beginning-position))
|
||||||
(indent-to ledger-post-account-alignment-column)
|
(indent-to ledger-post-account-alignment-column)
|
||||||
(if (and (> (point) 1)
|
(if (and (> (point) 1)
|
||||||
(looking-back "\\([[:print:]]\\)" 1))
|
(looking-back "\\([^ \t]\\)" 1))
|
||||||
(ledger-pcomplete interactively)
|
(ledger-pcomplete interactively)
|
||||||
(ledger-post-align-postings))))
|
(ledger-post-align-postings))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue