emacs-devel
[Top][All Lists]
Advanced

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

Re: regex.c: emacs & glibc (and xemacs, and grep and ...)


From: Stefan Monnier
Subject: Re: regex.c: emacs & glibc (and xemacs, and grep and ...)
Date: Thu, 04 Apr 2002 14:24:55 -0500

> Emacs comes with it's own version of regex.c, even though most UNIX
> systems have a regex implementation.  IIUC, this is for portability.

It's for Emacs' portability as well as for elisp program's portability
(so the set of supported regexps is always the same) and more importantly
because the regexp routines need to know about Emacs' internal buffer
representation (as a pair of char arrays, hence the need for re_match_2)
and multibyte char representation as well as Emacs' syntax tables.

> Suppose glibc's regex and Emacs' regex are unified - will Emacs still
> build it's own regex version even on gnu systems (linux, hurd)?

Most likely yes, because the glibc version will not know about Emacs'
syntax tables and multibyte chars.

> Finally, GNU CLISP (http://clisp.cons.org) comes with a GNU regex.c of
> 1994(!) - which version should we upgrade to?  Emacs?  GLIBC? GNU grep?

The regex library in glibc-2.1 derived from the same code base as the one
of Emacs.  I fixed several problems in the code for Emacs-21 and tried
to re-merge the glibc code with the new Emacs code (so as to fix the glibc
code as well) but never finished it (i.e. I did integrate some of glibc's
changes into Emacs' regex.c but not enough to be able to replace glibc's
version).
In the mean time, supposedly glibc has switched to a new code base for its
regexp engine (I know glibc maintainers hated the regexp code, and I can
partly understand why, although the Emacs version has been somewhat
improved) which seems inadequate (for now at least) for Emacs and even
somewhat unstable, last I heard of it.

I don't know what GNU grep uses, but CVS uses the same code as Emacs
and so do several other GNU packages, so maybe GNU grep as well
(although they might not have been upgraded to the Emacs-21 code,
I don't know).
BTW, note that same code doesn't mean that they could be put into
a shared library because they're compiled with different compilation
options.


        Stefan




reply via email to

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