summaryrefslogtreecommitdiff
path: root/lisp/icomplete.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/icomplete.el')
-rw-r--r--lisp/icomplete.el28
1 files changed, 16 insertions, 12 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index b4db4524a7b..aa3c5680a7e 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -69,11 +69,12 @@ When nil, show candidates in full."
:type 'boolean
:version "24.4")
-(defvar icomplete-tidy-shadowed-file-names nil
+(defcustom icomplete-tidy-shadowed-file-names nil
"If non-nil, automatically delete superfluous parts of file names.
For example, if the user types ~/ after a long path name,
everything preceding the ~/ is discarded so the interactive
-selection process starts again from the user's $HOME.")
+selection process starts again from the user's $HOME."
+ :type 'boolean)
(defcustom icomplete-show-matches-on-no-input nil
"When non-nil, show completions when first prompting for input.
@@ -137,10 +138,11 @@ See `icomplete-delay-completions-threshold'."
"Maximum number of initial chars to apply `icomplete-compute-delay'."
:type 'integer)
-(defvar icomplete-in-buffer nil
+(defcustom icomplete-in-buffer nil
"If non-nil, also use Icomplete when completing in non-mini buffers.
This affects commands like `completion-in-region', but not commands
-that use their own completions setup.")
+that use their own completions setup."
+ :type 'boolean)
(defcustom icomplete-minibuffer-setup-hook nil
"Icomplete-specific customization of minibuffer setup.
@@ -717,11 +719,14 @@ If it's on, just add the vertical display."
Should be run via minibuffer `post-command-hook'.
See `icomplete-mode' and `minibuffer-setup-hook'."
(when (and icomplete-mode
+ ;; Check if still in the right buffer (bug#61308)
+ (or (window-minibuffer-p) completion-in-region--data)
(icomplete-simple-completing-p)) ;Shouldn't be necessary.
- (let ((saved-point (point)))
+ (let ((saved-point (point))
+ (completion-lazy-hilit t))
(save-excursion
(goto-char (icomplete--field-end))
- ; Insert the match-status information:
+ ;; Insert the match-status information:
(when (and (or icomplete-show-matches-on-no-input
(not (equal (icomplete--field-string)
icomplete--initial-input)))
@@ -784,10 +789,8 @@ and SUFFIX, if non-nil, are obtained from `affixation-function' or
`group-function'. Consecutive `equal' sections are avoided.
COMP is the element in PROSPECTS or a transformation also given
by `group-function''s second \"transformation\" protocol."
- (let* ((aff-fun (or (completion-metadata-get md 'affixation-function)
- (plist-get completion-extra-properties :affixation-function)))
- (ann-fun (or (completion-metadata-get md 'annotation-function)
- (plist-get completion-extra-properties :annotation-function)))
+ (let* ((aff-fun (completion-metadata-get md 'affixation-function))
+ (ann-fun (completion-metadata-get md 'annotation-function))
(grp-fun (and completions-group
(completion-metadata-get md 'group-function)))
(annotated
@@ -897,7 +900,7 @@ by `group-function''s second \"transformation\" protocol."
'icomplete-selected-match 'append comp)
collect (concat prefix
(make-string (- max-prefix-len (length prefix)) ? )
- comp
+ (completion-lazy-hilit comp)
(make-string (- max-comp-len (length comp)) ? )
suffix)
into lines-aux
@@ -1063,7 +1066,8 @@ matches exist."
(if (< prospects-len prospects-max)
(push comp prospects)
(setq limit t)))
- (setq prospects (nreverse prospects))
+ (setq prospects
+ (nreverse (mapcar #'completion-lazy-hilit prospects)))
;; Decorate first of the prospects.
(when prospects
(let ((first (copy-sequence (pop prospects))))