1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00

Don't use (format "%s" ...) for string copying (Bug#28774)

As of 2017-10-04 'Speed up (format "%s" STRING) and the like', (format
"%s" STRING) no longer produces a new string.
* lisp/ido.el (ido-completions): Use `copy-sequence' to make a new
string, so that we can add text properties to (copies of) symbol
names.
This commit is contained in:
Noam Postavsky 2017-10-11 20:23:40 -04:00
parent 078fb7f6df
commit b78332c3c6

View File

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