summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-05-02 17:02:52 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-05-02 17:02:52 +0000
commit457d37ba2254ff454f4ddc70304b75bbe55573bb (patch)
tree919782a14c3f597f388bc23ed2553f27be5a94b9 /lisp/minibuffer.el
parent9d4190b2b5ed1c26be90cdd2014d4afd4351d8af (diff)
downloademacs-457d37ba2254ff454f4ddc70304b75bbe55573bb.tar.gz
(completion-hilit-commonality): Revert last change:
the leftover code was actually useful.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el29
1 files changed, 18 insertions, 11 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 58097a91374..2890978908a 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -654,17 +654,24 @@ of the differing parts is, by contrast, slightly highlighted."
(setcdr last nil)
(nconc
(mapcar
- (lambda (str)
- ;; Don't modify the string itself.
- (setq str (copy-sequence str))
- (put-text-property 0 com-str-len
- 'font-lock-face 'completions-common-part
- str)
- (if (> (length str) com-str-len)
- (put-text-property com-str-len (1+ com-str-len)
- 'font-lock-face 'completions-first-difference
- str))
- str)
+ (lambda (elem)
+ (let ((str
+ ;; Don't modify the string itself, but a copy, since the
+ ;; the string may be read-only or used for other purposes.
+ ;; Furthermore, since `completions' may come from
+ ;; display-completion-list, `elem' may be a list.
+ (if (consp elem)
+ (car (setq elem (cons (copy-sequence (car elem))
+ (cdr elem))))
+ (setq elem (copy-sequence elem)))))
+ (put-text-property 0 com-str-len
+ 'font-lock-face 'completions-common-part
+ str)
+ (if (> (length str) com-str-len)
+ (put-text-property com-str-len (1+ com-str-len)
+ 'font-lock-face 'completions-first-difference
+ str)))
+ elem)
completions)
base-size))))