aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-03-04 09:01:37 -0800
committerGlenn Morris2014-03-04 09:01:37 -0800
commit3106d59bce024deba9d6b2193531c09b6a6d3c91 (patch)
treeade312409361ba1cd6ac9b18aa728e548288c959
parentf604dfdc367bf4c628c2c2b6b44ac00eed1f1589 (diff)
downloademacs-3106d59bce024deba9d6b2193531c09b6a6d3c91.tar.gz
emacs-3106d59bce024deba9d6b2193531c09b6a6d3c91.zip
* minibuffer.el (completion-hilit-commonality): Revert 2014-03-01 short-cut,
which changed the return value. Fixes: debbugs:16933
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/minibuffer.el58
2 files changed, 33 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 52d2728dad7..939f150e56e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-03-04 Glenn Morris <rgm@gnu.org>
2
3 * minibuffer.el (completion-hilit-commonality):
4 Revert 2014-03-01 short-cut, which changed the return value. (Bug#16933)
5
12014-03-04 Juanma Barranquero <lekktu@gmail.com> 62014-03-04 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * hilit-chg.el (hilit-chg-unload-function): New function. 8 * hilit-chg.el (hilit-chg-unload-function): New function.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index da3a8ad9df1..526fdb62bc3 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1597,36 +1597,34 @@ This adds the face `completions-common-part' to the first
1597It returns a list with font-lock properties applied to each element, 1597It returns a list with font-lock properties applied to each element,
1598and with BASE-SIZE appended as the last element." 1598and with BASE-SIZE appended as the last element."
1599 (when completions 1599 (when completions
1600 (if (zerop prefix-len) 1600 (let ((com-str-len (- prefix-len (or base-size 0))))
1601 completions 1601 (nconc
1602 (let ((com-str-len (- prefix-len (or base-size 0)))) 1602 (mapcar
1603 (nconc 1603 (lambda (elem)
1604 (mapcar 1604 (let ((str
1605 (lambda (elem) 1605 ;; Don't modify the string itself, but a copy, since the
1606 (let ((str 1606 ;; the string may be read-only or used for other purposes.
1607 ;; Don't modify the string itself, but a copy, since the 1607 ;; Furthermore, since `completions' may come from
1608 ;; the string may be read-only or used for other purposes. 1608 ;; display-completion-list, `elem' may be a list.
1609 ;; Furthermore, since `completions' may come from 1609 (if (consp elem)
1610 ;; display-completion-list, `elem' may be a list. 1610 (car (setq elem (cons (copy-sequence (car elem))
1611 (if (consp elem) 1611 (cdr elem))))
1612 (car (setq elem (cons (copy-sequence (car elem)) 1612 (setq elem (copy-sequence elem)))))
1613 (cdr elem)))) 1613 (font-lock-prepend-text-property
1614 (setq elem (copy-sequence elem))))) 1614 0
1615 (font-lock-prepend-text-property 1615 ;; If completion-boundaries returns incorrect
1616 0 1616 ;; values, all-completions may return strings
1617 ;; If completion-boundaries returns incorrect 1617 ;; that don't contain the prefix.
1618 ;; values, all-completions may return strings 1618 (min com-str-len (length str))
1619 ;; that don't contain the prefix. 1619 'face 'completions-common-part str)
1620 (min com-str-len (length str)) 1620 (if (> (length str) com-str-len)
1621 'face 'completions-common-part str) 1621 (font-lock-prepend-text-property com-str-len (1+ com-str-len)
1622 (if (> (length str) com-str-len) 1622 'face
1623 (font-lock-prepend-text-property com-str-len (1+ com-str-len) 1623 'completions-first-difference
1624 'face 1624 str)))
1625 'completions-first-difference 1625 elem)
1626 str))) 1626 completions)
1627 elem) 1627 base-size))))
1628 completions)
1629 base-size)))))
1630 1628
1631(defun display-completion-list (completions &optional common-substring) 1629(defun display-completion-list (completions &optional common-substring)
1632 "Display the list of completions, COMPLETIONS, using `standard-output'. 1630 "Display the list of completions, COMPLETIONS, using `standard-output'.