summaryrefslogtreecommitdiff
path: root/lisp/ldg-xact.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-13 12:34:09 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-13 12:34:09 -0700
commit6315c60e43e62397a8c5396ea1f591b61ea6fcdb (patch)
treef7fc34eb76faf104930f68198a9055f5f12a1414 /lisp/ldg-xact.el
parent822970a7ae3d38216b84fc33bcbfc3178e9639bc (diff)
downloadfork-ledger-6315c60e43e62397a8c5396ea1f591b61ea6fcdb.tar.gz
fork-ledger-6315c60e43e62397a8c5396ea1f591b61ea6fcdb.tar.bz2
fork-ledger-6315c60e43e62397a8c5396ea1f591b61ea6fcdb.zip
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.
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r--lisp/ldg-xact.el11
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