From 158bc55c6e715be476acacbef2aa8ca9b50c94c6 Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Tue, 30 Jul 2013 16:42:15 -0400 Subject: [PATCH] * lisp/minibuffer.el (completion--twq-all): Try and preserve each completion's case choice. Fixes: debbugs:14907 --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 62a11e229a1..fde62f1fc4d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-07-30 Stephen Berman + + * minibuffer.el (completion--twq-all): Try and preserve each + completion's case choice (bug#14907). + 2013-07-30 Lars Magne Ingebrigtsen * net/network-stream.el (open-network-stream): Mention the new diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 8bcf3afae05..e07d28a54d0 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -568,6 +568,17 @@ for use at QPOS." (cl-assert (string-prefix-p prefix completion 'ignore-case) t) (let* ((new (substring completion (length prefix))) (qnew (funcall qfun new)) + (qprefix + (if (not completion-ignore-case) + qprefix + ;; Make qprefix inherit the case from `completion'. + (let* ((rest (substring completion + 0 (length prefix))) + (qrest (funcall qfun rest))) + (if (completion--string-equal-p qprefix qrest) + (propertize qrest 'face + 'completions-common-part) + qprefix)))) (qcompletion (concat qprefix qnew))) ;; FIXME: Similarly here, Cygwin's mapping trips this ;; assertion. -- 2.39.2