Subject: Re: bug#12615: 24.2.50; Non-ignored case in insert-char

From: Juri Linkov <[email-masked]>
Date: Sun, 30 Dec 2012 00:56:05 +0200

>> Some observations: C-x 8 C-m is bound to insert-char, a C function.
>> And insert-char calls read-char-by-name, which let-binds
>> completion-ignore-case to t.  The clear intention is that unicode name
>> searches should always be case insensitive, and this seems always to
>> be the case if completion-ignore-case is not buffer local.
>
> Indeed, a buffer-local setting of completion-ignore-case can
> bring surprises.  I think the patch below will fix this problem for this
> particular case.

I just stumbled upon the case where this fix causes the regression:
typing `C-x 8 RET *acc TAB' results in "[No match]".

I don't know why this case disobeys the let-binding of
`completion-ignore-case' and whether a simpler fix is possible,
but at least this patch fixes it for the emacs-24 branch:

=== modified file 'lisp/international/mule-cmds.el'
--- lisp/international/mule-cmds.el	2012-10-11 20:05:47 +0000
+++ lisp/international/mule-cmds.el	2012-12-29 22:45:12 +0000
@@ -2946,10 +2946,12 @@ (defun read-char-by-name (prompt)
 point or a number in hash notation, e.g. #o21430 for octal,
 #x2318 for hex, or #10r8984 for decimal."
   (let ((input
+         (minibuffer-with-setup-hook
+	     (lambda ()
+	       (set (make-local-variable 'completion-ignore-case) t))
          (completing-read
           prompt
           (lambda (string pred action)
-            (let ((completion-ignore-case t))
               (if (eq action 'metadata)
                   '(metadata (category . unicode-name))
                 (complete-with-action action (ucs-names) string pred)))))))