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#23902: 25.1.50; Strange warning on string-collate-equalp's docstring Date: Sat, 09 Jul 2016 20:21:49 +0300 Message-ID: <83shvig21e.fsf@gnu.org> References: <87vb0jeo56.fsf@telefonica.net> <831t36omxx.fsf@gnu.org> <87bn2aolcm.fsf@web.de> <83inwin5uu.fsf@gnu.org> <87oa6aepls.fsf@wanadoo.es> <838txen363.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1468085005 26163 80.91.229.3 (9 Jul 2016 17:23:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2016 17:23:25 +0000 (UTC) Cc: michael_heerdegen@web.de, oscarfv@telefonica.net, 23902@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 09 19:23:15 2016 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 1bLvyD-0004Mq-TU for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 19:23:14 +0200 Original-Received: from localhost ([::1]:51896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLvyC-0004ZU-Sx for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 13:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLvy6-0004ZO-Ei for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 13:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLvy2-0004wx-7d for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 13:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLvy2-0004wt-44 for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLvy1-0003QA-Vb for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 13:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2016 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23902 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23902-submit@debbugs.gnu.org id=B23902.146808493013072 (code B ref 23902); Sat, 09 Jul 2016 17:23:01 +0000 Original-Received: (at 23902) by debbugs.gnu.org; 9 Jul 2016 17:22:10 +0000 Original-Received: from localhost ([127.0.0.1]:44348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLvxC-0003Om-L0 for submit@debbugs.gnu.org; Sat, 09 Jul 2016 13:22:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLvxA-0003OY-Tt for 23902@debbugs.gnu.org; Sat, 09 Jul 2016 13:22:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLvx2-0004iK-Js for 23902@debbugs.gnu.org; Sat, 09 Jul 2016 13:22:03 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLvx2-0004i5-GY; Sat, 09 Jul 2016 13:22:00 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1988 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLvwy-0002tF-9U; Sat, 09 Jul 2016 13:21:56 -0400 In-reply-to: (message from Glenn Morris on Sat, 09 Jul 2016 13:06:57 -0400) 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" Xref: news.gmane.org gmane.emacs.bugs:120709 Archived-At: > From: Glenn Morris > Cc: oscarfv@telefonica.net (Óscar Fuentes), > michael_heerdegen@web.de, 23902@debbugs.gnu.org > Date: Sat, 09 Jul 2016 13:06:57 -0400 > > But no-one using Emacs will reason in this way. > "I want to compare if two files are the same. > I don't know about file-equal-p, so I will just do a string comparison > of the filenames. > I know that the MS Windows function to compare strings is CompareString. > Therefore I will see which Emacs function uses that. > Ah, it is string-collate-equalp. > Therefore I will use string-collate-equalp to compare two file names. > I won't use the more obvious string-equal, nor will I read the > documentation of string-collate-equalp, which makes it obvious that this > is wrong." No, no one will reason this way. But they can reason this way instead: "I want to compare two file names. Collation is a way to compare strings, for example the man page for strcoll says the function returns zero if one string is equal to the other. And Emacs just learned how to use collation to compare strings, it has this great new function string-collate-equalp. Therefore, let's use string-collate-equalp for comparing two file names." > And suppose I have two strings, and want to know if they are equal, > respecting my locale's convention about characters that are not > literally identical, but have the same meaning. I should use > string-collate-equalp for this. This is true whether the strings > represent the names of elephants in a zoo, or files on a disk. And that is exactly the fallacy that the note warns against. Because filesystems don't compare as equal characters that have the same meaning, they compare bytes in a byte stream that is the file name in its raw byte form, as recorded on disk.