Subject: bug#12638: 24.2.50; FR: Some suggestions for icomplete-mode

From: Stefan Monnier <[email-masked]>
Date: Tue, 23 Oct 2012 15:43:11 -0400

> 1. The icomplete candidates are comma separated but WITHOUT spaces.  It
>    makes readability difficult.
>    So introduce `icomplete-decorations' which can be a copy of
>    `ido-decorations' to begin with.  May be the decorations could be
>    extracted to some other file (minibuffer.el?) and commonly shared by
>    both ido and icomplete.

The lack of space is on purpose, to save screen real-estate, so it
indeed needs to be customizable.  But I don't have a strong opinion on
what the default value should be.

> 2. Support for cycling via C-s and C-r, highlighting and selection of
>    current head (all much like ido-mode)

Not sure what "highlighting" refers to; if you mean to put the first
element in bold, then yes, that fine.

Selection of current head can be done with minibuffer-force-complete
(not bound to any key by default), tho it doesn't exit.  But it should be
easy to add a minibuffer-force-complete-and-exit.

To get you started the patch below adds a keymap to icomplete.

Cycling would also be useful and should similarly be easy to add (it
just needs to play around with (completion-all-sorted-completions) and
store it back via completion--cache-all-sorted-completions, like
minibuffer-force-complete does).

> I can prepare a patch for (1).

We're in feature freeze, so please wait a few weeks before sending
your patch.

        Stefan

=== modified file 'lisp/icomplete.el'
*** lisp/icomplete.el	2012-06-22 17:37:28 +0000
--- lisp/icomplete.el	2012-10-23 19:30:20 +0000
***************
*** 169,174 ****
--- 169,179 ----
  Icomplete does not operate with any specialized completion tables
  except those on this list.")
  
+ (defvar icomplete-minibuffer-map
+   (let ((map (make-sparse-keymap)))
+     (define-key map [?\M-\t] 'minibuffer-force-complete)
+     map))
+ 
  ;;;_ > icomplete-mode (&optional prefix)
  ;;;###autoload
  (define-minor-mode icomplete-mode
***************
*** 208,213 ****
--- 213,220 ----
  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)
+     (use-local-map (make-composed-keymap icomplete-minibuffer-map
+ 					 (current-local-map)))
      (add-hook 'pre-command-hook
  	      (lambda () (let ((non-essential t))
                        (run-hooks 'icomplete-pre-command-hook)))