summaryrefslogtreecommitdiff
path: root/lisp/ldg-xact.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-25 01:21:19 -0400
committerCraig Earls <enderw88@gmail.com>2013-03-25 01:21:19 -0400
commitd3fe4c666ff37912245d2a0386ac749737f34843 (patch)
treeeaed396df8fce3a52cebe4392babb3ae5df1d464 /lisp/ldg-xact.el
parentcc62e6a886d72bbe2a1a3c673df92b912deefd0c (diff)
downloadfork-ledger-d3fe4c666ff37912245d2a0386ac749737f34843.tar.gz
fork-ledger-d3fe4c666ff37912245d2a0386ac749737f34843.tar.bz2
fork-ledger-d3fe4c666ff37912245d2a0386ac749737f34843.zip
Lots of code cleanup. (if () (progn …) ==> (when () …) all over the place
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r--lisp/ldg-xact.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el
index 3e4cec4b..e2180b57 100644
--- a/lisp/ldg-xact.el
+++ b/lisp/ldg-xact.el
@@ -44,12 +44,10 @@ within the transaction."
(backward-paragraph)
(if (/= (point) (point-min))
(forward-line))
- (beginning-of-line)
- (setq beg-pos (point))
+ (setq beg-pos (line-beginning-position))
(forward-paragraph)
(forward-line -1)
- (end-of-line)
- (setq end-pos (1+ (point)))
+ (setq end-pos (1+ (line-end-position)))
(list beg-pos end-pos))))
@@ -80,11 +78,12 @@ within the transaction."
(defsubst ledger-goto-line (line-number)
"Rapidly move point to line LINE-NUMBER."
-(goto-char (point-min)) (forward-line (1- line-number)))
+ (goto-char (point-min))
+ (forward-line (1- line-number)))
(defun ledger-thing-at-point ()
"Describe thing at points. Return 'transaction, 'posting, or nil."
-(let ((here (point)))
+ (let ((here (point)))
(goto-char (line-beginning-position))
(cond ((looking-at "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.+?)\\)?\\s-+")
(goto-char (match-end 0))
@@ -105,7 +104,7 @@ within the transaction."
(concat ledger-year "/" ledger-month "/") 'ledger-minibuffer-history)))
(let* ((here (point))
(extents (ledger-find-xact-extents (point)))
- (transaction (buffer-substring (car extents) (cadr extents)))
+ (transaction (buffer-substring-no-properties (car extents) (cadr extents)))
encoded-date)
(if (string-match ledger-date-regex date)
(setq encoded-date