From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22169: 25.0.50; File name compiletion doesn't work with non-ASCII characters on OS X Date: Tue, 15 Dec 2015 21:56:37 +0200 Message-ID: <831tan32q2.fsf@gnu.org> References: <83y4cw3kie.fsf@gnu.org> <83twnk3fg1.fsf@gnu.org> <83oads2x99.fsf@gnu.org> <83io3z3drh.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1450209442 26539 80.91.229.3 (15 Dec 2015 19:57:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 19:57:22 +0000 (UTC) Cc: 22169@debbugs.gnu.org To: Anders Lindgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 15 20:57:12 2015 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 1a8vih-0000cq-JJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 20:57:11 +0100 Original-Received: from localhost ([::1]:38936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8vih-0007C2-3g for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 14:57:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8vid-0007Bj-RR for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 14:57:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8viY-0004RQ-RF for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 14:57:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8viY-0004R4-Ng for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 14:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a8viY-0003HY-IH for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 14:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Dec 2015 19:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22169 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22169-submit@debbugs.gnu.org id=B22169.145020939412562 (code B ref 22169); Tue, 15 Dec 2015 19:57:02 +0000 Original-Received: (at 22169) by debbugs.gnu.org; 15 Dec 2015 19:56:34 +0000 Original-Received: from localhost ([127.0.0.1]:52940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8vi6-0003GY-MQ for submit@debbugs.gnu.org; Tue, 15 Dec 2015 14:56:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41869) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8vi4-0003GL-Rq for 22169@debbugs.gnu.org; Tue, 15 Dec 2015 14:56:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8vhu-00048f-Ix for 22169@debbugs.gnu.org; Tue, 15 Dec 2015 14:56:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8vhu-00048b-GC; Tue, 15 Dec 2015 14:56:22 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3254 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1a8vht-00052y-JA; Tue, 15 Dec 2015 14:56:22 -0500 In-reply-to: (message from Anders Lindgren on Tue, 15 Dec 2015 20:16:03 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:110029 Archived-At: > Date: Tue, 15 Dec 2015 20:16:03 +0100 > From: Anders Lindgren > Cc: 22169@debbugs.gnu.org > > I think we should remove that, and leave behind an alias that uses > utf-8-hfs, which is provided by Emacs. There's no reason to maintain > 2 identical definitions. > > Sounds reasonable. The implementation is vastly different, so getting rid of > one is definitively an improvement. Can you write a patch to that effect, for emacs-25 branch? > What does this return: > > M-: (file-name-all-completion "åäö" "/that/empty/directory/") RET > > It returns nil. So this is the heart of the problem. I assume that if you do the same with an ASCII first argument, the result is non-nil, yes? Then the next step is to step with a debugger through file_name_completion, and see why this returns nil instead of a list of files that begin. > Just out of curiosity -- how does `file-name-all-completions' work? Is the FILE > argument encoded to decomposed form, is the file list converted to composed > form, or is this handled by the comparison functions? See dired.c:file_name_completion. In a nutshell, we do this: . encode the file argument . encode the directory argument and pass it to opendir . loop calling readdir, and for each file name it returns: . if the file name begins with the same characters as the encoded file argument, then: . decode the file name . cons the decoded name onto the list to be returned The above is for file-name-all-completions; for file-name-completion the last step is more complicated, but we should understand the file-name-all-completions case first. When you step through the code, please pay attention to the encoded file names. My guess is that somehow the call to scmp around line 500 fails, or maybe we don't count characters correctly in this case. Thanks.