Hi,
The icomplete re-build the completion table 'completion-all-sorted-completions' after each key press. However, I think it should keep the 'completion-all-sorted-completions' builded at beging and re-use it afterwise.
At least in Windows, GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32) of 2017-12-09.
How to repeat it:
1: emacs -q
2: icomplete-mode (we can't find anything wired unless we call dired-do-copy on a network-mapped remote file under a slow network)
3: modify function icomplete-exhibit to log as below:
insert '(print completion-all-sorted-completions)' between '(save-excursion (goto-char (point-max))' and '(if (and (or icomplete-show-matches-on-no-input', and C-M-x.
Then it will print 'nil' after each key press which means 'completion-all-sorted-completions' is empty.
4. modify function icomplete-completions to log as below:
insert '(print completion-all-sorted-completions)' at the begining of the function body, prior to "(let* ((minibuffer-completion-table candidates)'.
Then it will print 'nil' after each key press which means 'completion-all-sorted-completions' is empty.
Thereby, it has to call "(comps (completion-all-sorted-completions (icomplete--field-beg) (icomplete--field-end)))' in function icomplete-completions to re-build the completiong table after each key press.
Thanks Stefan Monnier to point out it should be a bug in the help maillist.
By the way, '(sequencep (icomplete--completion-table))' in function icomplete-exhibit always returns 'nil', and the icomplete-delay-completions-threshold actually has no effect.
(print (icomplete--completion-table)) just returns the table name (function to generate the table), but not the content of the table.
By the way again, if call dired-do-copy or dired-do-rename, icomplete-max-delay-chars counts the whole path of the file because, the path has been put to the minibuffer automatically. This may not a bug, however, I think it should be documented.
Best Regards,
Shuguang Sun