diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ldg-complete.el | 11 | ||||
-rw-r--r-- | lisp/ldg-post.el | 13 | ||||
-rw-r--r-- | lisp/ldg-reconcile.el | 2 | ||||
-rw-r--r-- | lisp/ldg-xact.el | 3 |
4 files changed, 16 insertions, 13 deletions
diff --git a/lisp/ldg-complete.el b/lisp/ldg-complete.el index 3686d0fd..6607d372 100644 --- a/lisp/ldg-complete.el +++ b/lisp/ldg-complete.el @@ -145,16 +145,17 @@ Return tree structure" "Completes a transaction if there is another matching payee in the buffer. Does not use ledger xact" (interactive) - (let ((name (caar (ledger-parse-arguments))) - rest-of-name + (let* ((name (caar (ledger-parse-arguments))) + (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 (when (re-search-backward - (concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+" - (regexp-quote name) ) nil t) ;; "\\(\t\\|\n\\| [ \t]\\)" - (setq rest-of-name (buffer-substring-no-properties (match-end 0) (line-end-position))) + (concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.*" + (regexp-quote name) ".*\\)" ) nil t) ;; "\\(\t\\|\n\\| [ \t]\\)" + (setq rest-of-name (match-string 3)) ;; Start copying the postings (forward-line) (while (looking-at "^\\s-+") diff --git a/lisp/ldg-post.el b/lisp/ldg-post.el index e794f071..d68d7f16 100644 --- a/lisp/ldg-post.el +++ b/lisp/ldg-post.el @@ -133,10 +133,15 @@ the account" (setq column ledger-post-amount-alignment-column)) (save-excursion ;; Position the account - ;; (beginning-of-line) - (set-mark (point)) - ;; (delete-horizontal-space) - ;; (insert ledger-default-acct-transaction-indent) + (if (not + (and (looking-at "[ \t]+\n") + (looking-back "[ \n]" (- (point) 2)))) + (progn + (beginning-of-line) + (set-mark (point)) + (delete-horizontal-space) + (insert ledger-default-acct-transaction-indent)) + (set-mark (point))) (goto-char (1+ (line-end-position))) (let* ((mark-first (< (mark) (point))) (begin (if mark-first (mark) (point))) diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el index fd452004..7b3df459 100644 --- a/lisp/ldg-reconcile.el +++ b/lisp/ldg-reconcile.el @@ -397,7 +397,7 @@ POSTING is used in `ledger-clear-whole-transactions' is nil." (defvar ledger-reconcile-mode-abbrev-table) (defun ledger-reconcile-change-target () - "Change the traget amount for the reconciliation process." + "Change the target amount for the reconciliation process." (interactive) (setq ledger-target (ledger-read-commodity-string "Set reconciliation target"))) diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el index 8db50df2..ecd87127 100644 --- a/lisp/ldg-xact.el +++ b/lisp/ldg-xact.el @@ -118,9 +118,6 @@ within the transaction." (replace-match date) (re-search-forward "[1-9][0-9]+\.[0-9]+"))) - - -(provide 'ldg-xact) (provide 'ldg-xact) ;;; ldg-xact.el ends here |