aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/icomplete.el11
-rw-r--r--lisp/minibuffer.el10
2 files changed, 4 insertions, 17 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 38115ab2c86..eea5580408b 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -75,11 +75,7 @@ everything preceding the ~/ is discarded so the interactive
75selection process starts again from the user's $HOME.") 75selection 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."
79This also means that if you traverse the list of completions with
80commands like `C-.' and just hit `C-j' (enter) without typing any
81characters, the match under point will be chosen instead of the
82default."
83 :type 'boolean 79 :type 'boolean
84 :version "24.4") 80 :version "24.4")
85 81
@@ -755,10 +751,7 @@ matches exist."
755 (push comp prospects) 751 (push comp prospects)
756 (setq limit t)))) 752 (setq limit t))))
757 (setq prospects (nreverse prospects)) 753 (setq prospects (nreverse prospects))
758 ;; Return the first match if the user hits enter. 754 ;; Decorate first of the prospects.
759 (when icomplete-show-matches-on-no-input
760 (setq-local completion-content-when-empty (car prospects)))
761 ;; Decorate first of the prospects.
762 (when prospects 755 (when prospects
763 (let ((first (copy-sequence (pop prospects)))) 756 (let ((first (copy-sequence (pop prospects))))
764 (put-text-property 0 (length first) 757 (put-text-property 0 (length first)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 864726e3cc0..6deb1eb0778 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1119,7 +1119,6 @@ completion candidates than this number."
1119(defvar-local completion-all-sorted-completions nil) 1119(defvar-local completion-all-sorted-completions nil)
1120(defvar-local completion--all-sorted-completions-location nil) 1120(defvar-local completion--all-sorted-completions-location nil)
1121(defvar completion-cycling nil) ;Function that takes down the cycling map. 1121(defvar completion-cycling nil) ;Function that takes down the cycling map.
1122(defvar completion-content-when-empty nil)
1123 1122
1124(defvar completion-fail-discreetly nil 1123(defvar completion-fail-discreetly nil
1125 "If non-nil, stay quiet when there is no match.") 1124 "If non-nil, stay quiet when there is no match.")
@@ -1504,13 +1503,8 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
1504COMPLETION-FUNCTION is called if the current buffer's content does not 1503COMPLETION-FUNCTION is called if the current buffer's content does not
1505appear to be a match." 1504appear to be a match."
1506 (cond 1505 (cond
1507 ;; Allow user to specify null string. In the case that 1506 ;; Allow user to specify null string
1508 ;; `completion-content-when-empty' is set, use that instead. 1507 ((= beg end) (funcall exit-function))
1509 ((= beg end)
1510 (when completion-content-when-empty
1511 (completion--replace beg end completion-content-when-empty))
1512 (funcall exit-function))
1513
1514 ((test-completion (buffer-substring beg end) 1508 ((test-completion (buffer-substring beg end)
1515 minibuffer-completion-table 1509 minibuffer-completion-table
1516 minibuffer-completion-predicate) 1510 minibuffer-completion-predicate)