From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.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: Thu, 07 Nov 2019 15:34:15 +0100 Message-ID: <87wocb21so.fsf@gmx.net> References: <87ehrbyg8t.fsf@escher.home> <87lfszxtcl.fsf@marxist.se> <83bltvl55x.fsf@gnu.org> <87o8xvz0hp.fsf@gmx.net> <83tv7mkb0l.fsf@gnu.org> <87d0ea9uxg.fsf@gmx.net> <83eeyphr5q.fsf@gnu.org> <87lfsvyd4i.fsf@gmx.net> <87h83jy5kp.fsf@gmx.net> <83v9rzh8gs.fsf@gnu.org> <875zjzy0yg.fsf@gmx.net> <831rulgcw3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="59783"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 11339@debbugs.gnu.org, stefan@marxist.se, Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 07 15:48:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSj5V-000FOA-Iw for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Nov 2019 15:48:41 +0100 Original-Received: from localhost ([::1]:43670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSj5T-0000dz-2z for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Nov 2019 09:48:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49100) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSisJ-0003Wk-Fa for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 09:35:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSisI-0005TI-4V for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 09:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33043) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSisH-0005T9-Vg for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 09:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSisH-0002w6-N8 for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 09:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Nov 2019 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11339 X-GNU-PR-Package: emacs Original-Received: via spool by 11339-submit@debbugs.gnu.org id=B11339.157313728011252 (code B ref 11339); Thu, 07 Nov 2019 14:35:01 +0000 Original-Received: (at 11339) by debbugs.gnu.org; 7 Nov 2019 14:34:40 +0000 Original-Received: from localhost ([127.0.0.1]:41864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSirw-0002vQ-Bb for submit@debbugs.gnu.org; Thu, 07 Nov 2019 09:34:40 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:33983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSirs-0002v9-EP for 11339@debbugs.gnu.org; Thu, 07 Nov 2019 09:34:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573137259; bh=+1fVZVLTB5YG3JvAbkc1fvr129Wvu8rJcl1a8D37EU8=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=VNRh9dZLK0aag1u/9FvgXnN7mbZSMQxF12Z5ASvGIHdKb/A00sOA/9HVX+dYj1anS fTZMsMdlSZvcvbFekbmtlnhkaapSSawQh6JT4oYaNz/NirG5eCgMsxqLtVFfr4vXvf 7Ww6rasFeKi94+BBzXzGHDzf4D2mGz1RHGIIx8XQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-lfs84 ([88.74.20.3]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKsnF-1iCYtC1Vin-00LEc5; Thu, 07 Nov 2019 15:34:19 +0100 In-Reply-To: <831rulgcw3.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Nov 2019 18:58:36 +0200") X-Provags-ID: V03:K1:XpdCwGp477fv1rlpGGWMFisJKrmcLwlpug2pRWgY1t++xActDTW 8yxKc0vBPz1C2zArHavEXMASkAn6VI4CjMF8tQcPvIRPAUZfDRjsUI77zWIp6x6o1CM3y7L jpNQwGllCZUWLaZCuiVCEw8SwFVxcijJrSKPW0xaiU8hzHYXMLMcX+6xY9hewlgsPseYb+8 YpRkIG+h0uOOaTIioSBSg== X-UI-Out-Filterresults: notjunk:1;V03:K0:+kEwK1PnipI=:/YcdtjK8pvl/996g7O9+Qn L/bnzH7WT5a/z61bRpDQUB7tFaBEj7yEAkPjIbwcxNh7vmMCA5acN7seVUM/g9Cwl9/xCRBRD lGQlVW+z5PA1dbimcTS4vJSc51IXMvTKiNPPKdFPtBK8A4pv3z5lp97W1BPDVkTUajQVxy2oq NJ+avSjkmP2WD33ZnUc5VSwMMgR0IpICgq8PRwk8VQY8LDls9lbw+s/qE0xsoqFp0UwxaPnZ4 Z8c76nhXZtviTBxTXoVCYOVpw17RZniGsfWRAO6iUmohdsBWLDJYdYVJ6MYmJrHqYC1GOnQmh WmIXeH5MI0Ie6rf94XX21rmUkguS9/N6t4Q38fbO2WOJxeUaaAP6qCJtBjoXi9c6523zoX9ZS pkBtRrPoFNVg76XZk7Ev+hi+pyy0N9PTiijyjwfOHx6UL6t9R1gEI/3D6nQ0OUdN4Yeoy+SsJ 9KgK+hzJL4CHu/FZ/JFkXTylKpf+UyeQLzs+IIvq7okteeUOAQYK2jbVCdiYoqUZhUwQWpBq7 tPkImPqnG0sOqirFR7xvUvISWMPx6gvEZIq87UzRCe74ghhKDdL+oVHEoaWcDpLTYL7BbNxV+ rQTw4vMarH15JOXL7cLkM4iFybX6CaTkyVVNwj0TLMEhnMeEqVcA3LsMbrzt03CZGbYDQOa5U 4RW4ACmdL+daDStjolvrwtWofk7qJ/U6O25a22WoI0622gpyk8xARTtArgaJlClFC25Ag2cSv V3zJ/vVK03UDkj4E4+FxhyTVgoHmHR1JBmGYd1VN7m1/M0Gh5fHPIt2Rqy9QR5N/mjiPWvCE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:171079 Archived-At: On Wed, 06 Nov 2019 18:58:36 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: stefan@marxist.se, 11339@debbugs.gnu.org >> Date: Mon, 04 Nov 2019 19:02:15 +0100 >>=20 >> >> 1. $ emacs-master -Q --eval '(setq read-buffer-completion-ignore-cas= e tread-file-name-completion-ignore-case t)' /tmp/{bah,bAh,b=C3=A4h,b=C3=84= h} >> >> (*Buffer List* show the buffers bah,bAh,b=C3=A4h,b=C3=84h) >> >> 2. C-x b *scratch* >> >> 3a. C-x b ba TAB >> >> =3D> completes to bah and after TAB displays [Sole completion] >> >> 3b. C-g C-x b bA TAB >> >> =3D> completes to bAh and after TAB displays [Sole completion] >> >> 4a. C-g C-x b b=C3=A4 TAB >> >> =3D> completes to b=C3=A4h and after TAB displays [Sole completion] >> >> 4b. C-g C-x b b=C3=84 TAB >> >> =3D> completes to b=C3=84h and after TAB displays [Sole completion] >> >> 5a. C-g C-x C-f /tmp/ba TAB >> >> =3D> completes to bah and after TAB displays [Complete, but not un= ique] >> >> and *Completions* pops up showing `bAh' and `bah' >> >> 5b. C-g C-x C-f /tmp/bA TAB >> >> =3D> completes to bAh and after TAB displays [Complete, but not un= ique] >> >> and *Completions* pops up showing `bAh' and `bah' >> >> 6a. C-g C-x C-f /tmp/b=C3=A4 TAB >> >> =3D> completes to /tmp/b=C3=A4h and after TAB displays [Complete, = but not unique] >> >> and *Completions* pops up showing `bAh' and `bah' >> >> 6a. C-g C-x C-f /tmp/b=C3=84 TAB >> >> =3D> completes to /tmp/b=C3=84h and after TAB displays [Complete, = but not unique] >> >> and *Completions* pops up showing `bAh' and `bah' >> >>=20 [...] >> the results of `C-x b' in steps 3-4 quoted above >> are incorrect; they should be the same as the results of `C-x C-f' in >> steps 5-6, which are correct (IMO). > > I'm sorry, but someone else will have to dig into this. I tried, but > got lost. I always do when I try to debug non-trivial issues with > completion, what with the endless ping-pong of calls from > minibuffer.el to minibuf.c and back, both directly and indirectly via > variables whose values are functions. > > The best I could see (unless I'm mistaken) is that in the "C-x b" case > the second TAB sees that the string in the minibuffer is a possible > completion, and declares success; it doesn't call all-completions as > I'd expect. If this observation is correct, then relying on > try-completions in this case is what trips us, because try-completions > has special heuristics when the candidates are all identical but for > the letter-case, the result being that only one candidate is returned. > > CC'ing Stefan who might have a better idea of what is going on here. So why do we have to rely on `try-completion' here? Emacs built with the patch below shows the behavior I want with `C-x b' using the above recipe. I assume that are bad side effects elsewhere, but I can't think of any offhand. Steve Berman diff --git a/src/minibuf.c b/src/minibuf.c index f6cf47f1f2..4faf2f856d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1777,9 +1777,7 @@ If FLAG is nil, invoke `try-completion'; if it is t, = invoke `all-completions'; otherwise invoke `test-completion'. */) (Lisp_Object string, Lisp_Object predicate, Lisp_Object flag) { - if (NILP (flag)) - return Ftry_completion (string, Vbuffer_alist, predicate); - else if (EQ (flag, Qt)) + if (EQ (flag, Qt)) { Lisp_Object res =3D Fall_completions (string, Vbuffer_alist, predica= te, Qnil); if (SCHARS (string) > 0)