From 30fe6afebfcde409c53f0d8e4c10dd8ada339b81 Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Mon, 3 Jun 2013 08:45:27 -0700 Subject: Completion improvements --- lisp/ldg-complete.el | 14 +++++++------- lisp/ldg-mode.el | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/ldg-complete.el b/lisp/ldg-complete.el index 66e707c5..4b8b3beb 100644 --- a/lisp/ldg-complete.el +++ b/lisp/ldg-complete.el @@ -174,18 +174,18 @@ Return list." Does not use ledger xact" (interactive) (let* ((name (caar (ledger-parse-arguments))) - (rest-of-name name) - xacts) + (rest-of-name name) + xacts) (save-excursion (when (eq 'transaction (ledger-thing-at-point)) - (delete-region (point) (+ (length name) (point))) - ;; Search backward for a matching payee + (delete-region (point) (+ (length name) (point))) + ;; Search backward for a matching payee (when (re-search-backward (concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.*" (regexp-quote name) ".*\\)" ) nil t) - (setq rest-of-name (match-string 3)) + (setq rest-of-name (match-string 3)) ;; Start copying the postings - (forward-line) + (forward-line) (while (looking-at ledger-account-any-status-regex) (setq xacts (cons (buffer-substring-no-properties (line-beginning-position) @@ -196,7 +196,7 @@ Does not use ledger xact" ;; Insert rest-of-name and the postings (when xacts (save-excursion - (insert rest-of-name ?\n) + (insert rest-of-name ?\n) (while xacts (insert (car xacts) ?\n) (setq xacts (cdr xacts)))) diff --git a/lisp/ldg-mode.el b/lisp/ldg-mode.el index ebe1e4bd..82d00d29 100644 --- a/lisp/ldg-mode.el +++ b/lisp/ldg-mode.el @@ -87,7 +87,7 @@ Can indent, complete or align depending on context." (if (= (point) (line-beginning-position)) (indent-to ledger-post-account-alignment-column) (if (and (> (point) 1) - (looking-back "\\([[:print:]]\\)" 1)) + (looking-back "\\([^ \t]\\)" 1)) (ledger-pcomplete interactively) (ledger-post-align-postings)))) -- cgit v1.2.3