Commit graph

284 commits

Author SHA1 Message Date
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
Karoly Lorentey
251bc578cc Merged from emacs@sv.gnu.org
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-351
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-352
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-353
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-354
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-355
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-356
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-357
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-358
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-359
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-360
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-361
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-362
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-363
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-364
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-365
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-366
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-367
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-368
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-369
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-370
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-115
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-116
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-117
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-118
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-119
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-120
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-573
2006-07-29 09:59:12 +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
Karoly Lorentey
6bcc8ec7eb Fix OpenBSD compilation some more. (Fix by Han Boetes.)
* lib-src/emacsclient.c: Copy IS_*_SEP definitions from lisp.h.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-541
2006-04-01 12:54:10 +00:00
Karoly Lorentey
dc4a4a1433 Fix compilation error on OpenBSD. (Reported by Han Boetes.)
* lib-src/emacsclient.c: Include sys/stat.h.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-540
2006-03-28 17:28:17 +00:00
Karoly Lorentey
2828d5f9d4 Set `default-directory' in *scratch* to the current directory of emacsclient.
* lib-src/emacsclient.c (get_current_dir_name): New function, copied here
  from sysdep.c.
  (main): Use it to send over the current directory.

* lisp/server.el (server-process-filter): Accept `-dir' command.  Set
  `default-directory' of the *scratch* buffer on connect, if applicable.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-539
2006-03-26 16:34:35 +00:00
Karoly Lorentey
1913a2b35d Merged from emacs@sv.gnu.org
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-49
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-50
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-51
   Make constrain-to-field notice overlays

 * emacs@sv.gnu.org/emacs--devo--0--patch-52
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-53
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-54
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-55
   Merge from erc--emacs--0

 * emacs@sv.gnu.org/emacs--devo--0--patch-56
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-57
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-58
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-59
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-60
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-61
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-62
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-63
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-64
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-65
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-66
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-67
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-68
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-69
   rcirc: Add flexible response formatting; Add nick abbrevs

 * emacs@sv.gnu.org/emacs--devo--0--patch-70
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-71
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-72
   Update from CVS: man/dired.texi (Tumme): More tumme documentation.

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-18
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-19
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-20
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-21
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-22
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-23
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-24
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-25
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-26
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-27
   Update from CVS: lisp/gnus.el: Remove bogus comment.

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-28
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-29
   Add sendmail.el and smptmail.el from Emacs tree to contrib/

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-508
2006-02-12 00:15:44 +00:00
Thien-Thi Nguyen
273dc16aaf Update years in copyright notice; nfc. 2006-02-06 11:28:28 +00:00
Karoly Lorentey
59e085e04d Store client's environment in terminal parameters, not server parameters.
* lisp/loadup.el: Don't load server.
* lisp/ldefs-boot.el: Update.

* lib-src/emacsclient.c (main): Send environment only when a new display
  is created.

* lisp/server.el (server-save-buffers-kill-display): Add autoload
  cookie.  Move stuff not specific to server into `save-buffers-kill-display'.
* lisp/files.el (save-buffers-kill-display): New function.
  (ctl-x-map): Bind it to C-x C-c.

* lisp/frame.el (terminal-getenv): New function.
* lisp/international/mule-cmds.el (set-locale-environment): Use it.

* lisp/frame.el (with-terminal-environment): New macro.

* lisp/server.el (server-getenv, server-with-client-environment): Remove.
  (server-getenv-from, server-with-environment): New functions.
  (server-process-filter): Change syntax of environment
  variables.  Put environment into terminal parameters, not client parameters.

* lisp/term/rxvt.el: Don't require server.
  (rxvt-set-background-mode): Use terminal-getenv, not server-getenv.
* lisp/term/x-win.el (x-initialize-window-system): Ditto.
* lisp/term/xterm.el (terminal-init-xterm): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-443
2005-11-19 19:17:56 +00:00
Karoly Lorentey
b8ccaf6fb3 Make `emacsclient -n <filename>' open new X frames when possible. (Reported by Bas Kok.)
* lib-src/emacsclient.c (decode_options): Change --no-wait to imply
  --current-frame only on ttys and only when there are extra arguments.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-411
2005-09-11 03:49:47 +00:00
Karoly Lorentey
92071250fa Fix `emacsclient -ne '(+ 2 2)'' (reported by Han Boetes), and clean up some corner cases in Emacs server.
* lib-src/emacsclient.c (decode_options): Make --no-wait imply
  --current-frame, except when it is the only option given.  Make sure no
  frame is opened when --current-frame is set.  
  (main): Pass --current-frame to server.el.

* lisp/server.el (server-process-filter): Handle -current-frame command.
  Don't create frames when it is given.  Don't bind X frames to the
  client when we are in -no-wait mode.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-407
2005-09-10 23:51:08 +00:00
Karoly Lorentey
fbf3497344 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
   tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
   Add CVS metadata files.

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
   Update from CVS.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
2005-09-04 03:48:17 +00:00
Thien-Thi Nguyen
92b47a4a99 Update years in copyright notice; nfc. 2005-08-07 10:56:27 +00:00
Karoly Lorentey
c6c53c3e65 Fix broken emacsclient resume on Solaris (by Dan Nicolaescu).
* lib-src/emacsclient.c (handle_sigcont): Reestablish signal handler. (Dan Nicolaescu)

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-388
2005-07-13 16:15:50 +00:00
Karoly Lorentey
d5dc920668 Merged from miles@gnu.org--gnu-2005 (patch 469)
Patches applied:

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-469
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-372
2005-07-05 22:22:24 +00:00
Lute Kamstra
364c38d3af Update FSF's address. 2005-07-04 15:47:28 +00:00
Karoly Lorentey
392711ede1 Merged from miles@gnu.org--gnu-2005 (patch 39-44, 184-191)
Patches applied:

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-184
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-185
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-186
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-187
   Merge from gnus--rel--5.10

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-188
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-189
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-190
   Update from CVS

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-191
   Update from CVS

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-39
   Merge from emacs--cvs-trunk--0

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-40
   Update from CVS

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-41
   Update from CVS

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-42
   Update from CVS

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-43
   Update from CVS

 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-44
   Merge from emacs--cvs-trunk--0

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-311
2005-03-19 17:55:13 +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
Karoly Lorentey
6afdd33556 Prevent emacsclient errors when Emacs is compiled without X support.
* lisp/frame.el (make-frame-on-display): Protect condition on
  x-initialized when x-win.el is not loaded.

* lib-src/emacsclient.c (main): Handle -window-system-unsupported
  command.  Doc update.

* lisp/server.el (server-process-filter): Don't try to create an X frame
  when Emacs does not support it.  Improve logging.

* lisp/server.el (server-send-string): New function.
  (server-handle-suspend-tty, server-process-filter): Use it.

* lisp/server.el (server-process-filter, server-unquote-arg)
  (server-quote-arg): Doc updates.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-286
2005-02-04 13:56:51 +00:00
Richard M. Stallman
cf0fad845a (quote_file_name): Pass COPY thru %s to output it. 2004-07-17 14:27:24 +00:00
Karoly Lorentey
fc2040c034 Fix --no-wait in emacsclient (reported by Dan Nicolaescu).
* lib-src/emacsclient.c (main): Don't exit prematurely on --no-wait,
  let Emacs close the connection for us.

* lisp/server.el (server-visit-files): Don't set client-record when nowait.



git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-205
2004-07-03 17:53:57 +00:00
Karoly Lorentey
ab4b17bed7 Merged in changes from CVS trunk.
Patches applied:

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-290
   Update from CVS


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-161
2004-05-11 09:11:36 +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
Karoly Lorentey
6087973173 In emacsclient, protect the xmitted string from fprintf expansion (Dan Nicolaescu).
lib-src/emacsclient.c (quote_argument): Protect the string from
fprintf expansion (submitted by Dan Nicolaescu).

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-147
2004-04-19 12:03:00 +00:00
Karoly Lorentey
9002956fd8 Another server.el overhaul.
lib-src/emacsclient.c (xstrdup): New function.
(quote_argument): Use xmalloc, not malloc.
(main): Send environment variable values.

lisp/server.el (server-clients): Documentation update.
(server-ttys, server-frames): Removed.
(server-client, server-client-get, server-client-set)
(server-clients-with, server-add-client)
(server-delete-client): New functions.
(server-sentinel, server-handle-suspend-tty)
(server-handle-delete-tty, server-handle-delete-frame)
(server-start, server-process-filter, server-visit-files)
(server-buffer-done, server-kill-buffer-query-function)
(server-kill-emacs-query-function, server-switch-buffer): Use them.
(server-log): Handle both kinds of client references.
(server-start): Set up all hooks here.
(server-process-filter): Cleanup.  Store version in client.
Handle -env commands for passing environment variable values.
(server-buffer-done): Don't close clients that were created bufferless.
(server-switch-buffer): Only look at frameless clients.
Don't switch away from current buffer if there is no next-buffer.
(server-unload-hook): Remove frame/tty hooks, too.

lisp/server.el (server-quote-arg, server-unquote-arg)
(server-process-filter, server-kill-buffer-query-function)
(server-kill-emacs-query-function): Doc update.
(server-buffer-done, server-switch-buffer): Use buffer-live-p, not
buffer-name.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-143
2004-04-18 01:34:11 +00:00
Karoly Lorentey
0b0d3e0bce Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables.  Prepend `-eval' or
'-file' to each argument.  Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code.  Support the -suspend command.
Cleaned up newline handling.

lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.

lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.

lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.

src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.

src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.

src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.

src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
Karoly Lorentey
2fc0cf2aef Make emacsclient refuse to create a frame inside an Emacs term buffer.
lib-src/emacsclient.c (main): Exit with failure if the terminal type
is `eterm' (Emacs term buffer).

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-104
2004-02-27 14:10:47 +00:00
Karoly Lorentey
8689463ae0 Fix a crash in emacsclient when DISPLAY is unset.
lib-src/emacsclient.c (decode_options): Don't call strlen on a null
pointer. Reported by Ami Fishman.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-92
2004-02-20 23:54:53 +00:00
Karoly Lorentey
e5299d8d65 Changed emacsclient to open new frames by default.
lib-src/emacsclient.c (decode_options): Handle the case when $DISPLAY
is an empty string.  Set window_system or tty to one by default,
depending on if there is a valid display.
(longopts, decode_options, print_help_and_exit): Removed -w, added -c.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-85
2004-02-20 01:46:26 +00:00
Karoly Lorentey
a9298135d8 Verify the version of Emacsclient.
lib-src/emacsclient.c (main): Send the version number of emacsclient
to the Emacs process, and exit with error if Emacs does not accept it.

lisp/server.el (server-with-errors-reported): Removed.
(server-process-filter): Cleaned up error handling.
Compare the version of emacsclient with emacs-version; 
signal an error if they do not match.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-84
2004-02-20 01:22:10 +00:00
Karoly Lorentey
77134727c9 Added -w option to emacsclient for opening a new X frame.
lib-src/emacsclient.c (window_system): New variable.
(frame): Renamed to tty for consistency with the option name.
(longopts, print_help_and_exit): Added -w option. (Suggested by Ami
Fischman <ami at fischman dot org>.
(decode_options): Initialize display to $DISPLAY.  Handle -w option.
(main): Implement the -w option.  Changed to a more elaborate protocol
between Emacs and emacsclient, in preparation to suspend support.

lisp/server.el (server-frames): New variable.
(server-handle-delete-frame): New function.
(server-start): Add it to delete-frame-functions.
(server-select-display): Don't make the new frame invisible.
(server-with-errors-reported): New macro for brevity.
(server-process-filter): Implement the "-window-system" command.
Use server-with-errors-reported.  Fixed regexp for +line:column syntax.
Use the new protocol.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-83
2004-02-19 23:55:51 +00:00
Karoly Lorentey
e581a46687 Merged in changes from CVS HEAD
Patches applied:

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-71
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-72
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-73
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-74
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-75
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-76
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-77
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-78
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-79
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-80
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-81
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-82
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-83
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-84
   Add lisp/emacs-lisp/macroexp.el

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-85
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-86
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-87
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-88
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-89
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-90
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-91
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-92
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-93
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-94
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-95
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-96
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-97
   Update from CVS


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-77
2004-02-17 01:52:25 +00:00
Stefan Monnier
b6b6d6d201 (decode_options): Fix handling of alternate editor. 2004-02-05 00:02:04 +00:00
Karoly Lorentey
d3a6748c5b Merged in changes from CVS HEAD
Patches applied:

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-57
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-58
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-59
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-60
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-61
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-62
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-63
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-64
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-65
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-66
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-67
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-68
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-69
   Update from CVS


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-71
2004-02-02 19:19:08 +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
Karoly Lorentey
465fc071a1 Merged in changes from CVS HEAD
Patches applied:

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-53
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-54
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-55
   Update from CVS

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-56
   Update from CVS


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-70
2004-01-26 21:22:42 +00:00
Karoly Lorentey
da8e11156a Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.

src/buffer.c (Vmode_line_format): Removed %T documentation.

src/xdisp.c (decode_mode_spec): Removed %T processing.

lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.

src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.

src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.

src/process.c (add_keyboard_wait_descriptor): Added docs.

src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.

src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00