summaryrefslogtreecommitdiff
path: root/lisp/ldg-xact.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-13 20:45:22 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-13 20:45:22 -0700
commitc031fa4943760cc6ff8af56ce975ac289e04288e (patch)
tree6f8fabee1c45f5a2076f93f805ffa464b35c5f73 /lisp/ldg-xact.el
parentd31913871fc2ca3ba26e12bb302df2dd93cdd3da (diff)
downloadfork-ledger-c031fa4943760cc6ff8af56ce975ac289e04288e.tar.gz
fork-ledger-c031fa4943760cc6ff8af56ce975ac289e04288e.tar.bz2
fork-ledger-c031fa4943760cc6ff8af56ce975ac289e04288e.zip
Added menu entry for complete entry.
Refactored leg-complete to get rid of some side effect usage
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r--lisp/ldg-xact.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el
index 4b73b2ea..306401af 100644
--- a/lisp/ldg-xact.el
+++ b/lisp/ldg-xact.el
@@ -77,4 +77,19 @@
(defsubst ledger-goto-line (line-number)
(goto-char (point-min)) (forward-line (1- line-number)))
+(defun ledger-thing-at-point ()
+ (let ((here (point)))
+ (goto-char (line-beginning-position))
+ (cond ((looking-at "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.+?)\\)?\\s-+")
+ (goto-char (match-end 0))
+ 'transaction)
+ ((looking-at "^\\s-+\\([*!]\\s-+\\)?[[(]?\\(.\\)")
+ (goto-char (match-beginning 2))
+ 'posting)
+ ((looking-at "^\\(sun\\|mon\\|tue\\|wed\\|thu\\|fri\\|sat\\)\\s-+")
+ (goto-char (match-end 0))
+ 'entry)
+ (t
+ (ignore (goto-char here))))))
+
(provide 'ldg-xact) \ No newline at end of file