From 9374581a2448ff52315bc9a5037dcec504167702 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 9 Aug 2012 20:02:10 -0400 Subject: [PATCH] Move DIRECTORY_SEP from lisp.h to config.h * configure.ac (DIRECTORY_SEP): Move here from src/lisp.h. * src/lisp.h (DIRECTORY_SEP): Let configure set it. * nt/config.nt (DIRECTORY_SEP): Move here from src/lisp.h. * lib-src/movemail.c (DIRECTORY_SEP, IS_DIRECTORY_SEP): * lib-src/make-docfile.c (DIRECTORY_SEP, IS_DIRECTORY_SEP): * lib-src/emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP): Remove (they are in config.h now). --- ChangeLog | 4 ++++ configure.ac | 3 +++ lib-src/ChangeLog | 7 ++++++- lib-src/emacsclient.c | 18 ++---------------- lib-src/make-docfile.c | 18 +++++++----------- lib-src/movemail.c | 7 ------- nt/ChangeLog | 4 ++++ nt/config.nt | 6 ++++-- src/ChangeLog | 4 ++++ src/lisp.h | 2 -- 10 files changed, 34 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 994f3f4ff3f..88beaa4a106 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-08-10 Glenn Morris + + * configure.ac (DIRECTORY_SEP): Move here from src/lisp.h. + 2012-08-08 Dmitry Antipov * configure.ac (--disable-features): Rename to --without-all. diff --git a/configure.ac b/configure.ac index 51dd8a375ca..54ce94fef7a 100644 --- a/configure.ac +++ b/configure.ac @@ -3185,6 +3185,9 @@ AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.]) +AC_DEFINE(DIRECTORY_SEP, ['/'], + [Character that separates directories in a file name.]) + dnl Only used on MS platforms. AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.]) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 33022de1a29..1262c917a4a 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,4 +1,9 @@ -2012-08-09 Glenn Morris +2012-08-10 Glenn Morris + + * movemail.c (DIRECTORY_SEP, IS_DIRECTORY_SEP): + * make-docfile.c (DIRECTORY_SEP, IS_DIRECTORY_SEP): + * emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP): + Remove (they are in config.h now). * ebrowse.c (PATH_LIST_SEPARATOR): Remove, and replace with SEPCHAR from config.h. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 0ba6535b79d..ef9bc9c6afd 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1,5 +1,6 @@ /* Client process that communicates with GNU Emacs acting as server. - Copyright (C) 1986-1987, 1994, 1999-2012 Free Software Foundation, Inc. + +Copyright (C) 1986-1987, 1994, 1999-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -213,21 +214,6 @@ xmalloc (size_t size) /* From sysdep.c */ #if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) -/* From lisp.h */ -#ifndef DIRECTORY_SEP -#define DIRECTORY_SEP '/' -#endif -#ifndef IS_DIRECTORY_SEP -#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) -#endif -#ifndef IS_DEVICE_SEP -#ifndef DEVICE_SEP -#define IS_DEVICE_SEP(_c_) 0 -#else -#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP) -#endif -#endif - char *get_current_dir_name (void); /* Return the current working directory. Returns NULL on errors. diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index bd87b5b6524..c2ac8ed63f6 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -1,6 +1,7 @@ /* Generate doc-string file for GNU Emacs from source files. - Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012 - Free Software Foundation, Inc. + +Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -36,12 +37,13 @@ along with GNU Emacs. If not, see . */ #include /* Defined to be emacs_main, sys_fopen, etc. in config.h. */ +/* FIXME Not for ages? */ #undef main #undef fopen #undef chdir #include -#include +#include /* FIXME config.h unconditionally includes this */ #ifdef MSDOS #include #endif /* MSDOS */ @@ -58,14 +60,6 @@ along with GNU Emacs. If not, see . */ #define READ_BINARY "r" #endif /* not DOS_NT */ -#ifndef DIRECTORY_SEP -#define DIRECTORY_SEP '/' -#endif - -#ifndef IS_DIRECTORY_SEP -#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) -#endif - /* Use this to suppress gcc's `...may be used before initialized' warnings. */ #ifdef lint # define IF_LINT(Code) Code @@ -79,6 +73,8 @@ static int scan_c_file (char *filename, const char *mode); static void start_globals (void); static void write_globals (void); +/* FIXME msdos does not define this any more, and in any case we + undefined it for everyone just above. */ #ifdef MSDOS /* s/msdos.h defines this as sys_chdir, but we're not linking with the file where that function is defined. */ diff --git a/lib-src/movemail.c b/lib-src/movemail.c index df1c1137df5..3ea4f4521c1 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -275,13 +275,6 @@ main (int argc, char **argv) else #endif { - #ifndef DIRECTORY_SEP - #define DIRECTORY_SEP '/' - #endif - #ifndef IS_DIRECTORY_SEP - #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) - #endif - /* Use a lock file named after our first argument with .lock appended: If it exists, the mail file is locked. */ /* Note: this locking mechanism is *required* by the mailer diff --git a/nt/ChangeLog b/nt/ChangeLog index 46a425b60c6..7ad4231b611 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-08-10 Glenn Morris + + * config.nt (DIRECTORY_SEP): Move here from src/lisp.h. + 2012-08-07 Juanma Barranquero * config.nt: Sync with autogen/config.nt. diff --git a/nt/config.nt b/nt/config.nt index fe21f15f2fb..c1e7a917d82 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -1,7 +1,6 @@ /* GNU Emacs site configuration template file. -Copyright (C) 1988, 1993-1994, 2001-2012 - Free Software Foundation, Inc. +Copyright (C) 1988, 1993-1994, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -131,6 +130,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 for DGUX with . */ #undef DGUX +/* Character that separates directories in a file name. */ +#define DIRECTORY_SEP '/' + /* Define if dispnew.c should include stdio_ext.h. */ #undef DISPNEW_NEEDS_STDIO_EXT diff --git a/src/ChangeLog b/src/ChangeLog index 2d65dcb0860..3427f449586 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-10 Glenn Morris + + * lisp.h (DIRECTORY_SEP): Let configure set it. + 2012-08-09 Dmitry Antipov Use TSET for write access to Lisp_Object slots of struct terminal. diff --git a/src/lisp.h b/src/lisp.h index 025736e7fb5..4f1a8931e99 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3418,8 +3418,6 @@ extern char *egetenv (const char *); /* Set up the name of the machine we're running on. */ extern void init_system_name (void); -static char const DIRECTORY_SEP = '/'; - /* Use this to suppress gcc's warnings. */ #ifdef lint -- 2.11.4.GIT