all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: thierry.volpiatto@gmail.com, emacs-devel@gnu.org
Subject: Re: What does Emacs on w32 know that grep can't figure out?
Date: Tue, 5 Oct 2010 02:46:56 +0200	[thread overview]
Message-ID: <AANLkTi=XwWNmiXZ6-DifORLRSXwpm9TU43hngBAV9qUh@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikCi0gLsQbukZtLUam6ZH79aihVm7Exrui8mJRF@mail.gmail.com>

On Mon, Oct 4, 2010 at 12:50 AM, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
> On Sun, Oct 3, 2010 at 9:09 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> From: Lennart Borgman <lennart.borgman@gmail.com>
>>> Date: Sun, 3 Oct 2010 06:10:14 +0200
>>> Cc: Thierry Volpiatto <thierry.volpiatto@gmail.com>, emacs-devel@gnu.org
>>>
>>>   http://technet.microsoft.com/en-us/library/dd315403.aspx
>>>
>>> it does not look as it autodetects the coding system in the file.
>>
>> Why should it?
..
>> What tool does, besides Emacs?
..
>> It does support UTF-16.  That's the "Unicode" part of the values you
>> can submit to the -Encoding option (you need to "think MS" to get it).

This discussion seems to have stalled. So here is a summary of what we
have found:

- utf-16 is a problem since the grep program does not handle it and
utf-16 is common on w32.

- There seems to be no program we can use that autodetects file coding
the way Emacs does.

- I would expect Emacs users to believe thata search from within Emacs
would autodetect coding system since Emacs does it. (Eli disagrees on
this.)

What can we do? The options I can see are:

- Use powershell + select-string (+ another cmdlet for dir tree
searching) on w32 by default. That has two benefits:

  1. Users on w32 does not have to install grep+find. But on older
systems they have to install powershell. Anyway it is easy to test for
powershell and use it if it is installed. (A problem is the hardcoding
of parameters to grep, like -i, but that can be resolved).

  2. Make an internal grep command in Emacs. A naive version in elisp
is quick to write but will be inefficient especially for large files.
A C version will require some restructuring of insert_file_contents,
but seems otherwise not hard to code. (Except perhaps for buffering
for effiency, but I have no idea if that is needed.)


I think 2 is the best choice, but I do not expect anyone to write it
now. Maybe add it to our to-do list?

For the moment I suggest that we implement 1.



  reply	other threads:[~2010-10-05  0:46 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 23:13 What does Emacs on w32 know that grep can't figure out? Lennart Borgman
2010-09-30 23:58 ` Juanma Barranquero
2010-10-01  0:29   ` Lennart Borgman
2010-10-01  0:37     ` Juanma Barranquero
2010-10-01  1:06       ` Lennart Borgman
2010-10-01  1:20         ` Juanma Barranquero
2010-10-01  1:32           ` Lennart Borgman
2010-10-01  1:49             ` Juanma Barranquero
2010-10-01  2:41             ` PJ Weisberg
2010-10-01  5:43               ` PJ Weisberg
2010-10-01  5:37       ` Jan D.
2010-10-01  7:34         ` Eli Zaretskii
2010-10-01  8:12           ` Andreas Schwab
2010-10-01 12:00             ` Eli Zaretskii
2010-10-01 12:40               ` Andreas Schwab
2010-10-01 17:19               ` Jan Djärv
2010-10-01 22:45               ` Stefan Monnier
2010-10-01  7:13     ` Eli Zaretskii
2010-10-01  9:28       ` Lennart Borgman
2010-10-01 10:35         ` Mathias Dahl
2010-10-01 11:24           ` Thierry Volpiatto
2010-10-01 11:26           ` Lennart Borgman
2010-10-01 12:02         ` Eli Zaretskii
2010-10-01 15:03           ` Lennart Borgman
2010-10-01 15:11           ` PJ Weisberg
2010-10-01 22:40     ` Stefan Monnier
2010-10-01 23:35       ` Miles Bader
2010-10-02  0:33         ` Lennart Borgman
2010-10-02  7:29           ` Eli Zaretskii
2010-10-02 10:12             ` Lennart Borgman
2010-10-02 10:32               ` Thierry Volpiatto
2010-10-02 10:50                 ` Lennart Borgman
2010-10-02 12:01                 ` Eli Zaretskii
2010-10-02 14:51                 ` Lennart Borgman
2010-10-02 15:05                   ` Thierry Volpiatto
2010-10-02 15:23                     ` Eli Zaretskii
2010-10-02 15:56                       ` Lennart Borgman
2010-10-02 20:40                         ` Mathias Dahl
2010-10-02 22:20                           ` Eli Zaretskii
2010-10-03  0:35                             ` David Robinow
2010-10-03  4:05                               ` Eli Zaretskii
2010-10-03  4:29                                 ` David Robinow
2010-10-03  5:39                                   ` Eli Zaretskii
2010-10-03  7:25                                     ` Thierry Volpiatto
2010-10-03  4:10                         ` Lennart Borgman
2010-10-03 10:39                           ` Thierry Volpiatto
2010-10-03 13:23                             ` Thierry Volpiatto
2010-10-03 19:09                           ` Eli Zaretskii
2010-10-03 22:50                             ` Lennart Borgman
2010-10-05  0:46                               ` Lennart Borgman [this message]
2010-10-05  0:51                                 ` Lennart Borgman
2010-10-05  0:56                                 ` Juanma Barranquero
2010-10-05  1:36                                   ` Lennart Borgman
2010-10-05  1:37                                     ` Lennart Borgman
2010-10-05  1:54                                     ` Juanma Barranquero
2010-10-02 11:59               ` Eli Zaretskii
2010-10-02 12:44                 ` Lennart Borgman
2010-10-02 13:15                   ` Eli Zaretskii
2010-10-01  7:09   ` Eli Zaretskii
2010-10-01  4:00 ` Stephen J. Turnbull
2010-10-01  7:03   ` Eli Zaretskii
2010-10-01  7:29   ` Eli Zaretskii

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='AANLkTi=XwWNmiXZ6-DifORLRSXwpm9TU43hngBAV9qUh@mail.gmail.com' \
    --to=lennart.borgman@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=thierry.volpiatto@gmail.com \
    /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.