From: Paul Eggert <eggert@cs.ucla.edu>
To: emacs-devel@gnu.org
Subject: draft patch to import gnulib's filemode module into Emacs
Date: Sun, 20 Feb 2011 03:17:52 -0800 [thread overview]
Message-ID: <4D60F860.6020303@cs.ucla.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 6453 bytes --]
Here's a draft patch to import gnulib's filemode module
into Emacs.
The following parts of this may affect the Windows build:
* src/filemode.c is renamed to lib/filemode.c in the usual
way for imports from gnulib. There's also a new file
lib/filemode.h that src/dired.c now includes.
* lib/sys/stat.h is built on hosts whose <sys/stat.h> has problems.
I expect that Windows <sys/stat.h> does not have these problems,
so this part can be ignored.
* src/config.in has two new symbols that I expect can be left alone
on Windows but thought I'd mention them. They are HAVE_DECL_STRMODE
(for a BSD-style strmode function) and HAVE_ST_DM_MODE
(for a Cray-style dm_mode member of struct stat).
* Some other symbols are added to src/config.in. If <sys/stat.h> is OK
is OK on Windows then you can safely ignore these symbols. They
are STAT_MACROS_BROKEN and nlink_t.
Here are the handwritten parts of the patch. I'm attaching the full
patch, including the autogenerated files, in compressed format.
=== modified file '.bzrignore'
--- .bzrignore 2011-02-20 08:48:52 +0000
+++ .bzrignore 2011-02-20 10:51:50 +0000
@@ -42,6 +42,7 @@
lib/c++defs.h
lib/getopt.h
lib/stdlib.h
+lib/sys/
lib/time.h
lib/unistd.h
lib/warn-on-use.h
=== modified file 'ChangeLog'
--- ChangeLog 2011-02-20 08:48:52 +0000
+++ ChangeLog 2011-02-20 10:51:50 +0000
@@ -1,5 +1,20 @@
2011-02-20 Paul Eggert <eggert@cs.ucla.edu>
+ Import filemode module from gnulib.
+ * .bzrignore: Add lib/sys/.
+ * Makefile.in (GNULIB_MODULES): Add filemode.
+ * lib/Makefile.am (MOSTLYCLEANDIRS): New macro.
+ * lib/filemode.c: Renamed from src/filemode.c and regenerated
+ from gnulib. This adds support for some more file types, e.g.,
+ Cray DMF migrated files.
+ * lisp/emacs-lisp/find-gc.el (find-gc-source-files): Remove filemode.c.
+ * lib/filemode.h, lib/sys_stat.in.h, m4/filemode.m4, m4/st_dm_mode.m4:
+ * m4/sys_stat_h.m4: New files, generated from gnulib.
+ * aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
+ Regenerate.
+
+2011-02-20 Paul Eggert <eggert@cs.ucla.edu>
+
Import crypto/md5 and stdint modules from gnulib.
* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
Regenerate.
=== modified file 'Makefile.in'
--- Makefile.in 2011-02-18 08:07:03 +0000
+++ Makefile.in 2011-02-20 10:51:50 +0000
@@ -331,7 +331,8 @@
# $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = \
- crypto/md5 dtoastr getloadavg getopt-gnu ignore-value mktime strftime
+ crypto/md5 dtoastr filemode getloadavg getopt-gnu \
+ ignore-value mktime strftime
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
=== modified file 'lib/Makefile.am'
--- lib/Makefile.am 2011-02-06 22:13:03 +0000
+++ lib/Makefile.am 2011-02-20 10:51:50 +0000
@@ -1,5 +1,6 @@
BUILT_SOURCES =
EXTRA_DIST =
+MOSTLYCLEANDIRS =
MOSTLYCLEANFILES =
noinst_LIBRARIES =
=== modified file 'lisp/emacs-lisp/find-gc.el'
--- lisp/emacs-lisp/find-gc.el 2011-01-25 04:08:28 +0000
+++ lisp/emacs-lisp/find-gc.el 2011-02-20 10:51:50 +0000
@@ -55,7 +55,7 @@
"term.c" "cm.c" "emacs.c" "keyboard.c" "macros.c"
"keymap.c" "sysdep.c" "buffer.c" "filelock.c"
"insdel.c" "marker.c" "minibuf.c" "fileio.c"
- "dired.c" "filemode.c" "cmds.c" "casefiddle.c"
+ "dired.c" "cmds.c" "casefiddle.c"
"indent.c" "search.c" "regex.c" "undo.c"
"alloc.c" "data.c" "doc.c" "editfns.c"
"callint.c" "eval.c" "fns.c" "print.c" "lread.c"
=== modified file 'src/ChangeLog'
--- src/ChangeLog 2011-02-20 08:48:52 +0000
+++ src/ChangeLog 2011-02-20 10:53:22 +0000
@@ -1,5 +1,15 @@
2011-02-20 Paul Eggert <eggert@cs.ucla.edu>
+ Import filemode module from gnulib.
+ * Makefile.in (base_obj): Remove filemode.o, as it's now in ../lib.
+ * deps.mk (dired.o): Depend on ../lib/filemode.h, too.
+ (filemode.o): Remove; this is now in ../lib.
+ * dired.c: Include <filemode.h>.
+ (filemodestring): Remove now-redundant decl.
+ * config.in: Regenerate.
+
+2011-02-20 Paul Eggert <eggert@cs.ucla.edu>
+
Import crypto/md5 and stdint modules from gnulib.
* Makefile.in (base_obj): Remove md5.o, since this file
is in lib now.
=== modified file 'src/Makefile.in'
--- src/Makefile.in 2011-02-20 08:48:52 +0000
+++ src/Makefile.in 2011-02-20 10:53:22 +0000
@@ -347,7 +347,7 @@
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \
- minibuf.o fileio.o dired.o filemode.o \
+ minibuf.o fileio.o dired.o \
cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
alloc.o data.o doc.o editfns.o callint.o \
eval.o floatfns.o fns.o font.o print.o lread.o \
=== modified file 'src/deps.mk'
--- src/deps.mk 2011-02-19 09:51:59 +0000
+++ src/deps.mk 2011-02-20 10:53:22 +0000
@@ -73,7 +73,7 @@
dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
coding.h regex.h systime.h blockinput.h atimer.h composite.h \
- ../lib/unistd.h globals.h
+ ../lib/filemode.h ../lib/unistd.h globals.h
dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h $(INTERVALS_H) nsgui.h ../lib/unistd.h \
@@ -98,7 +98,6 @@
commands.h globals.h ../lib/unistd.h
filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
../lib/unistd.h lisp.h globals.h $(config_h)
-filemode.o: filemode.c $(config_h)
font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
font.h lisp.h globals.h $(config_h) buffer.h composite.h fontset.h \
xterm.h nsgui.h msdos.h
=== modified file 'src/dired.c'
--- src/dired.c 2011-02-16 15:02:50 +0000
+++ src/dired.c 2011-02-20 10:53:22 +0000
@@ -54,6 +54,8 @@
#include <sys/dir.h>
#include <sys/stat.h>
+#include <filemode.h>
+
#define DIRENTRY struct direct
extern DIR *opendir (char *);
@@ -82,9 +84,6 @@
struct re_registers *,
Lisp_Object, int, int);
-/* From filemode.c. Can't go in Lisp.h because of `stat'. */
-extern void filemodestring (struct stat *, char *);
-
/* if system does not have symbolic links, it does not have lstat.
In that case, use ordinary stat instead. */
[-- Attachment #2: filemode-patch1.txt.gz --]
[-- Type: application/x-gzip, Size: 30537 bytes --]
next reply other threads:[~2011-02-20 11:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-20 11:17 Paul Eggert [this message]
2011-02-20 12:42 ` draft patch to import gnulib's filemode module into Emacs Eli Zaretskii
2011-02-20 17:18 ` Paul Eggert
2011-02-21 17:58 ` Paul Eggert
2011-02-20 12:43 ` How many more gnulib imports? (was: draft patch to import gnulib's filemode module into Emacs) Eli Zaretskii
2011-02-20 15:56 ` How many more gnulib imports? Christoph
2011-02-20 16:13 ` Christoph
2011-02-20 17:28 ` Eli Zaretskii
2011-02-20 17:54 ` Christoph
2011-02-20 18:54 ` Eli Zaretskii
2011-02-20 23:32 ` Christoph
2011-02-21 16:00 ` Christoph
2011-02-21 19:05 ` Eli Zaretskii
2011-02-21 19:10 ` Christoph
2011-02-21 20:19 ` Eli Zaretskii
2011-02-21 20:21 ` Eli Zaretskii
2011-02-20 17:46 ` Paul Eggert
2011-02-20 17:54 ` Eli Zaretskii
2011-02-20 18:06 ` Paul Eggert
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D60F860.6020303@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).