From c1fd59666e4197c7cfc332fc87e72196c1f51c4c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Feb 2009 18:00:05 -0400 Subject: Only invoke new completion behavior if C-u is used --- lisp/ledger.el | 30 ++++++++++++++++-------------- 1 file 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 () -- cgit v1.2.3