update packages

This commit is contained in:
2025-06-22 17:08:08 +02:00
parent 54e5633369
commit 16a0a6db93
558 changed files with 68349 additions and 26568 deletions

View File

@@ -184,26 +184,18 @@ an alist (ACCOUNT-ELEMENT . NODE)."
(nconc root (list node)))
(setq root (cdr node))))))))
(defun ledger-complete-account-next-steps ()
"Return a list of next steps for the account prefix at point."
;; FIXME: This function is called from `ledger-complete-at-point' which
;; already knows the bounds of the account name to complete. Computing it
;; again here is wasteful.
(let* ((current (buffer-substring
(save-excursion
(unless (eq 'posting (ledger-thing-at-point))
(error "Not on a posting line"))
(point))
(point)))
(defun ledger-complete-account-next-steps (start end)
"Return a list of next steps for the account prefix between START and END."
(let* ((current (buffer-substring start end))
(elements (and current (split-string current ":")))
(root (ledger-accounts-tree))
(prefix nil))
(while (cdr elements)
(let ((xact (assoc (car elements) root)))
(if xact
(let ((entry (assoc (car elements) root)))
(if entry
(setq prefix (concat prefix (and prefix ":")
(car elements))
root (cdr xact))
root (cdr entry))
(setq root nil elements nil)))
(setq elements (cdr elements)))
(setq root (delete (list (car elements) t) root))
@@ -314,9 +306,9 @@ an alist (ACCOUNT-ELEMENT . NODE)."
(= (line-end-position) (match-end 0)))))
(;; Payees
(eq 'transaction
(save-excursion
(prog1 (ledger-thing-at-point)
(setq start (point)))))
(save-excursion
(prog1 (ledger-thing-at-point)
(setq start (point)))))
(setq collection (cons 'nullary #'ledger-payees-list)))
(;; Accounts
(save-excursion
@@ -330,9 +322,10 @@ an alist (ACCOUNT-ELEMENT . NODE)."
(- (match-beginning 0) end)))
realign-after t
collection (cons 'nullary
(if ledger-complete-in-steps
#'ledger-complete-account-next-steps
#'ledger-accounts-list)))))
(if ledger-complete-in-steps
(lambda ()
(ledger-complete-account-next-steps start end))
#'ledger-accounts-list)))))
(when collection
(let ((prefix (buffer-substring-no-properties start end)))
(list start end