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