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: Stephen Berman
Subject: Re: dired-do-find-regexp failure with latin-1 encoding
Date: Sat, 28 Nov 2020 20:44:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Sat, 28 Nov 2020 21:13:20 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: emacs-devel@gnu.org
>> Date: Sat, 28 Nov 2020 19:46:18 +0100
>> 
>> > Does it work for ä if you say
>> >
>> >   C-x RET c latin-1 RET A ä RET
>> >
>> > ?
>> 
>> Yes (with -a added to the grep invocation, but not without it).  And
>> then with either 'a' or 'ä' as the search term, *xref* displays 'aä'.
>> 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™ 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



reply via email to

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