From 6315c60e43e62397a8c5396ea1f591b61ea6fcdb Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Wed, 13 Feb 2013 12:34:09 -0700 Subject: Correct behavior of ledger report when entering a new report ledger-report-save would fail if you entered a new report with a name. It wouldn't save the customization to the disk, and if you tried to save manually it would complain about an identical command. --- lisp/ldg-xact.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisp/ldg-xact.el') 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 -- cgit v1.2.3