diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-15 18:00:05 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-15 18:00:05 -0400 |
commit | c1fd59666e4197c7cfc332fc87e72196c1f51c4c (patch) | |
tree | 8ec63d3efc188f64ef68882bee5dfe7ba27aea15 | |
parent | f232d558a820adea13507d4a6809bd29324b19f5 (diff) | |
download | fork-ledger-c1fd59666e4197c7cfc332fc87e72196c1f51c4c.tar.gz fork-ledger-c1fd59666e4197c7cfc332fc87e72196c1f51c4c.tar.bz2 fork-ledger-c1fd59666e4197c7cfc332fc87e72196c1f51c4c.zip |
Only invoke new completion behavior if C-u is used
-rw-r--r-- | lisp/ledger.el | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lisp/ledger.el b/lisp/ledger.el index 1af54719..bf3fcbac 100644 --- a/lisp/ledger.el +++ b/lisp/ledger.el @@ -1133,20 +1133,22 @@ the default." (while (pcomplete-here (if (eq (save-excursion (ledger-thing-at-point)) 'entry) - (progn - (let ((text (buffer-substring (line-beginning-position) - (line-end-position)))) - (delete-region (line-beginning-position) - (line-end-position)) - (condition-case err - (ledger-add-entry text t) - ((error) - (insert text)))) - (forward-line) - (goto-char (line-end-position)) - (search-backward ";" (line-beginning-position) t) - (skip-chars-backward " \t0123456789.,") - (throw 'pcompleted t)) + (if (null current-prefix-arg) + (ledger-entries) ; this completes against entry names + (progn + (let ((text (buffer-substring (line-beginning-position) + (line-end-position)))) + (delete-region (line-beginning-position) + (line-end-position)) + (condition-case err + (ledger-add-entry text t) + ((error) + (insert text)))) + (forward-line) + (goto-char (line-end-position)) + (search-backward ";" (line-beginning-position) t) + (skip-chars-backward " \t0123456789.,") + (throw 'pcompleted t))) (ledger-accounts))))) (defun ledger-fully-complete-entry () |