diff options
| author | Daniel Colascione | 2013-12-23 19:48:55 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2013-12-23 19:48:55 -0800 |
| commit | d64b6308194322eb4b947c78ea8c68e09a77e638 (patch) | |
| tree | a163ef740fb1ad6f86387f2d9100d4bb4e8a6288 | |
| parent | 65faed732bd8faf0864f70351ff6312bc49f2f06 (diff) | |
| download | emacs-d64b6308194322eb4b947c78ea8c68e09a77e638.tar.gz emacs-d64b6308194322eb4b947c78ea8c68e09a77e638.zip | |
Change icomplete to display completions on initial input
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/icomplete.el | 29 |
2 files changed, 25 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3e1157a08a..35920095e7a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-12-24 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * icomplete.el: Remove redundant :group arguments to `defcustom' | ||
| 4 | throughout. | ||
| 5 | (icomplete-show-matches-on-no-input): New customizable variable. | ||
| 6 | (icomplete-minibuffer-setup): Call `icomplete-exhibit' on setup if | ||
| 7 | we have something to show. | ||
| 8 | (icomplete-exhibit): Compute completions even if we have no user | ||
| 9 | input. | ||
| 10 | |||
| 1 | 2013-12-23 Daniel Colascione <dancol@dancol.org> | 11 | 2013-12-23 Daniel Colascione <dancol@dancol.org> |
| 2 | 12 | ||
| 3 | * icomplete.el: Move `provide' to end of file. | 13 | * 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 @@ | |||
| 76 | "When non-nil, hide common prefix from completion candidates. | 76 | "When non-nil, hide common prefix from completion candidates. |
| 77 | When nil, show candidates in full." | 77 | When nil, show candidates in full." |
| 78 | :type 'boolean | 78 | :type 'boolean |
| 79 | :version "24.4" | 79 | :version "24.4") |
| 80 | :group 'icomplete) | 80 | |
| 81 | (defcustom icomplete-show-matches-on-no-input t | ||
| 82 | "When non-nil, show completions when first prompting for input." | ||
| 83 | :type 'boolean | ||
| 84 | :version "24.4") | ||
| 81 | 85 | ||
| 82 | (defface icomplete-first-match '((t :weight bold)) | 86 | (defface icomplete-first-match '((t :weight bold)) |
| 83 | "Face used by icomplete for highlighting first match." | 87 | "Face used by icomplete for highlighting first match." |
| 84 | :version "24.4" | 88 | :version "24.4") |
| 85 | :group 'icomplete) | ||
| 86 | 89 | ||
| 87 | ;;;_* User Customization variables | 90 | ;;;_* User Customization variables |
| 88 | (defcustom icomplete-prospects-height | 91 | (defcustom icomplete-prospects-height |
| @@ -91,24 +94,20 @@ When nil, show candidates in full." | |||
| 91 | (+ 1 (/ (+ icomplete-prospects-length 20) (window-width))) | 94 | (+ 1 (/ (+ icomplete-prospects-length 20) (window-width))) |
| 92 | "Maximum number of lines to use in the minibuffer." | 95 | "Maximum number of lines to use in the minibuffer." |
| 93 | :type 'integer | 96 | :type 'integer |
| 94 | :group 'icomplete | ||
| 95 | :version "23.1") | 97 | :version "23.1") |
| 96 | 98 | ||
| 97 | (defcustom icomplete-compute-delay .3 | 99 | (defcustom icomplete-compute-delay .3 |
| 98 | "Completions-computation stall, used only with large-number completions. | 100 | "Completions-computation stall, used only with large-number completions. |
| 99 | See `icomplete-delay-completions-threshold'." | 101 | See `icomplete-delay-completions-threshold'." |
| 100 | :type 'number | 102 | :type 'number) |
| 101 | :group 'icomplete) | ||
| 102 | 103 | ||
| 103 | (defcustom icomplete-delay-completions-threshold 400 | 104 | (defcustom icomplete-delay-completions-threshold 400 |
| 104 | "Pending-completions number over which to apply `icomplete-compute-delay'." | 105 | "Pending-completions number over which to apply `icomplete-compute-delay'." |
| 105 | :type 'integer | 106 | :type 'integer) |
| 106 | :group 'icomplete) | ||
| 107 | 107 | ||
| 108 | (defcustom icomplete-max-delay-chars 3 | 108 | (defcustom icomplete-max-delay-chars 3 |
| 109 | "Maximum number of initial chars to apply icomplete compute delay." | 109 | "Maximum number of initial chars to apply icomplete compute delay." |
| 110 | :type 'integer | 110 | :type 'integer) |
| 111 | :group 'icomplete) | ||
| 112 | 111 | ||
| 113 | (defvar icomplete-in-buffer nil | 112 | (defvar icomplete-in-buffer nil |
| 114 | "If non-nil, also use Icomplete when completing in non-mini buffers.") | 113 | "If non-nil, also use Icomplete when completing in non-mini buffers.") |
| @@ -256,7 +255,9 @@ Usually run by inclusion in `minibuffer-setup-hook'." | |||
| 256 | (current-local-map))) | 255 | (current-local-map))) |
| 257 | (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) | 256 | (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) |
| 258 | (add-hook 'post-command-hook #'icomplete-post-command-hook nil t) | 257 | (add-hook 'post-command-hook #'icomplete-post-command-hook nil t) |
| 259 | (run-hooks 'icomplete-minibuffer-setup-hook))) | 258 | (run-hooks 'icomplete-minibuffer-setup-hook) |
| 259 | (when icomplete-show-matches-on-no-input | ||
| 260 | (icomplete-exhibit)))) | ||
| 260 | 261 | ||
| 261 | (defvar icomplete--in-region-buffer nil) | 262 | (defvar icomplete--in-region-buffer nil) |
| 262 | 263 | ||
| @@ -304,8 +305,8 @@ and `minibuffer-setup-hook'." | |||
| 304 | (save-excursion | 305 | (save-excursion |
| 305 | (goto-char (point-max)) | 306 | (goto-char (point-max)) |
| 306 | ; Insert the match-status information: | 307 | ; Insert the match-status information: |
| 307 | (if (and (> (icomplete--field-end) (icomplete--field-beg)) | 308 | (if (and (or icomplete-show-matches-on-no-input |
| 308 | buffer-undo-list ; Wait for some user input. | 309 | (> (icomplete--field-end) (icomplete--field-beg))) |
| 309 | (or | 310 | (or |
| 310 | ;; Don't bother with delay after certain number of chars: | 311 | ;; Don't bother with delay after certain number of chars: |
| 311 | (> (- (point) (icomplete--field-beg)) | 312 | (> (- (point) (icomplete--field-beg)) |