bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#32194: [PATCH] Use Gnulib regex for lib-src


From: Paul Eggert
Subject: bug#32194: [PATCH] Use Gnulib regex for lib-src
Date: Tue, 31 Jul 2018 11:21:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Eli Zaretskii wrote:

would it be possible to let the configure
    script also check -lregex for those functions?  This could be
    important on non-glibc systems.

It would no doubt be possible. However, we haven't found a need in other applications that use Gnulib. Gnulib code tends to be more up-to-date than system-supplied libraries, and in practice it's OK if the system puts the regex code in a place where 'configure' won't find it, as Emacs will just fall back on the better Gnulib version in that case.

2. Do we really need to rename src/regex.c?  We could have 2 regex.c in
    separate directories, couldn't we?  If possible, I'd prefer not to
    rename files, as that makes VCS forensics more complicated.

Renaming src/regex.h works around problems with having two include files src/regex.h and lib/regex.h that fight each other. I tried not renaming src/regex.h at first, and then ran into problems and gave up; although I surely could get it to work eventually, I figured that we'd continue to have ongoing problems and so it would be better to bite the bullet.

We could rename only src/regex.c, but it would be confusing for the .c and .h files to disagree in names. Also, having two different */regex.c files in different places would mean for long-term confusion by builders and bug-reporters.

Also, the regex code will surely change quite a bit once we decouple it from glibc, which lessens the advantage of trying to use 'git diff' on the result. Come to think of it, we might as well do some of the obvious simplifications now; I'll attach them as additional patches to this email.

This is why I judged the advantages of renaming to outweigh the disadvantages. If despite all this you prefer to not rename src/regex.c we could do that fairly easily. Not renaming src/regex.h would be a bigger hill to climb, one that I expect is not worth it.

3. Is it really necessary to pull mbrtowc, locale_charset,
    nl_langinfo, and their dependencies?

I didn't know, so in my first cut I did the easiest thing and pulled them all in. It's pretty easy to omit them; we can always add some back if we find they're needed after all. Revised patch attached; it is the first patch in the attached series. (The later patches are some of the simplifications mentioned above.)

P.S. Is it true that this version will no longer support a build with
WIDE_CHAR_SUPPORT undefined, i.e. those which have only the C locale?

I don't see any issues with such a build. What sort of problem do you have in mind?



Attachment: 0001-Use-Gnulib-regex-for-lib-src.txt
Description: Text document

Attachment: 0002-Simplify-regex-emacs-code-by-assuming-Emacs.txt
Description: Text document

Attachment: 0003-Simplify-regex-emacs-by-assuming-Emacs-syntax.txt
Description: Text document

Attachment: 0004-Remove-always-0-struct-re_pattern_buffer-members.txt
Description: Text document


reply via email to

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