emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired-do-find-regexp failure with latin-1 encoding


From: Eli Zaretskii
Subject: Re: dired-do-find-regexp failure with latin-1 encoding
Date: Sat, 28 Nov 2020 21:49:06 +0200

> From: Stephen Berman <stephen.berman@gmx.net>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]