Subject: Re: bug#28774: Master, emacs-26: Can't add text property to built-in function name.

From: Noam Postavsky <[email-masked]>
Date: Tue, 10 Oct 2017 06:21:41 -0400

Ilya Khaprov <[email-masked]> writes:
>
> After commit :3db388b0bf the following stopped working:
>
> (global-set-key
>  "\M-x"
>  (lambda ()
>    (interactive)
>    (call-interactively
>     (intern
>      (ido-completing-read
>       "M-x "
>       (all-completions "" obarray 'commandp))))))

It seems ido-completions relies on (format "%s" str) to return a copy of
str.  This fixes it:

--- i/lisp/ido.el
+++ w/lisp/ido.el
@@ -4701,7 +4701,7 @@ ido-completions
     (if (and ido-use-faces comps)
 	(let* ((fn (ido-name (car comps)))
 	       (ln (length fn)))
-	  (setq first (format "%s" fn))
+	  (setq first (copy-sequence fn))
 	  (put-text-property 0 ln 'face
 			     (if (= (length comps) 1)
                                  (if ido-incomplete-regexp