Lennart Borgman | 1 Oct 01:13 2010
Picon

What does Emacs on w32 know that grep can't figure out?

I saved to a file with CCleaner the list of installed programs on my
pc. This file is maybe a text file, maybe not. Emacs can read it and
think it is a text file (I believe) with

  buffer-file-coding-system is a variable defined in `C source code'.
  Its value is
  utf-16le-with-signature-unix
  Local in buffer install.txt;

However trying to search this file from a cmd prompt with (gnuwin32)
grep does not work. And it does not work with cygwin grep either. They
think it is a binary file (even though I changed the line delimiter to
unix style).

What is going on? Is grep sometimes useless on w32 now, or? (How do we
handle that in Emacs?)

Juanma Barranquero | 1 Oct 01:58 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

> This file is maybe a text file, maybe not.

It's a text file, but not ASCII. It's encoded as Emacs is telling you:
utf-16, with signature, in little-endian order (it starts with FF FE).

>  Its value is
>  utf-16le-with-signature-unix

Curious. I get utf-16le-with-signature-dos, consistent with the file
having CRLF (which it does).

> However trying to search this file from a cmd prompt with (gnuwin32)
> grep does not work. And it does not work with cygwin grep either. They
> think it is a binary file

It is. This is unrelated to Emacs. The grep tools you're using do not
support utf-16 text.

> (even though I changed the line delimiter to unix style).

Ah, that explains the -unix above.

> What is going on?

I hope this is clearer now.

> Is grep sometimes useless on w32 now, or?

It will be useless whenever you try to grep a file in a coding system
the grep tool does not support...
(Continue reading)

Daniel Colascione | 1 Oct 02:28 2010
Picon

Re: moving more cl seq/mapping support into core

On 9/26/2010 11:27 PM, Richard Stallman wrote:
>     Thanks. I think we need not to worry the user address space too much.
> 
> That would be a change for the worse
> in our standard of documentation.

Every Emacs release adds all sorts of functions that might impinge on
the user namespace, but it's rarely a problem in practice. CL shouldn't
be held to a higher standard.

In practice, many people (require 'cl) almost immediately, and a large
number of packages, even those in GNU Emacs, (eval-when-compile
'(require 'cl)). If cl namespace were actually a problem, we'd have
heard about it long before now.

In short, I really don't buy the argument that CL would cause too much
namespace pollution. The benefits outweigh the tiny risk to the small
number of users who work without CL loaded.

CL really should be dumped along with Emacs proper.

> Those are all rather heavy things by nature, so if the calling
> sequence is heavy too, that's ok.
> If I added a `remove-if' function I would like it not to be so heavy
> to use.

You can use compiler-macros (or an equivalent) to create "fast" calls
when the keywords involved are known beforehand, as they almost always
are. But the current CL functions are fast enough *now*, considering
that they're widely used. If profiling reports that a particular call is
(Continue reading)

Lennart Borgman | 1 Oct 02:29 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

On Fri, Oct 1, 2010 at 1:58 AM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
>
>> However trying to search this file from a cmd prompt with (gnuwin32)
>> grep does not work. And it does not work with cygwin grep either. They
>> think it is a binary file
>
> It is. This is unrelated to Emacs. The grep tools you're using do not
> support utf-16 text.
>
>> Is grep sometimes useless on w32 now, or?
>
> It will be useless whenever you try to grep a file in a coding system
> the grep tool does not support...

Yes, of course, that is actually what I am saying...

I actually think that there is no grep etc that handles this kind of
files on w32. Is there on *nix?

>> (How do we
>> handle that in Emacs?)
>
> How do we handle what? If you mean, how can Emacs read the text just
> fine... Emacs has supported UTF-16 and many other coding systems for
> years.

Using grep is an integral part of Emacs. If grep does not support the
coding then that part of Emacs will fail.

> As for what can you do,
(Continue reading)

Daniel Colascione | 1 Oct 02:33 2010
Picon

Re: moving more cl seq/mapping support into core

On 9/25/2010 8:30 AM, Leo wrote:
> On 2010-09-25 16:23 +0100, Drew Adams wrote:
>> Sorry, I don't get it.  What is TEST for?  It is typically for a binary
>> predicate such as `equal' - but we already have PREDICATE here.  And just what
>> is second class here (if TEST is not added)?
> 
> `remove-if' as defined in cl.el can not be used in a package intended to
> be included in GNU Emacs due to the use of cl run time functions.
> 
> So to move this function into elisp Miles (I think) proposed that we
> give up some of its keyword arguments since they mostly are not used and
> turned the keyword :test argument into an optional one.

Why bother? A compiler-macro can examine a call to remove-if, see
whether it recognizes the keyword arguments, and if it does, transform
the whole call into something more lightweight. You retain the current
function's expressive power and CL compatibility while losing nothing in
performance.

Juanma Barranquero | 1 Oct 02:37 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

On Fri, Oct 1, 2010 at 02:29, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:

> I actually think that there is no grep etc that handles this kind of
> files on w32. Is there on *nix?

I don't know. I don't use *nix (though I sometimes use GNU/*ux, but I
haven't needed to grep utf-16 files).

> Using grep is an integral part of Emacs.

Relatively speaking. In thirteen years of Emacs use I've grepped from
inside Emacs perhaps twice.

> If grep does not support the
> coding then that part of Emacs will fail.

Absurd. It's up to you to look for a grep that will grok the files you
want to search. grep is not included with Emacs.

> Yes, but that does not help if you have a lot of files you want to search.

Bad luck. You can always use an elisp script to convert them all.

    Juanma

Lennart Borgman | 1 Oct 03:06 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

On Fri, Oct 1, 2010 at 2:37 AM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Fri, Oct 1, 2010 at 02:29, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>
>> I actually think that there is no grep etc that handles this kind of
>> files on w32. Is there on *nix?
>
> I don't know. I don't use *nix (though I sometimes use GNU/*ux, but I
> haven't needed to grep utf-16 files).
>
>> Using grep is an integral part of Emacs.
>
> Relatively speaking. In thirteen years of Emacs use I've grepped from
> inside Emacs perhaps twice.

In those a bit less years I have used Emacs regularly now I guess I
might have used Emacs two times without using grep from within Emacs
;-)

>> If grep does not support the
>> coding then that part of Emacs will fail.
>
> Absurd. It's up to you to look for a grep that will grok the files you
> want to search. grep is not included with Emacs.

If the tool chain is broken then the tools that depends on it are also
broken. Aren't they?

(And commands two use Emacs are actually included in the Emacs manual!)

>> Yes, but that does not help if you have a lot of files you want to search.
(Continue reading)

Juanma Barranquero | 1 Oct 03:20 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

On Fri, Oct 1, 2010 at 03:06, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:

> If the tool chain is broken then the tools that depends on it are also
> broken. Aren't they?

Oh, I wouldn't consider Emacs broken if I cannot grep utf-16 files
from inside it. YMMV.

> Yes, but that is a quite unfortunate state IMO. New users will just
> say "ah, this tool is broken, let us try something else".

And what will they use?

    Juanma

Lennart Borgman | 1 Oct 03:32 2010
Picon

Re: What does Emacs on w32 know that grep can't figure out?

On Fri, Oct 1, 2010 at 3:20 AM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Fri, Oct 1, 2010 at 03:06, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>
>> If the tool chain is broken then the tools that depends on it are also
>> broken. Aren't they?
>
> Oh, I wouldn't consider Emacs broken if I cannot grep utf-16 files
> from inside it. YMMV.

I am a bit surprised by that.

>> Yes, but that is a quite unfortunate state IMO. New users will just
>> say "ah, this tool is broken, let us try something else".
>
> And what will they use?

Some tool with an internal search capable of handling utf-16 files?

And are not most of the things to handle that from within Emacs
actually in place? Though of course putting files into buffers to
search them are out of the question for performance reasons.

Christoph | 1 Oct 03:44 2010

imagemagick support on W32

I am trying to get imagemagick working on Windows. I added the support 
to the configure.bat file, downloaded the W32 package from the 
ImageMagick website and supplied the headers and libraries to 
configure.bat, like this:

configure.bat --no-cygwin --enable-checking --with-gcc --distfiles 
D:/devel/emacs/libXpm-3.5.8/src/libXpm.dll --cflags 
-IC:/Progra~2/GnuWin32/include --cflags 
-ID:/devel/emacs/libXpm-3.5.8/include --cflags 
-ID:/devel/emacs/libXpm-3.5.8/src --cflags 
-IC:/Progra~2/ImageMagick-6.6.4-Q16/include --ldflags 
-LC:/Progra~2/ImageMagick-6.6.4-Q16/lib --ldflags -lCORE_RL_wand_ 
--ldflags -lCORE_RL_magick_

I get the following output on `mingw32-make boostrap':

gcc -o oo-spd/i386/temacs.bin  -gdwarf-2 -g3  -mno-cygwin 
-LC:/Progra~2/ImageMagick-6.6.4-Q16/lib -lCORE_RL_wand_ 
-lCORE_RL_magick_ -Wl,-stack,0x00800000 -Wl,-heap,0x00100000 
-Wl,-image-base,0x01000000 -Wl,-subsystem,console -Wl,-entry,__start 
-Wl,-Map,oo-spd/i386/temacs.map oo-spd/i386/firstfile.o 
oo-spd/i386/emacs.res oo-spd/i386/temacs0.a oo-spd/i386/temacs1.a 
oo-spd/i386/temacw32.a oo-spd/i386
/lastfile.a -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32 -lmpr 
-lshell32 -lwinspool -lole32 -lcomctl32 -lusp10
oo-spd/i386/temacs1.a(image.o): In function `Finit_image_library':
D:\devel\emacs\emacs-bzr\imagemagick\src/image.c:8630: undefined 
reference to `MagickWandGenesis'
D:\devel\emacs\emacs-bzr\imagemagick\src/image.c:8631: undefined 
reference to `init_imagemagick_functions'
(Continue reading)


Gmane