From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: case-insensitive string comparison Date: Tue, 26 Jul 2022 18:53:12 +0300 Message-ID: <83bktbdg5z.fsf@gnu.org> References: <87ilnsq4cr.fsf@gnu.org> <83o7xddw10.fsf@gnu.org> <83lesgc9ch.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32603"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: sds@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 26 17:56:12 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGMup-0008LD-Nu for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Jul 2022 17:56:11 +0200 Original-Received: from localhost ([::1]:57928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGMuo-0000No-8O for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Jul 2022 11:56:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMrw-0007FT-FG for emacs-devel@gnu.org; Tue, 26 Jul 2022 11:53:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMrv-0003Bp-18; Tue, 26 Jul 2022 11:53:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KUI8N4kTkV7JOs7yP/YkwETHPLLGYC/uqG1jExLwgzE=; b=YydQiDUVB4sP NfYf+Nll32anpF3CpSZYytE/3jnjtuAuVBBONhXXfhvkSp4Sq7F53ost92+g3Ln7YNUzXamqVQbBM Mhe8VtYeSCpW75Ei8AK7aej5wHFBx7fjlAnoHKXZcxpzv9Y2LSTRQ7ePsJZ2biBcPTW5h6e5UYZ9X jyuTLEQ5e1fLt2v6b+zenBlQuQilwmk5J1LuQKSMWnrVzV8qstNyBYIn961V/LY6YhWPlfVkFBx7E sPO2k4y7jFLBj1v4n+tCAwn5cvkUXQ0ghnAIYwn32veFCiltxYti0EbnQknJgas4AFjLWFrbw2UP5 ITjgVpYym/cmnAu7loZSmQ==; Original-Received: from [87.69.77.57] (port=2206 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMrs-0007eK-Fr; Tue, 26 Jul 2022 11:53:10 -0400 In-Reply-To: (message from Sam Steingold on Tue, 26 Jul 2022 10:16:08 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292704 Archived-At: > From: Sam Steingold > Date: Tue, 26 Jul 2022 10:16:08 -0400 > > > Could be something macOS-specific. Maybe your system doesn't define > > the __STDC_ISO_10646__ feature? In that case, string-collate-equalp > > (see the doc string) behaves like string-equal, and that one doesn't > > have a case-insensitive variant. > > How do I find out? > --8<---------------cut here---------------start------------->8--- > echo > .zzz.c; > gcc -E -dM .zzz.c | grep __STDC_ISO_10646__ > --8<---------------cut here---------------end--------------->8--- > does not print anything, but maybe I need to `#include' something? No, that exactly means you are getting the string-equal fallback instead. Here on GNU/Linux I get $ gcc -E -dM foo.c | fgrep 10646 #define __STDC_ISO_10646__ 201706L > >> I want to be able to use `string-equal-ignore-case' as a :test argument > >> to things like `cl-find'. > > > > Then write a thin wrapper around compare-strings, and be done. > > I think the need is sufficiently generic, e.g., BBDB provides such a > wrapper, as, I am sure, do many other packages. > Many core files can be simplified by using `string-equal-ignore-case' > (just like with the `string-prefix-p'). I'm not convinced, but I won't mount the barricades if Lars and/or others think we need this.