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

From: Juri Linkov <[email-masked]>
Date: Thu, 10 Jan 2013 02:24:27 +0200

reopen 12615
thanks

>> I'd guess only completing-read would need to do it, rather than
>> read_minibuf.
>
> Then `completing-read-default' would be a good place too
> (anyone who overrides `completing-read-function' have to copy most of
> code from `completing-read-default' anyway).

I tried to do this in `completing-read-default', and it seems to fix the
reported problem, and (make-local-variable 'completion-ignore-case) in
the *scratch* buffer doesn't override the let-binding in `read-char-by-name':

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2013-01-03 00:36:36 +0000
+++ lisp/minibuffer.el	2013-01-10 00:23:05 +0000
@@ -3202,8 +3202,16 @@ (defun completing-read-default (prompt c
                     ;; in minibuffer-local-filename-completion-map can
                     ;; override bindings in base-keymap.
                     base-keymap)))
-         (result (read-from-minibuffer prompt initial-input keymap
-                                       nil hist def inherit-input-method)))
+         ;; Get the value of `completion-ignore-case' from the original
+         ;; buffer where it is either buffer-local or let-bound.
+         (c-i-c completion-ignore-case)
+         (result
+          (minibuffer-with-setup-hook
+              (lambda ()
+                ;; Copy the value from original buffer to the minibuffer.
+                (set (make-local-variable 'completion-ignore-case) c-i-c))
+            (read-from-minibuffer prompt initial-input keymap
+                                  nil hist def inherit-input-method))))
     (when (and (equal result "") def)
       (setq result (if (consp def) (car def) def)))
     result))