1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

99 Commits

Author SHA1 Message Date
Juanma Barranquero
4472aef4c3 (w32_execvp): New function; wrapper for `execvp'.
(execvp) [WINDOWSNT]: Redefine to `w32_execvp'.
(fail): Remove Windows-specific fix (subsumed in w32_execvp).
2006-12-15 14:53:44 +00:00
Juanma Barranquero
c66648e0c7 (emacs_pid): New variable.
(message): Remove leftover code.
(get_server_config): Set emacs_pid.  Don't allow Emacs to grab the focus yet;
emacsclient can still display an informational message before sending requests
to Emacs.
(main): Allow Emacs to grab the focus.  Simplify message() call.
2006-11-30 22:49:38 +00:00
Juanma Barranquero
9219db75bf (message): Make sure the message is properly written even if it contains printf
escapes, and flush the result.
(set_tcp_socket): Make the message for non-local connections informational
rather than an error.
2006-11-30 21:58:53 +00:00
Jason Rumney
5f7a487486 (file_name_absolute_p) [WINDOWSNT]: Use isalpha(). 2006-11-25 00:32:40 +00:00
Eli Zaretskii
cb0297bb1a (file_name_absolute_p) [WINDOWSNT]: Support absolute file names with forward
slashes.
2006-11-24 20:59:01 +00:00
Juanma Barranquero
db9cd97ad4 Space/tab mixup. 2006-11-24 10:31:26 +00:00
Juanma Barranquero
30aa95cea6 (print_help_and_exit): Tweak message contents and tabs/spaces
to improve alignment in message boxes.
2006-11-23 01:51:38 +00:00
Juanma Barranquero
42073bfb9e Include <stdarg.h>.
[WINDOWSNT]: Include <windows.h>.
(w32_check_console_app): New function.
(message): New function.
(decode_options, print_help_and_exit, fail, main, initialize_sockets,
get_server_config, set_tcp_socket, set_local_socket, set_socket):
Use message().
2006-11-22 14:19:35 +00:00
Jason Rumney
32dd92836c Let config.h define HAVE_SOCKETS and HAVE_INET_SOCKETS. 2006-11-13 11:32:11 +00:00
Juanma Barranquero
bc28de715d [WINDOWSNT]: Undef _WINSOCKAPI_ and _WINSOCK_H. 2006-11-13 10:59:04 +00:00
Juanma Barranquero
ed4a37304a [!WINDOWSNT]: Include <sys/types.h>. 2006-11-10 15:44:40 +00:00
Juanma Barranquero
2dc07a1273 (get_server_config): Declare set_fg as FARPROC to avoid a compiler warning. 2006-11-08 01:06:45 +00:00
Juanma Barranquero
88b46d8431 (get_server_config) [WINDOWSNT]: Search the server file on APPDATA
if it doesn't exist on HOME, even if HOME is defined.
2006-11-07 11:23:12 +00:00
Juanma Barranquero
434a6c5d78 (get_server_config): Extract also the Emacs pid from the server file.
On Windows, try to force the Emacs frame to the foreground.
2006-11-07 10:43:45 +00:00
Juanma Barranquero
b03d27bdc1 (longopts) [! NO_SOCKETS_IN_FILE_SYSTEM]: Don't show option --socket-name.
(decode_options): Don't get EMACS_SERVER_FILE here, it could override command
line options.
(decode_options) [! NO_SOCKETS_IN_FILE_SYSTEM]: Don't parse "-s" option.
(fail): Don't check for missing arguments, it is now done in set_socket.
(file_name_absolute_p): New function (loosely based on the one in fileio.c).
(initialize_sockets): Don't check for duplicate loading of Winsock.
(get_server_config): Only try relative paths in the default directory locations.
(set_tcp_socket): Don't call INITIALIZE().  Warn when connecting to a remote
server.
(set_socket): Call INITIALIZE().  Search explicit command-line arguments, then
environment variable EMACS_SERVER_FILE, then implicit socket paths, before
trying the alternate editor.
(main): Use file_name_absolute_p.
2006-11-06 12:41:49 +00:00
Juanma Barranquero
5796dab79d (initialize_sockets): Don't initialize Winsock more than once. 2006-11-03 16:24:53 +00:00
Juanma Barranquero
1e7823d061 [WINDOWSNT]: Define HAVE_INET_SOCKETS.
[!WINDOWSNT]: Include <netinet/in.h> if available.
[HAVE_SOCKETS]: Also require HAVE_INET_SOCKETS.
(IOCTL, IOCTL_BOOL_ARG): Remove.
(set_tcp_socket): Don't set the socket in blocking mode.  Remove c_arg.
2006-11-02 09:55:33 +00:00
Juanma Barranquero
b73ea44bb7 [WINDOWSNT]: Force the first argv passed to execvp to point to alternate_editor
(otherwise .BAT scripts can't run).
2006-11-01 19:26:14 +00:00
Juanma Barranquero
411b80a566 [WINDOWSNT]: Include <malloc.h> and <stdlib.h>.
(close_winsock): Declare as __cdecl.
2006-10-31 16:40:11 +00:00
Juanma Barranquero
95d0feaa4a [!WINDOWSNT]: Include <fcntl.h> if available.
(set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO to set the
socket in non-blocking mode.
2006-10-31 13:52:32 +00:00
Juanma Barranquero
e35fc9628c Fixes to emacsclient.c for GNU/Linux.
[!WINDOWSNT] <top level>: Include <netinet/in.h> and <sys/ioctl.h>.
(INVALID_SOCKET): Define.
(initialize_sockets): Put #endif at the right place.
(set_local_socket): Use progname, not argv[0].
2006-10-31 09:08:24 +00:00
Juanma Barranquero
aa0b693297 Add support for TCP sockets.
(SEND_STRING, SEND_QUOTED, HSOCKET, CLOSE_SOCKET, IOCTL, INITIALIZE): New
macros.
(IOCTL_BOOL_ARG): New typedef.
(server_file): New global variable.
(longopts): New option --server-file.
(decode_options): Process new option --server-file and environment variable
EMACS_SERVER_FILE.
(print_help_and_exit): Document new option.
(fail): If no connection available and no alternate editor, suggest using
options to make them explicit.
(AUTH_KEY_LENGTH, SEND_BUFFER_SIZE): New constants.
(send_buffer, sblen): New variables.
(send_to_emacs): New function to buffer output and send it with send().
(quote_file_name): Use SEND_STRING.
(close_winsock, initialize_sockets): New functions to load and unload Winsock.
(get_server_config, set_tcp_socket): New functions to create and set up TCP
sockets.
(set_local_socket): New function to create and set up Unix socket (code moved
from previous implementation).
(set_socket): New function to chose between TCP and Unix sockets.
(main): Use SEND_STRING and SEND_QUOTED.  Most code moved to set_local_socket.
Use set_socket.  Get answers from server.el with recv(), not file stream
functions.
2006-10-31 00:21:19 +00:00
Dan Nicolaescu
2381d38d0a * ebrowse.c (usage, version): Mark as NO_RETURN.
* emacsclient.c (print_help_and_exit): Likewise.

* xterm.c (x_connection_closed, x_error_quitter): Mark as NO_RETURN.

* textprop.c (text_read_only): Likewise.

* lread.c (end_of_file_error): Likewise.

* lisp.h (circular_list_error, memory_full, buffer_memory_full):
Likewise.

* eval.c (unwind_to_catch): Likewise.

* buffer.h (buffer_slot_type_mismatch): Likewise.
2006-07-18 16:33:45 +00:00
Thien-Thi Nguyen
273dc16aaf Update years in copyright notice; nfc. 2006-02-06 11:28:28 +00:00
Thien-Thi Nguyen
92b47a4a99 Update years in copyright notice; nfc. 2005-08-07 10:56:27 +00:00
Lute Kamstra
364c38d3af Update FSF's address. 2005-07-04 15:47:28 +00:00
Jan Djärv
5b9562c3df * emacsclient.c: Avoid expansion of getcwd when defined as a macro. 2005-03-18 20:44:50 +00:00
Richard M. Stallman
cf0fad845a (quote_file_name): Pass COPY thru %s to output it. 2004-07-17 14:27:24 +00:00
Thien-Thi Nguyen
65396510c3 Throughout, replace 0 destined for exit' arg with EXIT_SUCCESS'.
Likewise, replace 1 with `EXIT_FAILURE'.
(main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
2004-05-08 15:26:33 +00:00
Stefan Monnier
b6b6d6d201 (decode_options): Fix handling of alternate editor. 2004-02-05 00:02:04 +00:00
Stefan Monnier
0734b0d08d (main): Don't use the hostname in the socket name.
Look for relative socket names in the /tmp dir rather than in cwd.
2004-01-27 23:07:13 +00:00
Richard M. Stallman
293f9f2a99 (main): Restore errno from saved_errno,
so the error message comes from socket_status.
2004-01-24 21:57:57 +00:00
Stefan Monnier
5c9659d3f6 (main): Stop if socket name too long.
Only try su-fallback if the socket name was not explicit.
Check socket name length in su-fallback case as well.
2004-01-20 23:25:33 +00:00
Andreas Schwab
152b6e830f (main): Save errno from socket_status. 2004-01-08 12:20:43 +00:00
Andreas Schwab
e822882420 (main): Fix socket name when using another user. 2004-01-04 16:42:06 +00:00
Richard M. Stallman
a4cf2096d7 Comment change. 2003-10-13 19:41:26 +00:00
Eli Zaretskii
872093579a (quote_file_name): Print the result instead of
returning it.  Fix the return type accordingly.
(main): Under --eval, don't fail if left with additional
arguments after decoding options.  Quote file names.
2003-09-28 08:24:56 +00:00
Richard M. Stallman
3db926beda Comment change. 2003-09-19 14:27:47 +00:00
Richard M. Stallman
254107e497 (socket_name): New variable.
(longopts, decode_options, print_help_and_exit):
Handle --socket-name argument.

(main): Use socket_name.
2003-09-12 00:48:03 +00:00
Miles Bader
ab5796a9f9 Add arch taglines 2003-09-01 15:45:59 +00:00
Juanma Barranquero
bb5618fe38 (main): Fix having macros in a printf statement. 2003-07-28 22:10:30 +00:00
Stefan Monnier
caa4df2b5d (main): Use new safe location for socket. 2003-04-12 19:03:08 +00:00
Juanma Barranquero
20c396e841 (print_help_and_exit): Print to stdout. Exit successfully. Added some blank
lines for readability.
(decode_options): Don't call print_help_and_exit in default case. Print version
information to stdout.
(main): Don't call print_help_and_exit.
2003-03-12 21:36:29 +00:00
Stephen Eglen
45adde3246 (main): Tell user how to start server within Emacs if socket could not
be found.
2002-12-02 20:57:42 +00:00
Richard M. Stallman
38732dbaa3 (main): Test HAVE_GETCWD rather than BSD_SYSTEM. 2002-12-02 16:14:35 +00:00
Markus Rost
15dab115ed Remove reference to SERVER_HOME_DIR completely. 2002-10-01 00:47:12 +00:00
Stefan Monnier
3ecdcd5905 (main): Always use /tmp and non-qualified hostname. 2002-09-27 22:07:38 +00:00
Stefan Monnier
30be2360f8 Remove SYSV support.
(eval, display): New vars.
(longopts): Add --eval and --display.
(decode_options): Add -e and -d processing.
(print_help_and_exit): Update the usage string.
(main): Add support for --eval and --display.
2002-09-27 18:21:44 +00:00
Stefan Monnier
3cf8c6aa01 (quote_file_name): Quote \n.
(main): Print a final \n when needed.
2002-09-18 01:44:54 +00:00
Pavel Janík
2f8fe2f420 Include <config.h>. 2001-12-29 22:25:06 +00:00