1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

155 Commits

Author SHA1 Message Date
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
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
Karoly Lorentey
2a36494c42 Merged in changes from CVS HEAD
Patches applied:

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

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

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

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

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

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

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

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

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-41
   Make fringe-drawing stuff compile without a window-system

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

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

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

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

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

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

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

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

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


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-59
2004-01-22 15:37:19 +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
Karoly Lorentey
4ca927b4e0 Fix C-g handling with multiple ttys.
src/sysdep.c (init_sys_modes): Disable interrupt and quit keys on
secondary terminals.  Added a big fat comment about this.

lib-src/emacsclient.c (init_signals): Don't pass SIGINT and SIGQUIT to Emacs.

src/keyboard.c (interrupt_signal): Exit Emacs if there are no frames
on the controlling tty.  Otherwise set internal_last_event_frame to
the controlling tty's top frame.

src/term.c (ring_bell, tty_ring_bell): Don't look at updating_frame.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-52
2004-01-11 02:45:44 +00:00
Karoly Lorentey
b80bf66eab Merged in changes from CVS HEAD
Patches applied:

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

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

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

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

 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-26
   Fix permission bogosities

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

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

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

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


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-50
2004-01-10 13:27:38 +00:00
Andreas Schwab
152b6e830f (main): Save errno from socket_status. 2004-01-08 12:20:43 +00:00
Karoly Lorentey
0221d2bfcb Merged in changes from CVS HEAD
Patches applied:

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

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


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-45
2004-01-05 05:58:50 +00:00
Karoly Lorentey
428a555ec5 Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.

lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.

lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell).  Use tty-create-frame-with-faces,
not make-terminal-frame.

src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.

src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.

src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.

src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init.  Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info.  Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.

src/dispextern.h: Updated prototypes.

src/dispnew.c:  Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.

src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.

src/process.c: Include frame.h before termhooks.h.

src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here.  Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.

src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions.  Check ttys even if read_socket_hook returned an error.

src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group.  Set up terminal modes and sigio even under X.

src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.

src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.

src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.

src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.

src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.

src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
2004-01-05 05:54:35 +00:00
Andreas Schwab
e822882420 (main): Fix socket name when using another user. 2004-01-04 16:42:06 +00:00
Karoly Lorentey
4d553a13ab Portability fixes (now it compiles & runs fine on Solaris).
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
2004-01-03 08:31:14 +00:00
Karoly Lorentey
b28c910d1f Fix longopts option name for --tty.
lib-src/emacsclient.c (longopts): Fix --tty and -t.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-34
2004-01-02 13:03:12 +00:00
Karoly Lorentey
7b00d185eb MULTI_KBOARD support for ttys. Input-related bugfixes for X+tty sessions.
lib-src/emacsclient.c (pty_conversation): Fix errno check for read from fileno(in).

src/config.in: Unconditionally define MULTI_KBOARD.

src/frame.c (make_terminal_frame): Initialize f->kboard.

src/keyboard.c (cmd_error_internal): Don't kill Emacs if a Quit was
pressed on the tty of a X+tty session.
(read_avail_input): Initialize nread to zero.  Abort if there is no
tty after a termcap read.
(interrupt_signal)[USG]: Always reset signal handler.
(init_keyboard): Always set signal handler for SIGINT/SIGQUIT if
noninteractive.

src/term.c (term_dummy_init): Initialize kboard to the initial_kboard.
(term_init): Free component structures of the initial tty. Clear xmalloced structures.
Moved rif initialization to syms_of_term.
(term_init)[MULTI_KBOARD]: Initialize tty->kboard.
(delete_tty)[MULTI_KBOARD]: Delete the keyboard.
(syms_of_term): Initialize tty_display_method_template.

src/termchar.h (tty_output)[MULTI_KBOARD]: Added kboard member.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-31
2004-01-02 02:54:17 +00:00
Karoly Lorentey
daf0170133 Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack.  (Sigh.)

lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.

src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.


src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.

src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.

src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.

src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.

src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin.  Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.

src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method.  Blindly fixed
WINDOWSNT-specific parts.  Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames.  Free() the display_method.

src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method.  Added flow_control and
display_method members.

src/termhooks.h (struct display_method): New struct (renamed from
struct device).  Added accessor macros.

src/window.c (init_window_once): Initialize Vterminal_frame.

src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.

src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.

src/xfns.c (Fx_create_frame): Added rif hack.  Initialize
display_method.
(x_create_tip_frame): Initialize display_method.

src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif.  Do initialize x_display_method.

src/xterm.h (x_display_method): New declaration.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
Karoly Lorentey
819b8f00ed A few more bugfixes and new features.
(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
2003-12-31 05:09:29 +00:00
Karoly Lorentey
16c290d8c1 Major bugfixes and slight enhancements.
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
2003-12-30 19:27:57 +00:00
Karoly Lorentey
9f729af551 Handle Ctl-G in emacsclient.
lib-src/emacsclient.c (quit_char): New variable.
(init_tty): Use it.
(interrupt_signal): Forward SIGINT to Emacs.
(init_signals): Install SIGINT handler.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-20
2003-12-29 07:24:41 +00:00
Karoly Lorentey
0a1258976b Bugfix festival.
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
2003-12-29 07:16:26 +00:00
Karoly Lorentey
fca177d467 Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.

lisp/frame.el (make-frame-on-tty): New function.

lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.

src/cm.c: Fix remaining cases of direct Wcm references.

src/dispextern.h: Updated prototypes.

src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.

src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name.  Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.

src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax.  Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.

src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references.  Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes.  Updated old_tty references.

src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized.  Don't exit on errors
if this would have been a secondary terminal.  Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.

src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member.  Added tty-specific variables from term.c.

src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
Karoly Lorentey
6548cf002c Full support for multiple terminal I/O (with some rough edges).
lib-src/emacsclient.c (emacs_pid): New variable.  
(window_change): Forward the SIGWINCH signal to the Emacs process
after copying the size parameters to the proxy terminal.
(copy_from_to): New parameter (sigio), kill Emacs with SIGIO if it is
nonzero.
(main): Set emacs_pid.

lisp/server.el (server-process-filter): Send the pid of Emacs to emacsclient.

src/cm.c: Added tty parameters to all functions and all Wcm macro calls.

src/cm.h: Added tty parameters to all macros.   Updated function prototypes.
(Wcm): Moved to struct tty_output.

src/dispextern.h: Updated function prototypes.

src/dispnew.c: Added tty parameters to all Wcm macro calls.
(do_switch_frame): Make old frame obscured, not invisible, to solve
problems with other-frame.
(Wcm): Moved to struct tty_output.

src/keyboard.c (read_avail_input): Select the frame corresponding to
the tty that was read.  Slight rearrangement of tty loop.

src/lisp.h (tabs_safe_p): Removed duplicate prototype.

src/sysdep.c (hft_init, hft_reset): Added tty_output parameter.
(discard_tty_input): Discard input from all ttys on APOLLO, too.
Whatever it is.
(narrow_foreground_group, widen_foreground_group): Added tty parameter
(not really useful, the functions only work on the controlling tty.)
(tabs_safe_p): Added tty parameter.

src/term.c Added tty parameters to all Wcm macro calls.
Standardised updating_frame vs. selected frame and tty_output access.
(term_init): Allocate Wcm.
(syms_of_term): Provide the `multi-tty' feature.

src/termchar.h (struct tty_output): Added Wcm.

src/xdisp.c (try_window_id): Make sure we use the tty device
corresponding to the current frame.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-8
2003-12-27 01:12:57 +00:00
Karoly Lorentey
9628b8878f lib-src/emacsclient.c: Implemented --here option (open a new Emacs tty). Needs more work.
(here): New variable.
(decode_options): Use it.
(ec_get_tty, ec_set_tty, init_tty, window_change, hang_up_signal): New functions.
(window_change_signal, init_signals, reset_tty, init_pty, copy_from_to): Ditto.
(pty_conversation): Ditto.
(main): Use them.
(master, pty_name, old_tty, tty, old_tty_valid, tty_erase_char): New variables.
(flow_control, meta_key, _sobuf, in_conversation, quit_conversation): Ditto.

lisp/server.el (server-process-filter): Added support for opening a new terminal frame.

dispextern.h (get_frame_size): Renamed to get_tty_size, added tty_output parameter.

dispnew.c (Fredraw_frame): fflush the current terminal instead of stdout.
(direct_output_for_insert, direct_output_forward_char, update_frame_1): Ditto.
(Fding, bitch_at_user): Ditto.
(update_frame_1): Count pending output for current terminal instead of stdout.
(window_change_signal): Resize all terminals.
(change_frame_size): Don't resize all terminals to the same size.

frame.c (Vterminal_frame): Removed.
(syms_of_frame): Removed declaration of Vterminal_frame.
(make_terminal_frame): Set the top frame of the terminal to the new frame.
(Fmake_terminal_frame): Get a new frame size from get_tty_size, don't copy it.
(do_switch_frame): Handle terminal frame visibility.
(next_frame, prev_frame): Skip over frames on different terminals.

frame.h (Vterminal_frame): Removed.

keyboard.c (input_fd): Removed.
(read_avail_input): Removed first argument from read_socket_hook.
Try to read from each available tty, until one succeeds.
(Fsuspend_emacs): Don't suspend if there are multiple terminals.

lisp.h (get_frame_size): Removed superflous declaration.

xterm.c (Xtread_socket): Removed first parameter.
macterm.h (XTread_socket): Ditto.
w32inevt.c (w32_console_read_socket): Ditto.
w32term.c (w32_read_socket): Ditto.

sysdep.c (input_fd): Removed.
(change_input_fd): Removed.
(discard_tty_input): Discard pending input on _all_ input descriptors.
(stuff_char, tabs_safe_p): Use current terminal instead of input_fd.
(init_baud_rate, request_sigio, unrequest_sigio): Ditto.
(init_sys_modes, reset_sys_modes): Ditto.
(narrow_foreground_group, widen_foreground_group): Use stdin.
(init_sys_modes, reset_sys_modes): otty parameter renamed to tty_out.
(get_frame_size): Renamed to get_tty_size, added tty_out parameter.

term.c (read_socket_hook): Removed first parameter.
(clear_end_of_line): Use updating_frame, if possible.
(write_glyphs, insert_glyphs, ins_del_lines): Ditto.
(term_init): Renamed get_frame_size to get_tty_size.

termchar.h (struct tty_output): New entries: top_frame,
previous_terminal_frame.

termhooks.h (read_socket_hook): Removed first parameter.

window.c (init_window_once): Removed reference to Vterminal_frame.

xdisp.c (previous_terminal_frame): Moved to struct tty_output.
(redisplay_internal): Updated to use previous_terminal_frame in tty_output.
Allow for simultaneous refresh of multiple ttys.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-5
2003-12-26 04:24:54 +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
Pavel Janík
e69233c2de Include "config.h", not <../src/config.h>.
(main): Parenthesize assignment when used as truth value to
prevent gcc warnings.
2001-12-19 07:21:17 +00:00
Gerd Moellmann
cb1cdedd97 (main): Cast isdigit() argument to unsigned char.
From Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
2001-10-09 10:18:30 +00:00
Gerd Moellmann
8b8f50f810 (print_help_and_exit): Fix help message for
+LINE:COLUMN option.

(main): Add support for +LINE:COLUMN command line
argument.
2001-07-17 10:57:25 +00:00
Dave Love
23431241d4 (fail): Don't return a value.
(main): Cast uid values for sprintf.
2001-04-05 18:46:47 +00:00
Gerd Moellmann
de073ce36f (fail, main): Don't use implicit int return type. 2001-04-03 13:37:23 +00:00
Eli Zaretskii
571512dece (main): Remove unused local variable statbfr.
(main) <homedir>: Make its declaration conditional on
SERVER_HOME_DIR, to avoid compiler warnings.
2001-01-02 13:52:48 +00:00
Gerd Moellmann
9f637eea61 (socket_status): New function.
(main): if $LOGNAME or $USER exist and differ from our euid, look
for a socket based on the UID associated with the name.
2000-01-28 15:02:20 +00:00
Gerd Moellmann
97e3214d1d Add option -a EDITOR and environment variable
ALTERNATE_EDITOR.  Exec this editor if we fail to contact Emacs.
2000-01-12 13:38:54 +00:00
Paul Eggert
4ee9629e2b Add support for large files. Merge glibc 2.1.2.
* b2m.c, emacsclient.c, emacsserver.c, fakemail.c, make-docfile.c,
movemail.c, pop.c:
Do not include <stdlib.h>, as <config.h> does this now.

* b2m.c, emacsserver.c, etags.c, profile.c:
Include <config.h> before any system include files.

* emacsclient.c, emacsserver.c, fakemail.c, movemail.c, pop.c,
test-distrib.c:
(read, write, open, close): Do not undef.

* getopt.c, getopt1.c: Adopt glibc 2.1.2, with the following fix:
(const): Do not define if HAVE_CONFIG_H; that's config.h's job.

* getopt.h: Adopt glibc 2.1.2.
1999-10-19 07:17:20 +00:00
Richard M. Stallman
4852ed0e72 (print_help_and_exit): Mention --version. 1999-08-29 19:30:53 +00:00
Karl Heuer
b4e94f425f (decode_options): Update version output.
(print_help_and_exit): Update bug report address.
1999-08-25 16:19:01 +00:00
Karl Heuer
c5fee54517 (main): Move the dynamic allocation of
system_name outside of the SERVER_HOME_DIR conditional.
1999-08-14 04:08:25 +00:00
Karl Heuer
0343a01795 (main, both versions): Use quote_file_name on cwd. 1999-04-29 20:26:46 +00:00
Richard M. Stallman
5f32a7128b (xmalloc): Fix previous change. 1999-01-25 23:43:20 +00:00
Richard M. Stallman
5497dfdb4b (xmalloc): Declare to return long. 1999-01-25 01:34:34 +00:00
Richard M. Stallman
a2b3f2b55c (main): Eliminate arbitrary limit on length of system_name.
(xmalloc): Define unconditionally.
1999-01-16 21:45:10 +00:00
Richard M. Stallman
5fb29af43c (main): Null-terminate system_name. 1998-10-10 21:20:22 +00:00
Dave Love
79f13bba7d Move inclusion of unistd.h to top, else fails on
Irix6, at least.
1998-04-08 17:31:45 +00:00
Andreas Schwab
7f3bff3e4c Include <stdlib.h> and <unistd.h> if available.
Don't declare geteuid.
(print_help_and_exit): Change return type to void.  Forward
declare it.
1998-04-06 10:13:46 +00:00
Richard M. Stallman
bd25266244 [HAVE_SYSVIPC]: Include errno.h, as in the other case.
(main) [!BSD_SYSTEM]: Fix error message for getcwd failure.
1997-08-27 20:08:59 +00:00
Richard M. Stallman
0c76956f83 [C_ALLOCA] (xmalloc): New function. 1997-07-09 19:20:34 +00:00
Karl Heuer
e397a0172f Replaced all BSD with BSD_SYSTEM. 1996-09-17 02:37:17 +00:00
Richard M. Stallman
749ae7700e (longopts): Change nowait to no-wait.
(print_help_and_exit): Fix option name; upcase metavars.
1996-09-10 02:00:27 +00:00
Richard M. Stallman
f1db6a73ef (quote_file_name): Quote with &, not \.
Quote `-' only at start of file name.  Terminate the value string.
1996-09-02 17:43:32 +00:00
Richard M. Stallman
5212210c8f (quote_file_name): New function.
(main, both versions): Use quote_file_name.
(decode_options): Don't return a value.
(main, both versions): Use optind.
Don't check for -nowait here.
1996-09-02 00:05:56 +00:00
Richard M. Stallman
8f9aaa0a81 (decode_options): New function.
(main, both versions): Call decode_options.
(print_help_and_exit): New function.
(VERSION): New macro
1996-09-01 18:25:21 +00:00
Richard M. Stallman
292d74a338 (both versions): Handle -nowait and --nowait by sending data to the server. 1996-08-31 16:25:21 +00:00
Richard M. Stallman
23a7488dea (main) [HAVE_SOCKETS]: Use two separate stdio
streams, one for sending and one for reading the reply.
1996-07-23 14:18:34 +00:00
Karl Heuer
dc3c30fec0 (main, both definitions): Print a newline for normal termination. 1996-02-21 20:53:01 +00:00
Erik Naggum
3b7ad313e0 Update FSF's address in the preamble. 1996-01-15 09:18:04 +00:00
Richard M. Stallman
26396b1bda (main): Add argv[0] to an error message. 1995-04-18 20:50:19 +00:00
Karl Heuer
18a2fa9174 (main): Improve error handling. 1995-04-14 02:10:52 +00:00
Richard M. Stallman
1e523e3da8 Test NO_SOCKETS_IN_FILE_SYSTEM. 1995-04-11 01:44:46 +00:00
Richard M. Stallman
7e1251a15e [Berkeley sockets version] (main): Declare getcwd. 1995-04-07 01:01:25 +00:00
Richard M. Stallman
ee6a193c4c Use BSD sockets whenever available, even if HAVE_SYSVIPC.
(main): Use getcwd if not BSD.
1995-03-15 23:31:02 +00:00
Richard M. Stallman
b135a7cf0b [HAVE_SYSVIPC]: Include sys/utsname.h.
(main): If socket/mqueue name is in home dir, add in the host name.
Rename .emacs_server to .emacs-server-....

[!HAVE_SYSVIPC] (main): Fix error message diction.
1994-12-07 07:39:23 +00:00
David J. MacKenzie
340ff9deae Eliminate some -Wall warnings. 1994-10-12 20:21:51 +00:00
Richard M. Stallman
defb80d7ad (main): New local var progname saves argv[0]. 1994-07-27 17:59:03 +00:00
Richard M. Stallman
cd33a5a086 (main): Don't actually modify argv[0]. Modify a copy instead. 1994-07-26 19:56:03 +00:00
Richard M. Stallman
1518a9eb45 (main) [HAVE_SYSVIPC]: Make msgp->mtext longer if necessary.
On HPUX, error if it's more than 512 chars.
1994-03-05 21:42:57 +00:00
Roland McGrath
2771160004 [! HAVE_STRERROR] (strerror): Define the function. 1994-01-08 22:27:30 +00:00
Roland McGrath
92af894ffd Don't declare sys_errlist; declare strerror instead.
(main): Call strerror instead of using sys_errlist.
1994-01-08 21:43:57 +00:00
Roland McGrath
18160b98ce Include <config.h> instead of "config.h". 1993-09-10 06:15:46 +00:00
Jim Blandy
4e23f2ba8b * emacsserver.c (main): When we're passing a `struct sockaddr_un'
to bind or accept, cast the pointer, to avoid warnings on systems
	which declare prototypes for this.
	* emacsclient.c (main): Same.
1993-06-09 12:45:26 +00:00