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: dired-do-find-regexp failure with latin-1 encoding Date: Sat, 28 Nov 2020 21:49:06 +0200 Message-ID: <83ft4tmfd9.fsf@gnu.org> References: <87blfhjr4q.fsf@gmx.net> <83k0u5mjvf.fsf@gnu.org> <877dq5jp51.fsf@gmx.net> <83im9pmh0v.fsf@gnu.org> <87y2ili7va.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7264"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 28 20:50:36 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 1kj6Et-0001ow-UB for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Nov 2020 20:50:35 +0100 Original-Received: from localhost ([::1]:50106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kj6Es-0001oo-V3 for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Nov 2020 14:50:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kj6Dh-0000tL-HR for emacs-devel@gnu.org; Sat, 28 Nov 2020 14:49:21 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49474) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kj6Dh-0001dp-3b; Sat, 28 Nov 2020 14:49:21 -0500 Original-Received: from [176.228.60.248] (port=2430 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kj6Df-0001t8-Ba; Sat, 28 Nov 2020 14:49:20 -0500 In-Reply-To: <87y2ili7va.fsf@gmx.net> (message from Stephen Berman on Sat, 28 Nov 2020 20:44:41 +0100) 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:259971 Archived-At: > From: Stephen Berman > Cc: emacs-devel@gnu.org > Date: Sat, 28 Nov 2020 20:44:41 +0100 > > > 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? Not for arbitrary mixed encodings, no. > > 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? Do: yes. Succeed: not necessarily. Success is only guaranteed if the encoding is the default locale's encoding; otherwise all bets are off. > And if it guesses wrong, the user can always make the appropriate > change. What would that change be? > And if Emacs can handle each file differently as required, that's > better than either of the above workarounds (assuming Someoneā„¢ > implements it). Better, but much slower. > > 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? Yes. > Is there a canonical way to do that? Wed already do that for some Grep switches, so you should see examples in grep.el, I think.