X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ed7f1a6c5caaf4159125c08db5d18c5471fdd032..366ca7f3da85b695afa34c3c3270b16a16d47f42:/lisp/icomplete.el?ds=sidebyside diff --git a/lisp/icomplete.el b/lisp/icomplete.el index ab67fcfcdf..bdd19194c2 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -179,11 +179,8 @@ otherwise turn it off." (if icomplete-mode ;; The following is not really necessary after first time - ;; no great loss. - (progn - (setq completion-show-inline-help nil) - (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)) - (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) - (setq completion-show-inline-help t))) + (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) + (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))) ;;;_ > icomplete-simple-completing-p () (defun icomplete-simple-completing-p () @@ -209,6 +206,7 @@ Conditions are: "Run in minibuffer on activation to establish incremental completion. Usually run by inclusion in `minibuffer-setup-hook'." (when (and icomplete-mode (icomplete-simple-completing-p)) + (set (make-local-variable 'completion-show-inline-help) nil) (add-hook 'pre-command-hook (lambda () (run-hooks 'icomplete-pre-command-hook)) nil t) @@ -287,6 +285,7 @@ matches exist. \(Keybindings for uniquely matched commands are exhibited within the square braces.)" (let* ((non-essential t) + (md (completion--field-metadata (field-beginning))) (comps (completion-all-sorted-completions)) (last (if (consp comps) (last comps))) (base-size (cdr last)) @@ -299,11 +298,11 @@ are exhibited within the square braces.)" (let* ((most-try (if (and base-size (> base-size 0)) (completion-try-completion - name candidates predicate (length name)) + name candidates predicate (length name) md) ;; If the `comps' are 0-based, the result should be ;; the same with `comps'. (completion-try-completion - name comps nil (length name)))) + name comps nil (length name) md))) (most (if (consp most-try) (car most-try) (if most-try (car comps) ""))) ;; Compare name and most, so we can determine if name is