Commit 3106d59b authored by Glenn Morris's avatar Glenn Morris

* minibuffer.el (completion-hilit-commonality): Revert 2014-03-01 short-cut,

which changed the return value.

Fixes: debbugs:16933
parent f604dfdc
2014-03-04 Glenn Morris <rgm@gnu.org>
* minibuffer.el (completion-hilit-commonality):
Revert 2014-03-01 short-cut, which changed the return value. (Bug#16933)
2014-03-04 Juanma Barranquero <lekktu@gmail.com> 2014-03-04 Juanma Barranquero <lekktu@gmail.com>
* hilit-chg.el (hilit-chg-unload-function): New function. * hilit-chg.el (hilit-chg-unload-function): New function.
......
...@@ -1597,36 +1597,34 @@ This adds the face `completions-common-part' to the first ...@@ -1597,36 +1597,34 @@ This adds the face `completions-common-part' to the first
It returns a list with font-lock properties applied to each element, It returns a list with font-lock properties applied to each element,
and with BASE-SIZE appended as the last element." and with BASE-SIZE appended as the last element."
(when completions (when completions
(if (zerop prefix-len) (let ((com-str-len (- prefix-len (or base-size 0))))
completions (nconc
(let ((com-str-len (- prefix-len (or base-size 0)))) (mapcar
(nconc (lambda (elem)
(mapcar (let ((str
(lambda (elem) ;; Don't modify the string itself, but a copy, since the
(let ((str ;; the string may be read-only or used for other purposes.
;; Don't modify the string itself, but a copy, since the ;; Furthermore, since `completions' may come from
;; the string may be read-only or used for other purposes. ;; display-completion-list, `elem' may be a list.
;; Furthermore, since `completions' may come from (if (consp elem)
;; display-completion-list, `elem' may be a list. (car (setq elem (cons (copy-sequence (car elem))
(if (consp elem) (cdr elem))))
(car (setq elem (cons (copy-sequence (car elem)) (setq elem (copy-sequence elem)))))
(cdr elem)))) (font-lock-prepend-text-property
(setq elem (copy-sequence elem))))) 0
(font-lock-prepend-text-property ;; If completion-boundaries returns incorrect
0 ;; values, all-completions may return strings
;; If completion-boundaries returns incorrect ;; that don't contain the prefix.
;; values, all-completions may return strings (min com-str-len (length str))
;; that don't contain the prefix. 'face 'completions-common-part str)
(min com-str-len (length str)) (if (> (length str) com-str-len)
'face 'completions-common-part str) (font-lock-prepend-text-property com-str-len (1+ com-str-len)
(if (> (length str) com-str-len) 'face
(font-lock-prepend-text-property com-str-len (1+ com-str-len) 'completions-first-difference
'face str)))
'completions-first-difference elem)
str))) completions)
elem) base-size))))
completions)
base-size)))))
(defun display-completion-list (completions &optional common-substring) (defun display-completion-list (completions &optional common-substring)
"Display the list of completions, COMPLETIONS, using `standard-output'. "Display the list of completions, COMPLETIONS, using `standard-output'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment