diff options
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r-- | lisp/ldg-xact.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el index e7402652..ab2c34f4 100644 --- a/lisp/ldg-xact.el +++ b/lisp/ldg-xact.el @@ -64,4 +64,15 @@ (overlay-put ovl 'face 'ledger-font-highlight-face) (overlay-put ovl 'priority 100)))) +(defun ledger-xact-payee () + "Returns the payee of the entry containing point or nil." + (let ((i 0)) + (while (eq (ledger-context-line-type (ledger-context-other-line i)) 'acct-transaction) + (setq i (- i 1))) + (let ((context-info (ledger-context-other-line i))) + (if (eq (ledger-context-line-type context-info) 'entry) + (ledger-context-field-value context-info 'payee) + nil)))) + + (provide 'ldg-xact)
\ No newline at end of file |