From: Daniel Colascione Date: Tue, 24 Dec 2013 03:48:55 +0000 (-0800) Subject: Change icomplete to display completions on initial input X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~214 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d64b6308194322eb4b947c78ea8c68e09a77e638;p=emacs.git Change icomplete to display completions on initial input --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3e1157a08a..35920095e7a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2013-12-24 Daniel Colascione + + * icomplete.el: Remove redundant :group arguments to `defcustom' + throughout. + (icomplete-show-matches-on-no-input): New customizable variable. + (icomplete-minibuffer-setup): Call `icomplete-exhibit' on setup if + we have something to show. + (icomplete-exhibit): Compute completions even if we have no user + input. + 2013-12-23 Daniel Colascione * icomplete.el: Move `provide' to end of file. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 73b58220122..740a1967b33 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -76,13 +76,16 @@ "When non-nil, hide common prefix from completion candidates. When nil, show candidates in full." :type 'boolean - :version "24.4" - :group 'icomplete) + :version "24.4") + +(defcustom icomplete-show-matches-on-no-input t + "When non-nil, show completions when first prompting for input." + :type 'boolean + :version "24.4") (defface icomplete-first-match '((t :weight bold)) "Face used by icomplete for highlighting first match." - :version "24.4" - :group 'icomplete) + :version "24.4") ;;;_* User Customization variables (defcustom icomplete-prospects-height @@ -91,24 +94,20 @@ When nil, show candidates in full." (+ 1 (/ (+ icomplete-prospects-length 20) (window-width))) "Maximum number of lines to use in the minibuffer." :type 'integer - :group 'icomplete :version "23.1") (defcustom icomplete-compute-delay .3 "Completions-computation stall, used only with large-number completions. See `icomplete-delay-completions-threshold'." - :type 'number - :group 'icomplete) + :type 'number) (defcustom icomplete-delay-completions-threshold 400 "Pending-completions number over which to apply `icomplete-compute-delay'." - :type 'integer - :group 'icomplete) + :type 'integer) (defcustom icomplete-max-delay-chars 3 "Maximum number of initial chars to apply icomplete compute delay." - :type 'integer - :group 'icomplete) + :type 'integer) (defvar icomplete-in-buffer nil "If non-nil, also use Icomplete when completing in non-mini buffers.") @@ -256,7 +255,9 @@ Usually run by inclusion in `minibuffer-setup-hook'." (current-local-map))) (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) (add-hook 'post-command-hook #'icomplete-post-command-hook nil t) - (run-hooks 'icomplete-minibuffer-setup-hook))) + (run-hooks 'icomplete-minibuffer-setup-hook) + (when icomplete-show-matches-on-no-input + (icomplete-exhibit)))) (defvar icomplete--in-region-buffer nil) @@ -304,8 +305,8 @@ and `minibuffer-setup-hook'." (save-excursion (goto-char (point-max)) ; Insert the match-status information: - (if (and (> (icomplete--field-end) (icomplete--field-beg)) - buffer-undo-list ; Wait for some user input. + (if (and (or icomplete-show-matches-on-no-input + (> (icomplete--field-end) (icomplete--field-beg))) (or ;; Don't bother with delay after certain number of chars: (> (- (point) (icomplete--field-beg))