]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (completion--twq-all): Try and preserve each
authorStephen Berman <stephen.berman@gmx.net>
Tue, 30 Jul 2013 20:42:15 +0000 (16:42 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 30 Jul 2013 20:42:15 +0000 (16:42 -0400)
completion's case choice.

Fixes: debbugs:14907
lisp/ChangeLog
lisp/minibuffer.el

index 62a11e229a1859ee3beac4a045b4534fa63ab583..fde62f1fc4d7b805133fb655c7edd222d0b97741 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-30  Stephen Berman  <stephen.berman@gmx.net>
+
+       * minibuffer.el (completion--twq-all): Try and preserve each
+       completion's case choice (bug#14907).
+
 2013-07-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * net/network-stream.el (open-network-stream): Mention the new
index 8bcf3afae056adb2de70e693ded6bf702554a312..e07d28a54d00b91ef9afda48fe81dcc0567e6766 100644 (file)
@@ -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.