From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#11339: 24.1.50; read-{buffer,file-name}-completion-ignore-case fails on non-ascii Date: Tue, 09 Jul 2013 00:08:29 +0200 Message-ID: <87d2qsaen6.fsf@rosalinde.fritz.box> References: <87ehrbyg8t.fsf@escher.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1373321352 4398 80.91.229.3 (8 Jul 2013 22:09:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jul 2013 22:09:12 +0000 (UTC) To: 11339@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 09 00:09:12 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UwJcO-00086V-HJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jul 2013 00:09:12 +0200 Original-Received: from localhost ([::1]:41665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwJcN-0005yp-OQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2013 18:09:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwJcH-0005wO-MX for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2013 18:09:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwJcF-0005GS-57 for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2013 18:09:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwJcF-0005GJ-0d for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2013 18:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UwJcE-0005SL-4n for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2013 18:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jul 2013 22:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11339 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11339-submit@debbugs.gnu.org id=B11339.137332132120937 (code B ref 11339); Mon, 08 Jul 2013 22:09:02 +0000 Original-Received: (at 11339) by debbugs.gnu.org; 8 Jul 2013 22:08:41 +0000 Original-Received: from localhost ([127.0.0.1]:40304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UwJbs-0005Rc-RH for submit@debbugs.gnu.org; Mon, 08 Jul 2013 18:08:41 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:50579) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UwJbq-0005RL-2q for 11339@debbugs.gnu.org; Mon, 08 Jul 2013 18:08:39 -0400 Original-Received: from rosalinde.fritz.box ([89.245.117.113]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MEWPx-1UyBHz1eAr-00Fo6c for <11339@debbugs.gnu.org>; Tue, 09 Jul 2013 00:08:31 +0200 In-Reply-To: <87ehrbyg8t.fsf@escher.home> (Stephen Berman's message of "Wed, 25 Apr 2012 17:37:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:iaHCkyyceCjkdXQ3NxoSVmQ8qMiidZSxRfqUK2/sZVkUoMyDoTq JibucSWE63QowdKayecBWBrQqngBRLTetaHz2UFb4phLm/5J/uJxxP4uTH8W7hejQNqMvjw VfPKYWlrLRtNaNJ8DQen82vNovQMalc1A2UET6qRSSx5LwLhXA0kwPTxLvYngsWlA3f0LwF bZo7vY5uAuc+SVotWcI/g== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76096 Archived-At: On Wed, 25 Apr 2012 17:37:38 +0200 Stephen Berman = wrote: > -1. cd /tmp; touch b=C3=A4h b=C3=84h bla > 0. emacs -Q > 1. M-x customize-option RET read-buffer-completion-ignore-case RET. > Toggle to "on", set for the current session. > M-x customize-option RET read-file-name-completion-ignore-case RET. > Toggle to "on", set for the current session. > 2. C-x C-f b TAB =3D> *Completions* buffer contains, as expected: bla b= =C3=84h b=C3=A4h.=20=20=20=20=20=20=20=20=20 > 3. Visit files `bla', `b=C3=A4h' and `b=C3=84h', switch to buffer *scratc= h* and > repeat step 2, replacing `C-x C-f' with `C-x b' =3D> same results. > 4. C-x C-f b=C3=A4 TAB =3D> Emacs completes the input to "b=C3=A4h".=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 > 5. TAB =3D> Emacs incorrectly reports: "[Sole completion]".=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 > 6. C-x C-f b=C3=84 TAB =3D> Emacs completes the input to "b=C3=84h". > 7. TAB =3D> Emacs incorrectly reports: "[Sole completion]".=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 > 8. Switch to buffer *scratch* and repeat step 4-7, replacing `C-x C-f' > with `C-x b' =3D> same results. This bug still exists in the current trunk. I have an additional observation, which I don't know if I just overlooked in my OP or if there's been a code change since then that's responsible for this observation: if only one of the files `b=C3=A4h' and `b=C3=84h' is being vi= sited, then `C-x b' completes correctly regardless of the case of the input; i.e., if only `b=C3=84h' is in a buffer `C-x b b=C3=A4 TAB' completes to it= , and likewise, if only `b=C3=A4h' is in a buffer `C-x b b=C3=84 TAB' completes t= o it. But if only one of the files `b=C3=A4h' and `b=C3=84h' exists, `C-x C-f' st= ill only completes if the case of the input matches the case of the file name, as above. Here is part of the call chain of find-file: find-file (files.el) -> find-file-read-args -> read-file-name (minibuffer.el) -> read-file-name-default -> completing-read -> read-file-name-internal -> completion-table-in-turn -> completion--file-name-table -> completion-file-name-table -> file-name-completion (dired.c) -> file_name_completion -> fast_string_match_ignore_case (search.c) -> compile_pattern with argument Vascii_canon_table The argument Vascii_canon_table looks suspicious, but maybe it's already been overridden earlier, though I don't see where; or maybe I just don't understand its import here. Anyway, the call chain of switch-to-buffer is quite different: switch-to-buffer (window.el) -> read-buffer-to-switch -> internal-complete-buffer-except (minibuffer.el) -> internal-complete-buffer (minibuf.c) -> (try-completion | all-completions | test-completion) -> Fcompare_strings (file_name_completion also calls Fcompare_strings later, but there's no use of Vascii_canon_table there.) I don't know how to debug this. Steve Berman