aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorTom Tromey2012-12-17 07:56:22 -0700
committerTom Tromey2012-12-17 07:56:22 -0700
commit3d6eced1ae51ffd0a782130e7c334052277e2724 (patch)
tree5d1d2ad7cd3374f922886c4a72062511a035c168 /lib-src
parentbf69f522a9e135f9aa483cedd53e71e915f2bf75 (diff)
parent7c3d167f48d6262ee4e5512aa50a07ee96bc1509 (diff)
downloademacs-3d6eced1ae51ffd0a782130e7c334052277e2724.tar.gz
emacs-3d6eced1ae51ffd0a782130e7c334052277e2724.zip
merge from trunk
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog143
-rw-r--r--lib-src/Makefile.in13
-rw-r--r--lib-src/ebrowse.c3
-rw-r--r--lib-src/emacsclient.c225
-rw-r--r--lib-src/etags.c119
-rw-r--r--lib-src/make-docfile.c47
-rw-r--r--lib-src/makefile.w32-in66
-rw-r--r--lib-src/movemail.c34
-rw-r--r--lib-src/ntlib.c31
-rw-r--r--lib-src/pop.c2
-rw-r--r--lib-src/update-game-score.c2
11 files changed, 439 insertions, 246 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 35190fd2a8f..866e76ad24f 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,144 @@
12012-12-11 Juanma Barranquero <lekktu@gmail.com>
2
3 * makefile.w32-in (SYSWAIT_H): Update dependencies.
4
52012-12-10 Eli Zaretskii <eliz@gnu.org>
6
7 * makefile.w32-in (obj): Add w32notify.o. Add missing X and Unix
8 sources.
9
102012-12-02 Kevin Ryde <user42@zip.com.au>
11
12 * etags.c (Lisp_functions): Skip (defvar foo) declarations unless
13 the --declarations flag is enabled (Bug#5600).
14 (Lisp_help): Update.
15 (skip_name): New function.
16
172012-12-01 Kevin Ryde <user42@zip.com.au>
18
19 * etags.c (Perl_functions): Support "use constant" (Bug#5055).
20
212012-11-27 Paul Eggert <eggert@cs.ucla.edu>
22
23 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
24 * movemail.c (main): Assume EAGAIN and EBUSY.
25
262012-11-23 Paul Eggert <eggert@cs.ucla.edu>
27
28 movemail: treat EACCES etc. failures as permanent
29 * movemail.c (main): Treat any link failure other than EEXIST as a
30 permanent failure, not just EPERM. EACCES, for example.
31
322012-11-21 Paul Eggert <eggert@cs.ucla.edu>
33
34 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
35 * emacsclient.c (getcwd): Remove decl.
36 (get_current_dir_name): Assume getcwd exists.
37 * etags.c (HAVE_GETCWD): Remove.
38 (getcwd): Remove decl.
39 (NO_LONG_OPTIONS): Remove this. All uses removed.
40 Emacs always has GNU getopt.
41 (etags_getcwd): Assume getcwd exists.
42 * movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
43
442012-11-20 Paul Eggert <eggert@cs.ucla.edu>
45
46 * emacsclient.c (handle_sigcont, handle_sigtstp): Use raise (sig)
47 rather than kill (getpid (), sig), as it's simpler and safer.
48
492012-11-17 Juanma Barranquero <lekktu@gmail.com>
50
51 * makefile.w32-in (SYSWAIT_H): New macro.
52 ($(BLD)/movemail.$(O)): Update dependencies.
53
542012-11-17 Paul Eggert <eggert@cs.ucla.edu>
55
56 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
57 * movemail.c, update-game-score.c: Assume <fcntl.h> exists.
58
592012-10-26 Glenn Morris <rgm@gnu.org>
60
61 * Makefile.in (uninstall): No INSTALLABLES live in archlibdir.
62
63 * Makefile.in (install, uninstall): Transformations should not be
64 applied to $EXEEXT.
65
662012-10-23 Eli Zaretskii <eliz@gnu.org>
67
68 * makefile.w32-in (lisp2): Add cp51932.el and eucjp-ms.el, to
69 follow src/lisp.mk.
70
712012-10-21 Glenn Morris <rgm@gnu.org>
72
73 * make-docfile.c (scan_lisp_file): Add cp51932.el and eucjp-ms.el.
74
752012-10-20 Eli Zaretskii <eliz@gnu.org>
76
77 * make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros.
78 (scan_lisp_file): Only pass a .el file if its basename matches a
79 known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE.
80
812012-10-20 Andreas Schwab <schwab@linux-m68k.org>
82
83 * make-docfile.c (scan_lisp_file): Add bounds checking.
84
852012-10-20 Eli Zaretskii <eliz@gnu.org>
86
87 Prevent silent omission of doc strings from uncompiled Lisp files.
88 * make-docfile.c (scan_lisp_file): Barf if called with a .el file
89 other than one of a small list of supported un-compiled files.
90
91 * makefile.w32-in (lisp1, lisp2): Name .elc files wherever they
92 exist. (Bug#12395)
93
942012-10-17 Eli Zaretskii <eliz@gnu.org>
95
96 * ntlib.c: Include <mbstring.h>, to avoid compiler warning about
97 _mbspbrk.
98
992012-10-08 Eli Zaretskii <eliz@gnu.org>
100
101 * makefile.w32-in (obj): Add cygw32.o.
102
1032012-10-08 Daniel Colascione <dancol@dancol.org>
104
105 * emacsclient.c: Include windows.h when HAVE_NTGUI.
106 (alt_display): New variable. We send the display held by this
107 variable when the primary display is either unsupported or not
108 present.
109 (longopts): Allow display everywhere.
110 (w32_set_user_model_id): Move lower in file, inside HAVE_NTGUI
111 section.
112 (decode_options): Use alt_display. Explain why.
113 (main): Retry connection with alt_display if connection with main
114 display fails.
115
1162012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
117
118 * make-docfile.c (write_globals): Special-case
119 Fexit_recursive_edit and Fabort_recursive_edit as well, as
120 functions that are _Noreturn, to be consistent with
121 src/keyboard.c.
122
1232012-09-30 Eli Zaretskii <eliz@gnu.org>
124
125 * ntlib.c (gettimeofday): Copy from src/w32.c. lib/gettime.c
126 needs this function.
127
1282012-09-26 Juanma Barranquero <lekktu@gmail.com>
129
130 * makefile.w32-in (obj): Add profiler.o.
131
1322012-09-17 Glenn Morris <rgm@gnu.org>
133
134 * ebrowse.c (version):
135 * etags.c (print_version): Use COPYRIGHT.
136
1372012-09-11 Paul Eggert <eggert@cs.ucla.edu>
138
139 * pop.c (socket_connection) [HAVE_GETADDRINFO]:
140 Prefer assignment to memcpy when either will do.
141
12012-08-31 Andreas Schwab <schwab@linux-m68k.org> 1422012-08-31 Andreas Schwab <schwab@linux-m68k.org>
2 143
3 * etags.c (consider_token): Always zero-terminate token buffer. 144 * etags.c (consider_token): Always zero-terminate token buffer.
@@ -1028,7 +1169,7 @@
1028 (Asm_help, default_C_suffixes, default_C_help, Cplusplus_suffixes) 1169 (Asm_help, default_C_suffixes, default_C_help, Cplusplus_suffixes)
1029 (Cplusplus_help, Cjava_suffixes, Cobol_suffixes, Cstar_suffixes) 1170 (Cplusplus_help, Cjava_suffixes, Cobol_suffixes, Cstar_suffixes)
1030 (Erlang_suffixes, Erlang_help, Forth_suffixes, Forth_help) 1171 (Erlang_suffixes, Erlang_help, Forth_suffixes, Forth_help)
1031 (Fortran_suffixes, Fortran_help, HTML_suffixes, HTML_help) 1172 (Fortran_suffixes, Fortran_help, HTML_suffixes, HTML_help)
1032 (Lisp_suffixes, Lisp_help, Lua_suffixes, Lua_help) 1173 (Lisp_suffixes, Lisp_help, Lua_suffixes, Lua_help)
1033 (Makefile_filenames, Makefile_help, Objc_suffixes, Objc_help) 1174 (Makefile_filenames, Makefile_help, Objc_suffixes, Objc_help)
1034 (Pascal_suffixes, Pascal_help, Perl_suffixes, Perl_interpreters) 1175 (Pascal_suffixes, Pascal_help, Perl_suffixes, Perl_interpreters)
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index c5acca28856..d271bb3a4fa 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -244,20 +244,21 @@ install: $(DESTDIR)${archlibdir}
244 @echo "Installing utilities for users to run." 244 @echo "Installing utilities for users to run."
245 umask 022; ${MKDIR_P} $(DESTDIR)${bindir} 245 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
246 for file in ${INSTALLABLES} ; do \ 246 for file in ${INSTALLABLES} ; do \
247 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ 247 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
248 done 248 done
249 for file in ${INSTALLABLE_SCRIPTS} ; do \ 249 for file in ${INSTALLABLE_SCRIPTS} ; do \
250 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ 250 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
251 done 251 done
252 252
253uninstall: 253uninstall:
254 (cd $(DESTDIR)${bindir}; \ 254 for file in ${INSTALLABLES}; do \
255 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \ 255 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
256 done
257 for file in ${INSTALLABLE_SCRIPTS}; do \
256 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ 258 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
257 done) 259 done
258 if [ -d $(DESTDIR)${archlibdir} ]; then \ 260 if [ -d $(DESTDIR)${archlibdir} ]; then \
259 (cd $(DESTDIR)${archlibdir} && \ 261 (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES} ${SCRIPTS}) \
260 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
261 fi 262 fi
262 263
263mostlyclean: 264mostlyclean:
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index f8569fe3747..056ed471fde 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -3516,8 +3516,7 @@ usage (int error)
3516static _Noreturn void 3516static _Noreturn void
3517version (void) 3517version (void)
3518{ 3518{
3519 /* Makes it easier to update automatically. */ 3519 char emacs_copyright[] = COPYRIGHT;
3520 char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc.";
3521 3520
3522 printf ("ebrowse %s\n", VERSION); 3521 printf ("ebrowse %s\n", VERSION);
3523 puts (emacs_copyright); 3522 puts (emacs_copyright);
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 07300dbf249..021ac6eb247 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -44,6 +44,10 @@ char *w32_getenv (char *);
44 44
45#else /* !WINDOWSNT */ 45#else /* !WINDOWSNT */
46 46
47# ifdef HAVE_NTGUI
48# include <windows.h>
49# endif /* HAVE_NTGUI */
50
47# include "syswait.h" 51# include "syswait.h"
48 52
49# ifdef HAVE_INET_SOCKETS 53# ifdef HAVE_INET_SOCKETS
@@ -84,10 +88,7 @@ char *w32_getenv (char *);
84 88
85 89
86 90
87char *getenv (const char *), *getwd (char *); 91char *getenv (const char *);
88#ifdef HAVE_GETCWD
89char *(getcwd) (char *, size_t);
90#endif
91 92
92#ifndef VERSION 93#ifndef VERSION
93#define VERSION "unspecified" 94#define VERSION "unspecified"
@@ -140,6 +141,9 @@ int current_frame = 1;
140/* The display on which Emacs should work. --display. */ 141/* The display on which Emacs should work. --display. */
141const char *display = NULL; 142const char *display = NULL;
142 143
144/* The alternate display we should try if Emacs does not support display. */
145const char *alt_display = NULL;
146
143/* The parent window ID, if we are opening a frame via XEmbed. */ 147/* The parent window ID, if we are opening a frame via XEmbed. */
144char *parent_id = NULL; 148char *parent_id = NULL;
145 149
@@ -182,9 +186,7 @@ struct option longopts[] =
182 { "socket-name", required_argument, NULL, 's' }, 186 { "socket-name", required_argument, NULL, 's' },
183#endif 187#endif
184 { "server-file", required_argument, NULL, 'f' }, 188 { "server-file", required_argument, NULL, 'f' },
185#ifndef WINDOWSNT
186 { "display", required_argument, NULL, 'd' }, 189 { "display", required_argument, NULL, 'd' },
187#endif
188 { "parent-id", required_argument, NULL, 'p' }, 190 { "parent-id", required_argument, NULL, 'p' },
189 { 0, 0, 0, 0 } 191 { 0, 0, 0, 0 }
190}; 192};
@@ -218,7 +220,7 @@ get_current_dir_name (void)
218 char *buf; 220 char *buf;
219 const char *pwd; 221 const char *pwd;
220 struct stat dotstat, pwdstat; 222 struct stat dotstat, pwdstat;
221 /* If PWD is accurate, use it instead of calling getwd. PWD is 223 /* If PWD is accurate, use it instead of calling getcwd. PWD is
222 sometimes a nicer name, and using it may avoid a fatal error if a 224 sometimes a nicer name, and using it may avoid a fatal error if a
223 parent directory is searchable but not readable. */ 225 parent directory is searchable but not readable. */
224 if ((pwd = egetenv ("PWD")) != 0 226 if ((pwd = egetenv ("PWD")) != 0
@@ -235,7 +237,6 @@ get_current_dir_name (void)
235 buf = (char *) xmalloc (strlen (pwd) + 1); 237 buf = (char *) xmalloc (strlen (pwd) + 1);
236 strcpy (buf, pwd); 238 strcpy (buf, pwd);
237 } 239 }
238#ifdef HAVE_GETCWD
239 else 240 else
240 { 241 {
241 size_t buf_size = 1024; 242 size_t buf_size = 1024;
@@ -262,20 +263,6 @@ get_current_dir_name (void)
262 } 263 }
263 } 264 }
264 } 265 }
265#else
266 else
267 {
268 /* We need MAXPATHLEN here. */
269 buf = (char *) xmalloc (MAXPATHLEN + 1);
270 if (getwd (buf) == NULL)
271 {
272 int tmp_errno = errno;
273 free (buf);
274 errno = tmp_errno;
275 return NULL;
276 }
277 }
278#endif
279 return buf; 266 return buf;
280} 267}
281#endif 268#endif
@@ -385,32 +372,6 @@ w32_getenv (char *envvar)
385 return NULL; 372 return NULL;
386} 373}
387 374
388void
389w32_set_user_model_id (void)
390{
391 HMODULE shell;
392 HRESULT (WINAPI * set_user_model) (wchar_t * id);
393
394 /* On Windows 7 and later, we need to set the user model ID
395 to associate emacsclient launched files with Emacs frames
396 in the UI. */
397 shell = LoadLibrary ("shell32.dll");
398 if (shell)
399 {
400 set_user_model
401 = (void *) GetProcAddress (shell,
402 "SetCurrentProcessExplicitAppUserModelID");
403 /* If the function is defined, then we are running on Windows 7
404 or newer, and the UI uses this to group related windows
405 together. Since emacs, runemacs, emacsclient are related, we
406 want them grouped even though the executables are different,
407 so we need to set a consistent ID between them. */
408 if (set_user_model)
409 set_user_model (L"GNU.Emacs");
410
411 FreeLibrary (shell);
412 }
413}
414 375
415int 376int
416w32_window_app (void) 377w32_window_app (void)
@@ -605,16 +566,29 @@ decode_options (int argc, char **argv)
605 Without the -c option, we used to set `display' to $DISPLAY by 566 Without the -c option, we used to set `display' to $DISPLAY by
606 default, but this changed the default behavior and is sometimes 567 default, but this changed the default behavior and is sometimes
607 inconvenient. So we force users to use "--display $DISPLAY" if 568 inconvenient. So we force users to use "--display $DISPLAY" if
608 they want Emacs to connect to their current display. */ 569 they want Emacs to connect to their current display.
570
571 Some window systems have a notion of default display not
572 reflected in the DISPLAY variable. If the user didn't give us an
573 explicit display, try this platform-specific after trying the
574 display in DISPLAY (if any). */
609 if (!current_frame && !tty && !display) 575 if (!current_frame && !tty && !display)
610 { 576 {
611 display = egetenv ("DISPLAY"); 577 /* Set these here so we use a default_display only when the user
612#ifdef NS_IMPL_COCOA 578 didn't give us an explicit display. */
613 /* Under Cocoa, we don't really use displays the same way as in X, 579#if defined (NS_IMPL_COCOA)
614 so provide a dummy. */ 580 alt_display = "ns";
615 if (!display || strlen (display) == 0) 581#elif defined (HAVE_NTGUI)
616 display = "ns"; 582 alt_display = "w32";
617#endif 583#endif
584
585 display = egetenv ("DISPLAY");
586 }
587
588 if (!display)
589 {
590 display = alt_display;
591 alt_display = NULL;
618 } 592 }
619 593
620 /* A null-string display is invalid. */ 594 /* A null-string display is invalid. */
@@ -1146,7 +1120,7 @@ handle_sigcont (int signalnum)
1146 else 1120 else
1147 { 1121 {
1148 /* We are in the background; cancel the continue. */ 1122 /* We are in the background; cancel the continue. */
1149 kill (getpid (), SIGSTOP); 1123 raise (SIGSTOP);
1150 } 1124 }
1151 1125
1152 signal (signalnum, handle_sigcont); 1126 signal (signalnum, handle_sigcont);
@@ -1173,7 +1147,7 @@ handle_sigtstp (int signalnum)
1173 sigprocmask (SIG_BLOCK, NULL, &set); 1147 sigprocmask (SIG_BLOCK, NULL, &set);
1174 sigdelset (&set, signalnum); 1148 sigdelset (&set, signalnum);
1175 signal (signalnum, SIG_DFL); 1149 signal (signalnum, SIG_DFL);
1176 kill (getpid (), signalnum); 1150 raise (signalnum);
1177 sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */ 1151 sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */
1178 signal (signalnum, handle_sigtstp); 1152 signal (signalnum, handle_sigtstp);
1179 1153
@@ -1415,10 +1389,37 @@ set_socket (int no_exit_if_error)
1415 exit (EXIT_FAILURE); 1389 exit (EXIT_FAILURE);
1416} 1390}
1417 1391
1418#ifdef WINDOWSNT 1392#ifdef HAVE_NTGUI
1419FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */ 1393FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
1420FARPROC get_wc; /* Pointer to RealGetWindowClassA. */ 1394FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
1421 1395
1396void
1397w32_set_user_model_id (void)
1398{
1399 HMODULE shell;
1400 HRESULT (WINAPI * set_user_model) (wchar_t * id);
1401
1402 /* On Windows 7 and later, we need to set the user model ID
1403 to associate emacsclient launched files with Emacs frames
1404 in the UI. */
1405 shell = LoadLibrary ("shell32.dll");
1406 if (shell)
1407 {
1408 set_user_model
1409 = (void *) GetProcAddress (shell,
1410 "SetCurrentProcessExplicitAppUserModelID");
1411 /* If the function is defined, then we are running on Windows 7
1412 or newer, and the UI uses this to group related windows
1413 together. Since emacs, runemacs, emacsclient are related, we
1414 want them grouped even though the executables are different,
1415 so we need to set a consistent ID between them. */
1416 if (set_user_model)
1417 set_user_model (L"GNU.Emacs");
1418
1419 FreeLibrary (shell);
1420 }
1421}
1422
1422BOOL CALLBACK 1423BOOL CALLBACK
1423w32_find_emacs_process (HWND hWnd, LPARAM lParam) 1424w32_find_emacs_process (HWND hWnd, LPARAM lParam)
1424{ 1425{
@@ -1467,7 +1468,7 @@ w32_give_focus (void)
1467 && (get_wc = GetProcAddress (user32, "RealGetWindowClassA"))) 1468 && (get_wc = GetProcAddress (user32, "RealGetWindowClassA")))
1468 EnumWindows (w32_find_emacs_process, (LPARAM) 0); 1469 EnumWindows (w32_find_emacs_process, (LPARAM) 0);
1469} 1470}
1470#endif 1471#endif /* HAVE_NTGUI */
1471 1472
1472/* Start the emacs daemon and try to connect to it. */ 1473/* Start the emacs daemon and try to connect to it. */
1473 1474
@@ -1537,11 +1538,13 @@ main (int argc, char **argv)
1537 main_argv = argv; 1538 main_argv = argv;
1538 progname = argv[0]; 1539 progname = argv[0];
1539 1540
1540#ifdef WINDOWSNT 1541#ifdef HAVE_NTGUI
1541 /* On Windows 7 and later, we need to explicitly associate emacsclient 1542 /* On Windows 7 and later, we need to explicitly associate
1542 with emacs so the UI behaves sensibly. */ 1543 emacsclient with emacs so the UI behaves sensibly. This
1544 association does no harm if we're not actually connecting to an
1545 Emacs using a window display. */
1543 w32_set_user_model_id (); 1546 w32_set_user_model_id ();
1544#endif 1547#endif /* HAVE_NTGUI */
1545 1548
1546 /* Process options. */ 1549 /* Process options. */
1547 decode_options (argc, argv); 1550 decode_options (argc, argv);
@@ -1571,15 +1574,15 @@ main (int argc, char **argv)
1571 cwd = get_current_dir_name (); 1574 cwd = get_current_dir_name ();
1572 if (cwd == 0) 1575 if (cwd == 0)
1573 { 1576 {
1574 /* getwd puts message in STRING if it fails. */
1575 message (TRUE, "%s: %s\n", progname, 1577 message (TRUE, "%s: %s\n", progname,
1576 "Cannot get current working directory"); 1578 "Cannot get current working directory");
1577 fail (); 1579 fail ();
1578 } 1580 }
1579 1581
1580#ifdef WINDOWSNT 1582#ifdef HAVE_NTGUI
1583 if (display && !strcmp (display, "w32"))
1581 w32_give_focus (); 1584 w32_give_focus ();
1582#endif 1585#endif /* HAVE_NTGUI */
1583 1586
1584 /* Send over our environment and current directory. */ 1587 /* Send over our environment and current directory. */
1585 if (!current_frame) 1588 if (!current_frame)
@@ -1748,46 +1751,56 @@ main (int argc, char **argv)
1748 if (end_p != NULL) 1751 if (end_p != NULL)
1749 *end_p++ = '\0'; 1752 *end_p++ = '\0';
1750 1753
1751 if (strprefix ("-emacs-pid ", p)) 1754 if (strprefix ("-emacs-pid ", p))
1752 { 1755 {
1753 /* -emacs-pid PID: The process id of the Emacs process. */ 1756 /* -emacs-pid PID: The process id of the Emacs process. */
1754 emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10); 1757 emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10);
1755 } 1758 }
1756 else if (strprefix ("-window-system-unsupported ", p)) 1759 else if (strprefix ("-window-system-unsupported ", p))
1757 { 1760 {
1758 /* -window-system-unsupported: Emacs was compiled without X 1761 /* -window-system-unsupported: Emacs was compiled without support
1759 support. Try again on the terminal. */ 1762 for whatever window system we tried. Try the alternate
1760 nowait = 0; 1763 display, or, failing that, try the terminal. */
1761 tty = 1; 1764 if (alt_display)
1762 goto retry; 1765 {
1763 } 1766 display = alt_display;
1764 else if (strprefix ("-print ", p)) 1767 alt_display = NULL;
1765 { 1768 }
1766 /* -print STRING: Print STRING on the terminal. */ 1769 else
1767 str = unquote_argument (p + strlen ("-print ")); 1770 {
1768 if (needlf) 1771 nowait = 0;
1769 printf ("\n"); 1772 tty = 1;
1770 printf ("%s", str); 1773 }
1771 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1774
1772 } 1775 goto retry;
1773 else if (strprefix ("-print-nonl ", p)) 1776 }
1774 { 1777 else if (strprefix ("-print ", p))
1775 /* -print-nonl STRING: Print STRING on the terminal. 1778 {
1776 Used to continue a preceding -print command. */ 1779 /* -print STRING: Print STRING on the terminal. */
1777 str = unquote_argument (p + strlen ("-print-nonl ")); 1780 str = unquote_argument (p + strlen ("-print "));
1778 printf ("%s", str); 1781 if (needlf)
1779 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1782 printf ("\n");
1780 } 1783 printf ("%s", str);
1781 else if (strprefix ("-error ", p)) 1784 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1782 { 1785 }
1783 /* -error DESCRIPTION: Signal an error on the terminal. */ 1786 else if (strprefix ("-print-nonl ", p))
1784 str = unquote_argument (p + strlen ("-error ")); 1787 {
1785 if (needlf) 1788 /* -print-nonl STRING: Print STRING on the terminal.
1786 printf ("\n"); 1789 Used to continue a preceding -print command. */
1787 fprintf (stderr, "*ERROR*: %s", str); 1790 str = unquote_argument (p + strlen ("-print-nonl "));
1788 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; 1791 printf ("%s", str);
1789 exit_status = EXIT_FAILURE; 1792 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1790 } 1793 }
1794 else if (strprefix ("-error ", p))
1795 {
1796 /* -error DESCRIPTION: Signal an error on the terminal. */
1797 str = unquote_argument (p + strlen ("-error "));
1798 if (needlf)
1799 printf ("\n");
1800 fprintf (stderr, "*ERROR*: %s", str);
1801 needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
1802 exit_status = EXIT_FAILURE;
1803 }
1791#ifdef SIGSTOP 1804#ifdef SIGSTOP
1792 else if (strprefix ("-suspend ", p)) 1805 else if (strprefix ("-suspend ", p))
1793 { 1806 {
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e65082de534..d393c4d2e4a 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -123,19 +123,9 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
123# undef HAVE_NTGUI 123# undef HAVE_NTGUI
124# undef DOS_NT 124# undef DOS_NT
125# define DOS_NT 125# define DOS_NT
126# ifndef HAVE_GETCWD 126#endif /* WINDOWSNT */
127# define HAVE_GETCWD
128# endif /* undef HAVE_GETCWD */
129#else /* not WINDOWSNT */
130#endif /* !WINDOWSNT */
131 127
132#include <unistd.h> 128#include <unistd.h>
133#ifndef HAVE_UNISTD_H
134# if defined (HAVE_GETCWD) && !defined (WINDOWSNT)
135 extern char *getcwd (char *buf, size_t size);
136# endif
137#endif /* HAVE_UNISTD_H */
138
139#include <stdarg.h> 129#include <stdarg.h>
140#include <stdlib.h> 130#include <stdlib.h>
141#include <string.h> 131#include <string.h>
@@ -152,16 +142,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
152# define assert(x) ((void) 0) 142# define assert(x) ((void) 0)
153#endif 143#endif
154 144
155#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */ 145#include <getopt.h>
156# define NO_LONG_OPTIONS TRUE
157# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
158 extern char *optarg;
159 extern int optind, opterr;
160#else
161# define NO_LONG_OPTIONS FALSE
162# include <getopt.h>
163#endif /* NO_LONG_OPTIONS */
164
165#include <regex.h> 146#include <regex.h>
166 147
167/* Define CTAGS to make the program "ctags" compatible with the usual one. 148/* Define CTAGS to make the program "ctags" compatible with the usual one.
@@ -372,6 +353,7 @@ static void put_entries (node *);
372static char *concat (const char *, const char *, const char *); 353static char *concat (const char *, const char *, const char *);
373static char *skip_spaces (char *); 354static char *skip_spaces (char *);
374static char *skip_non_spaces (char *); 355static char *skip_non_spaces (char *);
356static char *skip_name (char *);
375static char *savenstr (const char *, int); 357static char *savenstr (const char *, int);
376static char *savestr (const char *); 358static char *savestr (const char *);
377static char *etags_strchr (const char *, int); 359static char *etags_strchr (const char *, int);
@@ -638,7 +620,8 @@ static const char Lisp_help [] =
638"In Lisp code, any function defined with `defun', any variable\n\ 620"In Lisp code, any function defined with `defun', any variable\n\
639defined with `defvar' or `defconst', and in general the first\n\ 621defined with `defvar' or `defconst', and in general the first\n\
640argument of any expression that starts with `(def' in column zero\n\ 622argument of any expression that starts with `(def' in column zero\n\
641is a tag."; 623is a tag.\n\
624The `--declarations' option tags \"(defvar foo)\" constructs too.";
642 625
643static const char *Lua_suffixes [] = 626static const char *Lua_suffixes [] =
644 { "lua", "LUA", NULL }; 627 { "lua", "LUA", NULL };
@@ -836,8 +819,7 @@ etags --help --lang=ada.");
836static void 819static void
837print_version (void) 820print_version (void)
838{ 821{
839 /* Makes it easier to update automatically. */ 822 char emacs_copyright[] = COPYRIGHT;
840 char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc.";
841 823
842 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); 824 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
843 puts (emacs_copyright); 825 puts (emacs_copyright);
@@ -870,11 +852,7 @@ print_help (argument *argbuffer)
870 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ 852 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
871\n\ 853\n\
872These are the options accepted by %s.\n", progname, progname); 854These are the options accepted by %s.\n", progname, progname);
873 if (NO_LONG_OPTIONS) 855 puts ("You may use unambiguous abbreviations for the long option names.");
874 puts ("WARNING: long option names do not work with this executable,\n\
875as it is not linked with GNU getopt.");
876 else
877 puts ("You may use unambiguous abbreviations for the long option names.");
878 puts (" A - as file name means read names from stdin (one per line).\n\ 856 puts (" A - as file name means read names from stdin (one per line).\n\
879Absolute names are stored in the output file as they are.\n\ 857Absolute names are stored in the output file as they are.\n\
880Relative ones are stored relative to the output file's directory.\n"); 858Relative ones are stored relative to the output file's directory.\n");
@@ -1066,9 +1044,9 @@ main (int argc, char **argv)
1066 1044
1067 /* When the optstring begins with a '-' getopt_long does not rearrange the 1045 /* When the optstring begins with a '-' getopt_long does not rearrange the
1068 non-options arguments to be at the end, but leaves them alone. */ 1046 non-options arguments to be at the end, but leaves them alone. */
1069 optstring = concat (NO_LONG_OPTIONS ? "" : "-", 1047 optstring = concat ("-ac:Cf:Il:o:r:RSVhH",
1070 "ac:Cf:Il:o:r:RSVhH", 1048 (CTAGS) ? "BxdtTuvw" : "Di:",
1071 (CTAGS) ? "BxdtTuvw" : "Di:"); 1049 "");
1072 1050
1073 while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) 1051 while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF)
1074 switch (opt) 1052 switch (opt)
@@ -4293,6 +4271,7 @@ Asm_labels (FILE *inf)
4293/* 4271/*
4294 * Perl support 4272 * Perl support
4295 * Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/ 4273 * Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/
4274 * /^use constant[ \t\n]+[^ \t\n{=,;]+/
4296 * Perl variable names: /^(my|local).../ 4275 * Perl variable names: /^(my|local).../
4297 * Original code by Bart Robinson <lomew@cs.utah.edu> (1995) 4276 * Original code by Bart Robinson <lomew@cs.utah.edu> (1995)
4298 * Additions by Michael Ernst <mernst@alum.mit.edu> (1997) 4277 * Additions by Michael Ernst <mernst@alum.mit.edu> (1997)
@@ -4315,9 +4294,10 @@ Perl_functions (FILE *inf)
4315 } 4294 }
4316 else if (LOOKING_AT (cp, "sub")) 4295 else if (LOOKING_AT (cp, "sub"))
4317 { 4296 {
4318 char *pos; 4297 char *pos, *sp;
4319 char *sp = cp;
4320 4298
4299 subr:
4300 sp = cp;
4321 while (!notinname (*cp)) 4301 while (!notinname (*cp))
4322 cp++; 4302 cp++;
4323 if (cp == sp) 4303 if (cp == sp)
@@ -4340,8 +4320,21 @@ Perl_functions (FILE *inf)
4340 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4320 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4341 free (name); 4321 free (name);
4342 } 4322 }
4323 }
4324 else if (LOOKING_AT (cp, "use constant")
4325 || LOOKING_AT (cp, "use constant::defer"))
4326 {
4327 /* For hash style multi-constant like
4328 use constant { FOO => 123,
4329 BAR => 456 };
4330 only the first FOO is picked up. Parsing across the value
4331 expressions would be difficult in general, due to possible nested
4332 hashes, here-documents, etc. */
4333 if (*cp == '{')
4334 cp = skip_spaces (cp+1);
4335 goto subr;
4343 } 4336 }
4344 else if (globals) /* only if we are tagging global vars */ 4337 else if (globals) /* only if we are tagging global vars */
4345 { 4338 {
4346 /* Skip a qualifier, if any. */ 4339 /* Skip a qualifier, if any. */
4347 bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local"); 4340 bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local");
@@ -4756,6 +4749,19 @@ Lisp_functions (FILE *inf)
4756 if (dbp[0] != '(') 4749 if (dbp[0] != '(')
4757 continue; 4750 continue;
4758 4751
4752 /* "(defvar foo)" is a declaration rather than a definition. */
4753 if (! declarations)
4754 {
4755 char *p = dbp + 1;
4756 if (LOOKING_AT (p, "defvar"))
4757 {
4758 p = skip_name (p); /* past var name */
4759 p = skip_spaces (p);
4760 if (*p == ')')
4761 continue;
4762 }
4763 }
4764
4759 if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3)) 4765 if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3))
4760 { 4766 {
4761 dbp = skip_non_spaces (dbp); 4767 dbp = skip_non_spaces (dbp);
@@ -6316,6 +6322,16 @@ skip_non_spaces (char *cp)
6316 return cp; 6322 return cp;
6317} 6323}
6318 6324
6325/* Skip any chars in the "name" class.*/
6326static char *
6327skip_name (char *cp)
6328{
6329 /* '\0' is a notinname() so loop stops there too */
6330 while (! notinname (*cp))
6331 cp++;
6332 return cp;
6333}
6334
6319/* Print error message and exit. */ 6335/* Print error message and exit. */
6320void 6336void
6321fatal (const char *s1, const char *s2) 6337fatal (const char *s1, const char *s2)
@@ -6334,8 +6350,8 @@ pfatal (const char *s1)
6334static void 6350static void
6335suggest_asking_for_help (void) 6351suggest_asking_for_help (void)
6336{ 6352{
6337 fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", 6353 fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n",
6338 progname, NO_LONG_OPTIONS ? "-h" : "--help"); 6354 progname);
6339 exit (EXIT_FAILURE); 6355 exit (EXIT_FAILURE);
6340} 6356}
6341 6357
@@ -6373,7 +6389,6 @@ concat (const char *s1, const char *s2, const char *s3)
6373static char * 6389static char *
6374etags_getcwd (void) 6390etags_getcwd (void)
6375{ 6391{
6376#ifdef HAVE_GETCWD
6377 int bufsize = 200; 6392 int bufsize = 200;
6378 char *path = xnew (bufsize, char); 6393 char *path = xnew (bufsize, char);
6379 6394
@@ -6388,34 +6403,6 @@ etags_getcwd (void)
6388 6403
6389 canonicalize_filename (path); 6404 canonicalize_filename (path);
6390 return path; 6405 return path;
6391
6392#else /* not HAVE_GETCWD */
6393#if MSDOS
6394
6395 char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
6396
6397 getwd (path);
6398
6399 for (p = path; *p != '\0'; p++)
6400 if (*p == '\\')
6401 *p = '/';
6402 else
6403 *p = lowcase (*p);
6404
6405 return strdup (path);
6406#else /* not MSDOS */
6407 linebuffer path;
6408 FILE *pipe;
6409
6410 linebuffer_init (&path);
6411 pipe = (FILE *) popen ("pwd 2>/dev/null", "r");
6412 if (pipe == NULL || readline_internal (&path, pipe) == 0)
6413 pfatal ("pwd");
6414 pclose (pipe);
6415
6416 return path.buffer;
6417#endif /* not MSDOS */
6418#endif /* not HAVE_GETCWD */
6419} 6406}
6420 6407
6421/* Return a newly allocated string containing the file name of FILE 6408/* Return a newly allocated string containing the file name of FILE
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 2654387fb37..68e7029ee85 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -58,9 +58,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#undef chdir 58#undef chdir
59#define READ_TEXT "rt" 59#define READ_TEXT "rt"
60#define READ_BINARY "rb" 60#define READ_BINARY "rb"
61#define IS_SLASH(c) ((c) == '/' || (c) == '\\' || (c) == ':')
61#else /* not DOS_NT */ 62#else /* not DOS_NT */
62#define READ_TEXT "r" 63#define READ_TEXT "r"
63#define READ_BINARY "r" 64#define READ_BINARY "r"
65#define IS_SLASH(c) ((c) == '/')
64#endif /* not DOS_NT */ 66#endif /* not DOS_NT */
65 67
66static int scan_file (char *filename); 68static int scan_file (char *filename);
@@ -659,7 +661,9 @@ write_globals (void)
659 special hacks. */ 661 special hacks. */
660 if (strcmp (globals[i].name, "Fthrow") == 0 662 if (strcmp (globals[i].name, "Fthrow") == 0
661 || strcmp (globals[i].name, "Ftop_level") == 0 663 || strcmp (globals[i].name, "Ftop_level") == 0
662 || strcmp (globals[i].name, "Fkill_emacs") == 0) 664 || strcmp (globals[i].name, "Fkill_emacs") == 0
665 || strcmp (globals[i].name, "Fexit_recursive_edit") == 0
666 || strcmp (globals[i].name, "Fabort_recursive_edit") == 0)
663 fprintf (outfile, "_Noreturn "); 667 fprintf (outfile, "_Noreturn ");
664 fprintf (outfile, "EXFUN (%s, ", globals[i].name); 668 fprintf (outfile, "EXFUN (%s, ", globals[i].name);
665 if (globals[i].value == -1) 669 if (globals[i].value == -1)
@@ -1023,9 +1027,9 @@ scan_c_file (char *filename, const char *mode)
1023 arglist, but the doc string must still have a backslash and newline 1027 arglist, but the doc string must still have a backslash and newline
1024 immediately after the double quote. 1028 immediately after the double quote.
1025 The only source files that must follow this convention are preloaded 1029 The only source files that must follow this convention are preloaded
1026 uncompiled ones like loaddefs.el and bindings.el; aside 1030 uncompiled ones like loaddefs.el; aside from that, it is always the .elc
1027 from that, it is always the .elc file that we look at, and they are no 1031 file that we should look at, and they are no problem because byte-compiler
1028 problem because byte-compiler output follows this convention. 1032 output follows this convention.
1029 The NAME and DOCSTRING are output. 1033 The NAME and DOCSTRING are output.
1030 NAME is preceded by `F' for a function or `V' for a variable. 1034 NAME is preceded by `F' for a function or `V' for a variable.
1031 An entry is output only if DOCSTRING has \ newline just after the opening ". 1035 An entry is output only if DOCSTRING has \ newline just after the opening ".
@@ -1096,15 +1100,50 @@ search_lisp_doc_at_eol (FILE *infile)
1096 return 1; 1100 return 1;
1097} 1101}
1098 1102
1103#define DEF_ELISP_FILE(fn) { #fn, sizeof(#fn) - 1 }
1104
1099static int 1105static int
1100scan_lisp_file (const char *filename, const char *mode) 1106scan_lisp_file (const char *filename, const char *mode)
1101{ 1107{
1102 FILE *infile; 1108 FILE *infile;
1103 register int c; 1109 register int c;
1104 char *saved_string = 0; 1110 char *saved_string = 0;
1111 /* These are the only files that are loaded uncompiled, and must
1112 follow the conventions of the doc strings expected by this
1113 function. These conventions are automatically followed by the
1114 byte compiler when it produces the .elc files. */
1115 static struct {
1116 const char *fn;
1117 size_t fl;
1118 } const uncompiled[] = {
1119 DEF_ELISP_FILE (loaddefs.el),
1120 DEF_ELISP_FILE (loadup.el),
1121 DEF_ELISP_FILE (charprop.el),
1122 DEF_ELISP_FILE (cp51932.el),
1123 DEF_ELISP_FILE (eucjp-ms.el)
1124 };
1125 int i, match;
1126 size_t flen = strlen (filename);
1105 1127
1106 if (generate_globals) 1128 if (generate_globals)
1107 fatal ("scanning lisp file when -g specified", 0); 1129 fatal ("scanning lisp file when -g specified", 0);
1130 if (flen > 3 && !strcmp (filename + flen - 3, ".el"))
1131 {
1132 for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]);
1133 i++)
1134 {
1135 if (uncompiled[i].fl <= flen
1136 && !strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn)
1137 && (flen == uncompiled[i].fl
1138 || IS_SLASH (filename[flen - uncompiled[i].fl - 1])))
1139 {
1140 match = 1;
1141 break;
1142 }
1143 }
1144 if (!match)
1145 fatal ("uncompiled lisp file %s is not supported", filename);
1146 }
1108 1147
1109 infile = fopen (filename, mode); 1148 infile = fopen (filename, mode);
1110 if (infile == NULL) 1149 if (infile == NULL)
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 64974b88b6f..24be44e22f2 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -123,10 +123,13 @@ $(BLD)/profile.exe: $(PROFILEOBJS)
123# 123#
124obj = dosfns.o msdos.o \ 124obj = dosfns.o msdos.o \
125 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ 125 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
126 fontset.o menu.o \ 126 fontset.o menu.o dbusbind.o cygw32.o \
127 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ 127 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
128 w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
128 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ 129 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
129 font.o w32font.o w32uniscribe.o \ 130 w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
131 xsettings.o xgselect.o termcap.o \
132 font.o w32font.o w32uniscribe.o w32notify.o \
130 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \ 133 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
131 charset.o coding.o category.o ccl.o character.o chartab.o \ 134 charset.o coding.o category.o ccl.o character.o chartab.o \
132 cm.o term.o terminal.o xfaces.o \ 135 cm.o term.o terminal.o xfaces.o \
@@ -140,7 +143,7 @@ obj = dosfns.o msdos.o \
140 process.o callproc.o unexw32.o \ 143 process.o callproc.o unexw32.o \
141 region-cache.o sound.o atimer.o \ 144 region-cache.o sound.o atimer.o \
142 doprnt.o intervals.o textprop.o composite.o \ 145 doprnt.o intervals.o textprop.o composite.o \
143 gnutls.o xml.o 146 gnutls.o xml.o profiler.o
144 147
145# 148#
146# These are the lisp files that are loaded up in loadup.el 149# These are the lisp files that are loaded up in loadup.el
@@ -209,38 +212,40 @@ lisp1= \
209 $(lispsource)emacs-lisp/map-ynp.elc \ 212 $(lispsource)emacs-lisp/map-ynp.elc \
210 $(lispsource)menu-bar.elc \ 213 $(lispsource)menu-bar.elc \
211 $(lispsource)international/mule.elc \ 214 $(lispsource)international/mule.elc \
212 $(lispsource)international/mule-conf.el \ 215 $(lispsource)international/mule-conf.elc \
213 $(lispsource)international/mule-cmds.elc \ 216 $(lispsource)international/mule-cmds.elc \
214 $(lispsource)international/characters.elc \ 217 $(lispsource)international/characters.elc \
215 $(lispsource)international/charprop.el \ 218 $(lispsource)international/charprop.el \
216 $(lispsource)case-table.elc 219 $(lispsource)case-table.elc
217 220
218lisp2 = \ 221lisp2 = \
219 $(lispsource)language/chinese.el \ 222 $(lispsource)language/chinese.elc \
220 $(lispsource)language/cyrillic.el \ 223 $(lispsource)language/cyrillic.elc \
221 $(lispsource)language/indian.el \ 224 $(lispsource)language/indian.elc \
222 $(lispsource)language/sinhala.el \ 225 $(lispsource)language/sinhala.elc \
223 $(lispsource)language/english.el \ 226 $(lispsource)language/english.elc \
224 $(lispsource)language/ethiopic.elc \ 227 $(lispsource)language/ethiopic.elc \
225 $(lispsource)language/european.elc \ 228 $(lispsource)language/european.elc \
226 $(lispsource)language/czech.el \ 229 $(lispsource)language/czech.elc \
227 $(lispsource)language/slovak.el \ 230 $(lispsource)language/slovak.elc \
228 $(lispsource)language/romanian.el \ 231 $(lispsource)language/romanian.elc \
229 $(lispsource)language/greek.el \ 232 $(lispsource)language/greek.elc \
230 $(lispsource)language/hebrew.elc \ 233 $(lispsource)language/hebrew.elc \
231 $(lispsource)language/japanese.el \ 234 $(lispsource)language/japanese.elc \
232 $(lispsource)language/korean.el \ 235 $(lispsource)international/cp51932.el \
233 $(lispsource)language/lao.el \ 236 $(lispsource)international/eucjp-ms.el \
234 $(lispsource)language/cham.el \ 237 $(lispsource)language/korean.elc \
235 $(lispsource)language/tai-viet.el \ 238 $(lispsource)language/lao.elc \
236 $(lispsource)language/thai.el \ 239 $(lispsource)language/cham.elc \
240 $(lispsource)language/tai-viet.elc \
241 $(lispsource)language/thai.elc \
237 $(lispsource)language/tibetan.elc \ 242 $(lispsource)language/tibetan.elc \
238 $(lispsource)language/vietnamese.el \ 243 $(lispsource)language/vietnamese.elc \
239 $(lispsource)language/misc-lang.el \ 244 $(lispsource)language/misc-lang.elc \
240 $(lispsource)language/utf-8-lang.el \ 245 $(lispsource)language/utf-8-lang.elc \
241 $(lispsource)language/georgian.el \ 246 $(lispsource)language/georgian.elc \
242 $(lispsource)language/khmer.el \ 247 $(lispsource)language/khmer.elc \
243 $(lispsource)language/burmese.el \ 248 $(lispsource)language/burmese.elc \
244 $(lispsource)register.elc \ 249 $(lispsource)register.elc \
245 $(lispsource)replace.elc \ 250 $(lispsource)replace.elc \
246 $(lispsource)simple.elc \ 251 $(lispsource)simple.elc \
@@ -266,7 +271,7 @@ lisp2 = \
266 $(WINDOW_SUPPORT) \ 271 $(WINDOW_SUPPORT) \
267 $(lispsource)widget.elc \ 272 $(lispsource)widget.elc \
268 $(lispsource)window.elc \ 273 $(lispsource)window.elc \
269 $(lispsource)version.el 274 $(lispsource)version.elc
270 275
271# This is needed the first time we build the tree, since temacs.exe 276# This is needed the first time we build the tree, since temacs.exe
272# does not exist yet, and the DOC rule needs it to rebuild DOC whenever 277# does not exist yet, and the DOC rule needs it to rebuild DOC whenever
@@ -372,6 +377,9 @@ NTLIB_H = $(LIB_SRC)/ntlib.h \
372SYSTIME_H = $(SRC)/systime.h \ 377SYSTIME_H = $(SRC)/systime.h \
373 $(NT_INC)/sys/time.h \ 378 $(NT_INC)/sys/time.h \
374 $(GNU_LIB)/timespec.h 379 $(GNU_LIB)/timespec.h
380SYSWAIT_H = $(SRC)/syswait.h \
381 $(NT_INC)/stdbool.h \
382 $(NT_INC)/sys/wait.h
375 383
376$(BLD)/ctags.$(O) : \ 384$(BLD)/ctags.$(O) : \
377 $(LIB_SRC)/ctags.c \ 385 $(LIB_SRC)/ctags.c \
@@ -417,14 +425,14 @@ $(BLD)/make-docfile.$(O) : \
417$(BLD)/movemail.$(O) : \ 425$(BLD)/movemail.$(O) : \
418 $(LIB_SRC)/movemail.c \ 426 $(LIB_SRC)/movemail.c \
419 $(LIB_SRC)/pop.h \ 427 $(LIB_SRC)/pop.h \
420 $(SRC)/syswait.h \
421 $(NT_INC)/pwd.h \ 428 $(NT_INC)/pwd.h \
422 $(NT_INC)/sys/file.h \ 429 $(NT_INC)/sys/file.h \
423 $(NT_INC)/sys/stat.h \ 430 $(NT_INC)/sys/stat.h \
424 $(NT_INC)/unistd.h \ 431 $(NT_INC)/unistd.h \
425 $(GNU_LIB)/getopt.h \ 432 $(GNU_LIB)/getopt.h \
426 $(CONFIG_H) \ 433 $(CONFIG_H) \
427 $(NTLIB_H) 434 $(NTLIB_H) \
435 $(SYSWAIT_H)
428 436
429$(BLD)/ntlib.$(O) : \ 437$(BLD)/ntlib.$(O) : \
430 $(LIB_SRC)/ntlib.c \ 438 $(LIB_SRC)/ntlib.c \
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 32d32e69abf..f2b2484c8e3 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -65,9 +65,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
65 65
66#include <getopt.h> 66#include <getopt.h>
67#include <unistd.h> 67#include <unistd.h>
68#ifdef HAVE_FCNTL_H
69#include <fcntl.h> 68#include <fcntl.h>
70#endif
71#include <string.h> 69#include <string.h>
72#include "syswait.h" 70#include "syswait.h"
73#ifdef MAIL_USE_POP 71#ifdef MAIL_USE_POP
@@ -98,13 +96,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
98#include <fcntl.h> 96#include <fcntl.h>
99#endif /* WINDOWSNT */ 97#endif /* WINDOWSNT */
100 98
101#ifndef F_OK
102#define F_OK 0
103#define X_OK 1
104#define W_OK 2
105#define R_OK 4
106#endif
107
108#ifdef WINDOWSNT 99#ifdef WINDOWSNT
109#include <sys/locking.h> 100#include <sys/locking.h>
110#endif 101#endif
@@ -337,11 +328,8 @@ main (int argc, char **argv)
337 328
338 tem = link (tempname, lockname); 329 tem = link (tempname, lockname);
339 330
340#ifdef EPERM 331 if (tem < 0 && errno != EEXIST)
341 if (tem < 0 && errno == EPERM) 332 pfatal_with_name (lockname);
342 fatal ("Unable to create hard link between %s and %s",
343 tempname, lockname);
344#endif
345 333
346 unlink (tempname); 334 unlink (tempname);
347 if (tem >= 0) 335 if (tem >= 0)
@@ -442,22 +430,10 @@ main (int argc, char **argv)
442 for certain failure codes. */ 430 for certain failure codes. */
443 if (status < 0) 431 if (status < 0)
444 { 432 {
445 if (++lockcount <= 5) 433 if (++lockcount <= 5 && (errno == EAGAIN || errno == EBUSY))
446 { 434 {
447#ifdef EAGAIN 435 sleep (1);
448 if (errno == EAGAIN) 436 goto retry_lock;
449 {
450 sleep (1);
451 goto retry_lock;
452 }
453#endif
454#ifdef EBUSY
455 if (errno == EBUSY)
456 {
457 sleep (1);
458 goto retry_lock;
459 }
460#endif
461 } 437 }
462 438
463 pfatal_with_name (inname); 439 pfatal_with_name (inname);
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index 2cc791fb56a..4e125eb6d73 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -29,9 +29,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <errno.h> 30#include <errno.h>
31#include <ctype.h> 31#include <ctype.h>
32#include <sys/timeb.h>
33#include <mbstring.h>
32 34
33#include "ntlib.h" 35#include "ntlib.h"
34 36
37struct timezone
38{
39 int tz_minuteswest; /* minutes west of Greenwich */
40 int tz_dsttime; /* type of dst correction */
41};
42
35#define MAXPATHLEN _MAX_PATH 43#define MAXPATHLEN _MAX_PATH
36 44
37/* Emulate sleep...we could have done this with a define, but that 45/* Emulate sleep...we could have done this with a define, but that
@@ -202,6 +210,29 @@ getpass (const char * prompt)
202 return NULL; 210 return NULL;
203} 211}
204 212
213/* This is needed because lib/gettime.c calls gettimeofday, which MSVC
214 doesn't have. Copied from w32.c. */
215void
216gettimeofday (struct timeval *tv, struct timezone *tz)
217{
218 struct _timeb tb;
219 _ftime (&tb);
220
221 tv->tv_sec = tb.time;
222 tv->tv_usec = tb.millitm * 1000L;
223 /* Implementation note: _ftime sometimes doesn't update the dstflag
224 according to the new timezone when the system timezone is
225 changed. We could fix that by using GetSystemTime and
226 GetTimeZoneInformation, but that doesn't seem necessary, since
227 Emacs always calls gettimeofday with the 2nd argument NULL (see
228 current_emacs_time). */
229 if (tz)
230 {
231 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
232 tz->tz_dsttime = tb.dstflag; /* type of dst correction */
233 }
234}
235
205int 236int
206fchown (int fd, unsigned uid, unsigned gid) 237fchown (int fd, unsigned uid, unsigned gid)
207{ 238{
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 74054e0e1b1..bfbcb8c9466 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1083,7 +1083,7 @@ socket_connection (char *host, int flags)
1083 if (it->ai_addrlen == sizeof (addr)) 1083 if (it->ai_addrlen == sizeof (addr))
1084 { 1084 {
1085 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; 1085 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
1086 memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr)); 1086 addr.sin_addr = in_a->sin_addr;
1087 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) 1087 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
1088 break; 1088 break;
1089 } 1089 }
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 40397536fad..59cab61aa29 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -42,9 +42,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42#include <time.h> 42#include <time.h>
43#include <pwd.h> 43#include <pwd.h>
44#include <ctype.h> 44#include <ctype.h>
45#ifdef HAVE_FCNTL_H
46#include <fcntl.h> 45#include <fcntl.h>
47#endif
48#include <sys/stat.h> 46#include <sys/stat.h>
49#include <getopt.h> 47#include <getopt.h>
50 48