diff options
Diffstat (limited to 'lisp/icomplete.el')
| -rw-r--r-- | lisp/icomplete.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 3747ae3d281..8a68df876c1 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -75,7 +75,11 @@ everything preceding the ~/ is discarded so the interactive | |||
| 75 | selection process starts again from the user's $HOME.") | 75 | selection process starts again from the user's $HOME.") |
| 76 | 76 | ||
| 77 | (defcustom icomplete-show-matches-on-no-input nil | 77 | (defcustom icomplete-show-matches-on-no-input nil |
| 78 | "When non-nil, show completions when first prompting for input." | 78 | "When non-nil, show completions when first prompting for input. |
| 79 | This also means that if you traverse the list of completions with | ||
| 80 | commands like `C-.' and just hit `C-j' (enter) without typing any | ||
| 81 | characters, the match under point will be chosen instead of the | ||
| 82 | default." | ||
| 79 | :type 'boolean | 83 | :type 'boolean |
| 80 | :version "24.4") | 84 | :version "24.4") |
| 81 | 85 | ||
| @@ -709,7 +713,10 @@ matches exist." | |||
| 709 | (push comp prospects) | 713 | (push comp prospects) |
| 710 | (setq limit t)))) | 714 | (setq limit t)))) |
| 711 | (setq prospects (nreverse prospects)) | 715 | (setq prospects (nreverse prospects)) |
| 712 | ;; Decorate first of the prospects. | 716 | ;; Return the first match if the user hits enter. |
| 717 | (when icomplete-show-matches-on-no-input | ||
| 718 | (setq completion-content-when-empty (car prospects))) | ||
| 719 | ;; Decorate first of the prospects. | ||
| 713 | (when prospects | 720 | (when prospects |
| 714 | (let ((first (copy-sequence (pop prospects)))) | 721 | (let ((first (copy-sequence (pop prospects)))) |
| 715 | (put-text-property 0 (length first) | 722 | (put-text-property 0 (length first) |