From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Random832 Newsgroups: gmane.emacs.bugs Subject: bug#22169: 25.0.50; File name compiletion doesn't work with non-ASCII characters on OS X Date: Wed, 16 Dec 2015 11:00:57 -0500 Message-ID: <874mfimlhi.fsf@fastmail.com> References: <83y4cw3kie.fsf@gnu.org> <83twnk3fg1.fsf@gnu.org> <83oads2x99.fsf@gnu.org> <83io3z3drh.fsf@gnu.org> <831tan32q2.fsf@gnu.org> <87d1u74bvi.fsf@fastmail.com> <83zixb1313.fsf@gnu.org> <83wpse1yuv.fsf@gnu.org> 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 1450281750 10249 80.91.229.3 (16 Dec 2015 16:02:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Dec 2015 16:02:30 +0000 (UTC) To: 22169@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 16 17:02: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 1a9EWp-0006zH-JH for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Dec 2015 17:02:11 +0100 Original-Received: from localhost ([::1]:48048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EWp-0001dg-3X for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Dec 2015 11:02:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EWl-0001db-OR for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:02:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9EWf-0001dV-UQ for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:02:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EWf-0001dQ-Rb for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:02:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a9EWf-0006uP-JQ for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:02:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Random832 Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Dec 2015 16:02:01 +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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145028170426534 (code B ref -1); Wed, 16 Dec 2015 16:02:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Dec 2015 16:01:44 +0000 Original-Received: from localhost ([127.0.0.1]:53727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9EWK-0006tq-KF for submit@debbugs.gnu.org; Wed, 16 Dec 2015 11:01:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36046) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9EWG-0006tb-1S for submit@debbugs.gnu.org; Wed, 16 Dec 2015 11:01:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9EW8-0001Mf-5F for submit@debbugs.gnu.org; Wed, 16 Dec 2015 11:01:30 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EW8-0001MZ-3S for submit@debbugs.gnu.org; Wed, 16 Dec 2015 11:01:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EW3-0001YW-UU for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:01:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9EVy-0001Hy-0G for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:01:23 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:38096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EVx-0001Ho-PU for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 11:01:17 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a9EVw-0005RM-GD for bug-gnu-emacs@gnu.org; Wed, 16 Dec 2015 17:01:16 +0100 Original-Received: from c-68-39-146-59.hsd1.in.comcast.net ([68.39.146.59]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Dec 2015 17:01:16 +0100 Original-Received: from random832 by c-68-39-146-59.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Dec 2015 17:01:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-68-39-146-59.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:AGEd1RkuYZjDg6UexGdaUC7h/6U= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:110050 Archived-At: Eli Zaretskii writes: > I guess some code is not ready to cope with a list of candidate > completions some of which don't match the string-to-complete. Can you > spot which code causes the deletion, and whether that is somehow > related to file-name-all-completions returning all the 3 file names in > this case? It's almost certainly related to that. I couldn't follow all the details about how the completion code works, but it looks like the entire design of completion-pcm--merge-completions is based around finding a common prefix and suffix in the returned strings irrespective of the originally entered text. >> I'd expect it to either offer all three filenames, or just a3. > > It's not really clear what is correct behavior in this case. On other > platforms Emacs will return only a3, but HFS+ stores decomposed > characters precisely to allow all 3 to match. So I think we should > at least cause Emacs return only a3, and ideally also support the > other behavior as an option. I'm not aware of any published rationale for the decision to store decomposed characters. (In my testing I did notice that zsh and bash handle globbing differently - all of the files match a* in bash but not zsh.) I think maybe lax matching as an option would be better than blindly doing comparisons based on the decomposed form. With letters with multiple diacritics, for example, the naïve behavior would mean that one of the one-diacritic forms would match and the other would not. If users really want that behavior they can after all just set the file system encoding to utf-8 instead of utf-8-hfs. > Btw, why is completion-ignore-case nil on HFS+? I understand it's a > case-insensitive file system, isn't it? No idea. (IIRC In principle it's an option that can be disabled, though it's case-insensitive by default) I also feel like I should ask what provisions Emacs has for filesystem-specific case folding - NTFS and HFS both have their own algorithms which are different from each other and may both be different from general-purpose case matching algorithms. >> Why exactly does completion do matching with encoded prefix >> against raw filenames, rather than with unicode prefix against >> decoded filenames, anyway? > > Performance: we don't want to decode every file name that readdir > returns. I'm not sure there's a way around it if we want to be 100% correct and consistent, given the existence of parts of the completion system that do work with the strings in Unicode.