all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Want to grep for text in selected coding...
Date: Wed, 29 Feb 2012 18:58:04 +0200	[thread overview]
Message-ID: <877gz5bmqr.fsf@desktop.home.int> (raw)
In-Reply-To: 87mx828wdb.fsf@desktop.home.int

On 2012-02-28, Oleksandr Gavenko wrote:
> On 2012-02-28, Eli Zaretskii wrote:
>> And, btw, you should be able to use "C-x RET c" before "M-x rgrep" to
>> search for any encoding with Grep as well.
>>
> I often use "C-x RET c" and try your suggestion previously.
>
> My first attempt work under Linux but I forget condition when it fail.
>
> Next morning I try all cases that I can use in practice...

I checked with negative result...

Both Emacs 23.3 and 24.0.91 are affected. Both are from ftp.gnu.org for
Windows with Cygwin grep command.

My setup is system wide 'LANG=ru_RU.cp1251' to make Cygwin Russian friendly.

Then I start "emacs -q" I start experimenting with M-x lgrep and such file:

  cp866       ЏаЁўҐв!
  cp1251      Привет!
  koi8-r      рТЙЧЕФ!
  utf-8       Привет!

All work fine ("C-x RET c cp1251 RET M-x lgrep RET Привет! RET *.txt RET"):

  text.txt:2:cp1251      Привет!

But if I load my .emacs file test was failed.

I debug issue to most simple call:

  (call-process shell-file-name nil t nil "-c" "grep -nH -e 'Привет!' *.txt")

which fail with or without loading my .emacs

So I start "emacs -q" and try evaluate above expression. All fine!

Next I eval (if you remember my LANG=ru_RU.cp1251)

 (setenv "LANG" "C")

because 'lgrep' call 'compilation-start' with temporary change LANG env var
before 'call-process'.

Evaluation of 'call-process' return "1" without output!

Next I eval

  (setq shell-file-name "bash")

to get more close environment to my .emacs and get from 'call-process':

  /usr/bin/bash: $'grep   -nH -e \'\320\237\321\200\320\270\320\262\320\265\321\202\' *.txt': command not found

If you remember I say that under Debian and Windows with -q "M-x lgrep" work
fine with Russian search string.

If I change LANG from Cygwin shell (mintty) - grep work fine:

  $ LANG=C grep -nH -e 'Привет!' *.txt
  text.txt:2:cp1251      Привет!

  $ LANG=C grep -nH -e 'ЏаЁўҐв!' *.txt
  text.txt:1:cp866       ЏаЁўҐв!

Is this a bug in Emacs or in Cygwin?

Currently I don't need to work in Widows as leave my job but next job can
change this statement...

That is why I am so harsh in my previous post...

-- 
Best regards!




      reply	other threads:[~2012-02-29 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15  9:52 Want to grep for text in selected coding Oleksandr Gavenko
2012-02-15 15:57 ` Kevin Rodgers
2012-02-15 17:07 ` Eli Zaretskii
2012-02-28 19:47   ` Oleksandr Gavenko
2012-02-28 20:29     ` Eli Zaretskii
2012-02-28 21:18       ` Oleksandr Gavenko
2012-02-28 21:33         ` Eli Zaretskii
2012-02-28 21:46           ` Oleksandr Gavenko
2012-02-29 16:58             ` Oleksandr Gavenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877gz5bmqr.fsf@desktop.home.int \
    --to=gavenkoa@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.