(server-start): Don't remove the file of the previous process, but
instead clear out the place for the new file.
(server-start): Set the :auth-key property.
(server-process-filter): Use the :auth-key property.
(server-process-filter): When authentication fails, send error message to
client. Wrap `process-send-region' in `ignore-errors' instead of
`condition-case', and remove misleading comment.
(server-use-tcp, server-host, server-auth-dir): New options.
(server-auth-key): New variable.
(server-ensure-safe-dir): Create nonexistent parent dirs. Ignore Unix-style
file modes on Windows.
(server-start): Crete a TCP or Unix socket according to the value of
`server-use-tcp'. For TCP sockets, create the id/auth file in `server-auth-dir'
directory.
(server-process-filter): Delete process if authentication fails (which never
happens for Unix sockets).
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-413
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-414
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-415
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-416
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-417
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-418
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-419
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-420
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-421
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-422
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-423
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-424
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-425
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-426
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-427
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-428
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-429
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-430
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-431
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-432
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-433
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-434
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-435
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-436
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-437
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-438
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-439
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-440
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-441
lisp/url/url-methods.el: Fix format error when http_proxy is empty string
* emacs@sv.gnu.org/emacs--devo--0--patch-442
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-443
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-444
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-445
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-446
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-447
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-448
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-449
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-450
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-451
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-452
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-453
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-454
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-455
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-456
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-457
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-458
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-459
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-460
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-461
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-462
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-463
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-464
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-465
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-466
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-467
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-468
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-469
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-470
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-471
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-472
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-473
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-128
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-129
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-130
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-131
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-132
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-133
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-134
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-135
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-136
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-137
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-138
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-139
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-140
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-141
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-142
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-143
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-144
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-145
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-146
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-147
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-148
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-149
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
* 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
* lisp/server.el (server-buffer-clients): Doc update.
(server-delete-client): Handle quits in kill-buffer. Don't kill modified
buffers. Add extra logging.
(server-visit-files): Don't set `server-existing-buffer' if the buffer
already has other clients.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-517
* lisp/server.el (server-process-filter): Switch to *scratch* immediately
after creating the frame, before evaluating any -evals.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-510
* lisp/server.el (server-process-filter): Protect `display-splash-screen'
call in a condition-case. Explain why.
* src/callint.c (Fcall_interactively): Update call to
`temporarily_switch_to_single_kboard'.
* src/fns.c (Fy_or_n_p): Ditto.
* src/frame.c (Fdelete_frame): Remove unused variable `count'.
* src/keyboard.c (wrong_kboard_jmpbuf): Remove global variable.
* src/keyboard.c (read_char): Add wrong_kboard_jmpbuf parameter to allow
for recursive calls. Update longjmp invocations. Remember the
original current_kboard, and longjmp to `wrong_kboard_jmpbuf' when a
filter, timer or sentinel changes it. Comment out unnecessary calls to
`record_single_kboard_state' and `any_kboard_state'. Update recursive
calls.
* src/keyboard.c (read_key_sequence): Add `wrong_kboard_jmpbuf' local
variable. Update setjmp and read_char calls. Abort if
interrupted_kboard died in read_char.
* src/keyboard.c (any_kboard_state, single_kboard_state)
(record_single_kboard_state): Comment out obsolete functions.
(push_frame_kboard): Remove function.
(pop_kboard): Switch out of single_kboard mode if the
kboard has been deleted.
(temporarily_switch_to_single_kboard): Change first
parameter to a frame pointer. Throw an error when caller wants to
change kboards while in single_kboard mode.
(restore_kboard_configuration): Abort if pop_kboard changed
the kboard in single_kboard mode.
(Frecursive_edit): Switch to single_kboard mode only in
nested command loops.
(cmd_error, command_loop, command_loop_1, timer_check):
Comment out unnecessary call to `any_kboard_state' and
`record_single_kboard_state'.
* src/keyboard.c (delete_kboard): Exit single_kboard mode if we have just
deleted that kboard.
* src/keyboard.c (interrupt_signal): Use `Fkill_emacs' to exit Emacs, not
`fatal_error_signal'.
* src/keyboard.h (read_char, single_kboard_state)
(record_single_kboard_state): Remove.
(temporarily_switch_to_single_kboard): Update.
* src/lread.c: Include setjmp.h. Update declaration of `read_char'.
(read_filtered_event): Call `read_char' with a local
`wrong_kboard_jmpbuf'.
* src/minibuf.c (read_minibuf): Update call to
`temporarily_switch_to_single_kboard'.
* src/termchar.h (tty_display_info): Rename `previous_terminal_frame'
member to `previous_frame'.
* src/xdisp.c (redisplay_internal): Update references to
`previous_terminal_frame'.
(display_mode_line, Fformat_mode_line): Replace calls to
`push_frame_kboard' with `push_kboard'.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-489
* lisp/frame.el (make-frame): Also inherit 'client parameter. Don't
override explicitly specified values with inherited ones.
* server.el (server-delete-client): Delete frames after deleting the tty.
Clear 'client parameter before deleting a frame.
* server.el (server-handle-delete-frame): Delete the client if this was
its last frame.
* startup.el (fancy-splash-default-action): Fix typo in comment.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-484
* lisp/server.el (server-process-filter): Don't display the splash screen
when no frame was created.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-479
* lisp/server.el (server-process-filter): Show the Emacs splash screen
and startup echo area message. Display the *scratch* buffer by
default.
* lisp/startup.el (fancy-splash-screens): Restore previous buffer, even
if it's *scratch*.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-473
* src/callproc.c (child_setup, getenv_internal, Fgetenv_internal):
Store the local environment in a frame (not terminal) parameter.
Update doc strings.
(syms_of_callproc): Update doc strings.
(Qenvironment): Moved to frame.c.
* lisp/env.el (read-envvar-name, setenv, getenv, environment): Use frame
parameters to store the local environment, not terminal parameters.
* server.el (server-process-filter): Store the local environment in a
frame (not terminal) parameter. Do not try to decode environment
strings.
* lisp/frame.el (make-frame): Set up the 'environment frame parameter,
when needed.
* src/frame.c (Qenvironment): Move here from callproc.c.
(Fdelete_frame): Don't allow other frames to refer to a deleted frame
in their 'environment parameter.
(Fframe_with_environment): New function.
(syms_of_frame): Defsubr it. Initialize and staticpro Qenvironment.
* frame.h (Qenvironment): Declare.
* lisp.h (Fframe_with_environment): EXFUN it.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-467
* 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
* lisp/server.el (server-process-filter): Use a dummy client with --no-wait's X frames.
(server-save-buffers-kill-display): Explicitly delete frame after
deleting its client, in case it was a dummy.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-412
* lisp/server.el (server-process-filter): In `-position LINE' handler,
don't ruin the request string until the line number is extracted. Log
opened files.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-408
* 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
* lisp/server.el: Use `device' instead of `display' or `display-id' in
variable and client parameter names.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-383
* lisp/international/mule-cmds.el (set-locale-environment): Use
server-getenv, not getenv.
* lisp/server.el (server-handle-delete-frame): Add note on possible race
condition.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-374
* lisp/server.el (server-process-filter): When processing -position
command, don't change the request string until the parameters are
extracted.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-297
* lisp/server.el (server-kill-emacs-query-function): Fix typo in docs.
(server-save-buffers-kill-display): If emacsclient was started with a
list of filenames to edit, then offer to save only these buffers.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-291
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-79
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-80
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-81
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-83
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-84
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-85
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-86
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-87
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-88
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-89
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-90
Update from CVS: man/calc.texi: Add macro for LaTeX for info output.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-12
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-13
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-290
* 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
* lisp/server.el (server-with-client-environment): New macro.
(server-process-filter): Temporarily set ncurses-related environment
variables to those of the client while creating a new tty frame.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-257
* lisp/server.el: Doc updates.
(server-select-display): Remove (unused).
(server-handle-suspend-tty): Kill the client in case of errors from
process-send-string.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-255
* lisp/server.el ("\C-x#"): Fix typo. (Thanks Han Boetes, Ted Morse and
Ami Fischman.)
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-235
* lisp/server.el (server-process-filter): Select buffers opened by
nowait clients, don't leave them buried under others. (Reported by
Dan Nicolaescu.)
(server-visit-files): Return list of buffers created. Update doc.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-212
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
* 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
* lisp/server.el (server-start): Ask before restarting if the old server
still has clients. Added feedback messages.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-195
lisp/server.el (server-process-filter): Add the client parameter to
the initialization parameters of new frames.
(server-getenv): Use the 'client frame parameter and not
server-clients-with to get the client; server-getenv is called during
frame initialization. (Dan Nicolaescu)
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-179
lisp/international/mule-cmds.el (set-locale-translation-file-name)
(get-locale-real-name, get-locale-coding-system)
(configure-display-for-locale): New functions.
(set-locale-environment): Factored contents into separate functions.
lisp/server.el (server-process-filter): Call
configure-display-for-locale after creating a new terminal frame.
lisp/startup.el (command-line): Call set-locale-translation-file-name.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-171
lisp/server.el (server-delete-client): Added noframe parameter.
(server-handle-delete-frame): Use it.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-149
lisp/server.el (server-delete-client): Check that the buffer is live
before switching to it. Also, check that the tty display still has
live buffers before deleting it.
(server-handle-delete-frame): Don't do anything if the frame was on a
tty device (reported by Dan Nicolaescu).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-148
lisp/server.el (server-process-filter): Work around make-frame
frame parameter bogosity by using modify-frame-parameters.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-145
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
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
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
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
lisp/bindings.el (mode-line-frame-identification): Use %T, not %F.
lisp/faces.el (x-create-frame-with-faces): Added
frame-creation-function parameter.
(tty-create-frame-with-faces): Ditto.
lisp/frame.el (frame-creation-function): Make it frame-local.
(select-frame-set-input-focus): Use the window-system function, not
the variable.
lisp/server.el (server-handle-delete-tty): Make sure the client
process is removed from server-clients after the delete-process call.
It seems that the sentinel is not called. Added docs.
(server-process-filter): Immediately add the client to server-clients
when a new termcap frame is created. Fixed a case of `not' called
with two parameters. Ignore errors while sending the evaluation
result back to the client.
(server-kill-buffer-query-function): Don't ask the user if the server
process is already dead.
lisp/term/x-win.el: Don't change mode-line-frame-identification.
src/buffer.c (syms_of_buffer): Added %T to the docs of mode-line-format.
src/dispnew.c (init_display): Increment the reference count of the new
termcap display.
src/frame.c (make_terminal_frame): Set the old top frame's visibility
to `obscured'.
(Fmake_terminal_frame): Look at the current termcap display's name,
not just the similar frame parameter. Try to get the type from the
current display first, and only then from Vdefault_frame_alist.
src/keyboard.c (handle_interrupt): New function to separate the signal
handling from C-g processing.
(interrupt_signal): Call handle_interrupt to do the real work.
(kbd_buffer_store_event): Use handle_interrupt instead of interrupt_signal.
(cmd_error_internal): Use FRAME_INITIAL_P instead of ugly hacks.
src/termhooks.h (initial_display): New declaration.
src/xdisp.c (decode_mode_spec): Added '%T' (termcap-only frame name).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-49
lib-src/emacsclient.c: Removed tty proxy kludge. Emacs should just
use the same terminal as emacsclient.
(ec_get_tty, ec_set_tty, master, pty_name, old_tty, tty, old_tty_valid)
(tty_erase_char, quit_char, flow_control, meta_key, _sobuf, init_tty)
(window_change, reset_tty, init_pty, copy_from_to)
(pty_conversation): Removed.
(window_change_signal): Just forward the signal to Emacs, don't do
anything else.
(init_signals): Don't set handlers for SIGHUP & SIGINT.
(strprefix): New function.
(main): Don't touch the terminal, simply tell its name to Emacs.
lisp/server.el (server-frames): Changed name and semantics to server-ttys.
(server-tty-live-p): New function.
(server-sentinel): Delete the whole tty, not just the frame.
(server-handle-delete-frame): Removed.
(server-handle-delete-tty): New function. Close the client connection if
the tty is deleted.
(server-start): Clean up server-ttys, not server-frames. Set up
delete-tty-after-functions.
(server-process-filter): Set up server-ttys, not server-frames.
Updated protocol for sending our pid to emacsclient.
(server-buffer-done): Don't delete the client process directly, delete
the tty instead, and rely on the delete-tty hook to close the
connection. Otherwise the terminal could be left in a bad state.
src/cm.c (cmputc): Don't abort on write errors.
src/indent.c: #include <stdio.h>, for termchar.h.
src/window.c: Ditto.
src/xfaces.c: Ditto.
src/sysdep.c (init_sigio, reset_sigio, request_sigio)[!SIGIO]
(unrequest_sigio)[!SIGIO]: If SIGIO is not supported, don't do
anything. (For Solaris.)
(init_sys_modes): Moved tty_set_terminal_modes call back to here,
disable window system check.
(reset_sys_modes): Reset the terminal even if X is running.
src/term.c (Vdelete_tty_after_functions): New variable.
(syms_of_term): Initialize it.
(Fdelete_tty): Updated docs.
(delete_tty): Run delete-tty-after-functions.
(term_init): Removed tty_set_terminal_modes call.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-35
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
src/dispextern.h (get_tty_size, tabs_safe_p, init_baud_rate): Update
prototypes.
src/dispnew.c (window_change_signal): Update call to get_tty_size.
src/frame.c (Fmake_terminal_frame): Ditto.
src/keyboard.c (Fsuspend_emacs): Ditto.
src/sysdep.c: Eliminate tty_outputs, wherever possible. (The
exceptions are init_sys_modes and reset_sys_modes, which need access
to tty-local parameters).
(init_baud_rate): Change tty_output parameter to a simple file descriptor.
(narrow_foreground_group, widen_foreground_group): Ditto.
(tabs_safe_p, get_tty_size): Ditto.
(init_sys_modes): Update narrow_foreground_group invocation.
(reset_sys_modes): Update widen_foreground_group invocation.
(request_sigio)[!FASYNC && STRIDE]: Fix function signature.
src/term.c (delete_tty): Only close output file handle if it is
different from input. Re-enable freeing of Wcm.
(term_init): Update get_tty_size, tabs_safe_p and init_baud_rate
invocations.
lib-src/emacsclient.c (here): Renamed to frame.
(longopts): Change --here to --frame. The -h short option may be
confused with --help.
(decode_options, print_help_and_exit): Update to reflect above changes.
(main): Ditto.
lisp/server.el (server-start): Fix frame-live-p call syntax.
(server-process-filter): Handle 'emacsclient -f' without file
arguments. Don't return any values to emacsclient when 'emacsclient
-f -e'.
(server-switch-buffer): Prevent infinite recursion when there are no
files to edit.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-27
lisp/server.el (server-start): Delete any remaining opened frames of
the previous server.
(server-sentinel, server-process-filter): Force deleting the frame.
(server-buffer-done): Ditto.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-25
lisp/server.el (server-sentinel): Delete frame if alive. Fix delq
invocation on server-frames.
(server-process-filter, server-buffer-done): Fix delq invocation on
server-frames.
src/cm.c (cmputc): Abort on write error, see what happens.
src/keyboard.c (read_avail_input): Do delete_tty on read errors.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-21
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
lisp/server.el (server-process-filter): Switch to the new terminal frame.
src/frame.c (Fdelete_frame): Delete the tty if this was its the last frame.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-12