From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: dired-do-find-regexp failure with latin-1 encoding Date: Sat, 28 Nov 2020 20:44:41 +0100 Message-ID: <87y2ili7va.fsf@gmx.net> References: <87blfhjr4q.fsf@gmx.net> <83k0u5mjvf.fsf@gnu.org> <877dq5jp51.fsf@gmx.net> <83im9pmh0v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32927"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 28 20:47:25 2020 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 1kj6Bn-0008QF-8g for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Nov 2020 20:47:23 +0100 Original-Received: from localhost ([::1]:44840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kj6Bm-00082H-A1 for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Nov 2020 14:47:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kj69J-0006nw-Iv for emacs-devel@gnu.org; Sat, 28 Nov 2020 14:44:49 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:50937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kj69H-00009L-SW; Sat, 28 Nov 2020 14:44:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606592686; bh=FAZnvNzuhYlVz9N4FEEwt0329fixoJrtrG0Ne8rs6Hk=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=RBxo3vQmS3gRlOIk7f4+1y/gqkIYGfSe3bnacYpDlEytjDukO/XmwAAL2SU9lot+q E2Jlj21bfjoe/9urVt4ThapgBwGWkVjvBXPk7c8WurD5nQv1PzKki0xvyRmvogsUzz ie3Ofu4M/Yusr1NzE83Cbip3P3jbGBUWXG1OTzjU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([188.109.153.25]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVeI8-1kbRBR3wAe-00RZnW; Sat, 28 Nov 2020 20:44:46 +0100 In-Reply-To: <83im9pmh0v.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Nov 2020 21:13:20 +0200") X-Provags-ID: V03:K1:mGEFectiV3SbG3s8DR6p/n/hL5A3D/tJHecxbstYFtGjF/Dlslh BRU4NtqBW1CrDXHHCPcOo9CBj4pltNSa7vynd/B92ebscvwtvEUgTqgoRrqfm+dhgK9Dd2T 8y7C1w1BSAfd4WL05CWMnPWw9PmQorZaFtQqDrg0ZnpFhI899BXB8msJIdx7JruME5BBSpm 6bx9VoW9poiuLX1h+7pzw== X-UI-Out-Filterresults: notjunk:1;V03:K0:q2TBUGC0GCQ=:s5HvoOkTILFtAH4naILkeB auLI1cXXnLiV5ZQf5VjtaZQVyTYFPjgulDyQ7ic6Be6kCwFuNFD5bS+MALcFvSkeNRRfTcEys SagCT58dzqMNaxjLxvCg1eu1+YjsuHZ4K+g3bWuvU+Zsa/6eHN57ZgDP6u1YM30N+gHE/Ri/P bAcK0IH4vK+SP8fI6ziR++6aLYvjU22Ngg9b7XRZtXf0ArgGQ9+YIPHgyFnCBjMstDFH8Gddx GHWL7XlMHcO0xdCrlpmeMGzcoxKCnQnG0G0CFh6hmvVO0xzub7C5VoIpR/SEZU2mtv5c6+wnO zbechrxEleJlUcbGdoIL8R01Fsyf9T3cuhmzaQVSisAcDKUoo/h3Lmf42PH3c21nf7jVPPqUa ZKCxcN9t9keKXfEycfrr0kE1xBOnlOv1dsW0kd9rkb40bzIdeA3NTNhUjYDXRB3yyD0VGBu6X Hp4nSjTsf8ZK8zZjZIfwLHsVigvCDfgjH3sh2pMyk3FMzWKaqyQSxL1tdgcfsKn4pcO/JdEIe 1Yyxy1vwWYpS+FmLwHgn2PicOWjp5QSPYdGGAPNmyM4gI7O1I3lEOpX8o0Djc8sTbDfdzJneU zzjF+fXjhHg3fVsMd5ynOkkK6+N/syUU9xLi8TYUVi0M1kcGDb5SZzejFuGQeG+NJTodpR86u XXPajKA29DXCGyV/1/uLgxzO8KlbQjF22wmMiRT4/0Ml3fu2NLog5PvOcSGquT/1wpjIXvr9b H+44RvM99pgrJ81m9NzAH2uiWjF+XIvlIqVMabIavN0uhjcFO/5UvQyllDUKoVAXeSdTFF+6 Received-SPF: pass client-ip=212.227.17.20; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:259970 Archived-At: On Sat, 28 Nov 2020 21:13:20 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: emacs-devel@gnu.org >> Date: Sat, 28 Nov 2020 19:46:18 +0100 >>=20 >> > Does it work for =C3=A4 if you say >> > >> > C-x RET c latin-1 RET A =C3=A4 RET >> > >> > ? >>=20 >> Yes (with -a added to the grep invocation, but not without it). And >> then with either 'a' or '=C3=A4' as the search term, *xref* displays 'a= =C3=A4'. >> So this seems to be the best workaround, though inconvenient for >> frequent uses > > I really don't see any other way, especially if different files in the > directory have different encodings. But then the above could not be used for arbitrary marked files in Dired, right? (The same goes for the iconv workaround, as I noted.) > Grep looks for bytes, not > characters, and is agnostic to encoding. And even if we'd do this in > Emacs Lisp, we'd still need to trust Emacs to guess/detect the correct > encoding of each file. Don't we usually do that anyway? And if it guesses wrong, the user can always make the appropriate change. And if Emacs can handle each file differently as required, that's better than either of the above workarounds (assuming Someone=E2=84=A2 implements it). >> Do you then agree to adding -a to the grep invocation in >> xref-matches-in-files? Or could that have undesirable consequences? > > Adding -a probably cannot do any harm, but its support should be > detected, since I don't think it's portable enough (it isn't in the > latest Posix spec, at least). Detect it in xref-matches-in-files or somewhere in Lisp and not e.g. in configure, right? Is there a canonical way to do that? Steve Berman