=== modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-30 04:44:52 +0000 +++ lisp/ChangeLog 2012-11-30 06:08:20 +0000 @@ -1,3 +1,8 @@ +2012-11-30 Jambunathan K + + * icomplete.el (icomplete-first-match): New face. + (icomplete-completions): Use it (bug#12638). + 2012-11-30 OKAZAKI Tetsurou (tiny change) * vc/vc.el (vc-register): Allow registering a file which is === modified file 'lisp/icomplete.el' --- lisp/icomplete.el 2012-11-29 21:32:24 +0000 +++ lisp/icomplete.el 2012-11-30 06:01:14 +0000 @@ -76,6 +76,11 @@ :type 'string :version "24.3") +(defface icomplete-first-match '((t :weight bold)) + "Face used by icomplete for highlighting the first match." + :version "24.3" + :group 'icomplete) + ;;;_* User Customization variables (defcustom icomplete-prospects-height ;; 20 is an estimated common size for the prompt + minibuffer content, to @@ -377,6 +382,13 @@ are exhibited within the square braces.) (if (< prospects-len prospects-max) (push comp prospects) (setq limit t)))))) + (setq prospects (nreverse prospects)) + ;; Highlight first of the prospects. + (when (and prospects (not most-is-exact)) + (let ((first (copy-sequence (pop prospects)))) + (put-text-property 0 (length first) + 'face 'icomplete-first-match first) + (push first prospects))) ;; Restore the base-size info, since completion-all-sorted-completions ;; is cached. (if last (setcdr last base-size)) @@ -386,8 +398,7 @@ are exhibited within the square braces.) (and most-is-exact (substring icomplete-separator (string-match "[^ ]" icomplete-separator))) - (mapconcat 'identity (nreverse prospects) - icomplete-separator) + (mapconcat 'identity prospects icomplete-separator) (and limit (concat icomplete-separator "…")) "}") (concat determ " [Matched]"))))))