diff options
| author | Karoly Lorentey | 2004-01-03 08:31:14 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-01-03 08:31:14 +0000 |
| commit | 4d553a13abdadb4bb469bc0b59c003d48066dce5 (patch) | |
| tree | 0b84a435d41801417190e60bf89ffa0305c8c4ac /src/sysdep.c | |
| parent | b28c910d1f41815fa4744756852d5f2377d28636 (diff) | |
| download | emacs-4d553a13abdadb4bb469bc0b59c003d48066dce5.tar.gz emacs-4d553a13abdadb4bb469bc0b59c003d48066dce5.zip | |
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
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 502671ba0f6..a84a6d5c1fb 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -913,6 +913,29 @@ restore_signal_handlers (saved_handlers) | |||
| 913 | } | 913 | } |
| 914 | } | 914 | } |
| 915 | 915 | ||
| 916 | #ifndef SIGIO | ||
| 917 | /* If SIGIO is broken, don't do anything. */ | ||
| 918 | void | ||
| 919 | init_sigio (int fd) | ||
| 920 | { | ||
| 921 | } | ||
| 922 | |||
| 923 | void | ||
| 924 | reset_sigio (int fd) | ||
| 925 | { | ||
| 926 | } | ||
| 927 | |||
| 928 | void | ||
| 929 | request_sigio (void) | ||
| 930 | { | ||
| 931 | } | ||
| 932 | |||
| 933 | void | ||
| 934 | unrequest_sigio (void) | ||
| 935 | { | ||
| 936 | } | ||
| 937 | |||
| 938 | #else | ||
| 916 | #ifdef F_SETFL | 939 | #ifdef F_SETFL |
| 917 | 940 | ||
| 918 | int old_fcntl_flags[MAXDESC]; | 941 | int old_fcntl_flags[MAXDESC]; |
| @@ -932,10 +955,13 @@ void | |||
| 932 | reset_sigio (fd) | 955 | reset_sigio (fd) |
| 933 | int fd; | 956 | int fd; |
| 934 | { | 957 | { |
| 958 | #ifdef FASYNC | ||
| 935 | fcntl (fd, F_SETFL, old_fcntl_flags[fd]); | 959 | fcntl (fd, F_SETFL, old_fcntl_flags[fd]); |
| 960 | #endif | ||
| 936 | } | 961 | } |
| 937 | 962 | ||
| 938 | #ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */ | 963 | #ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */ |
| 964 | /* XXX Uhm, this FASYNC is not used anymore here. */ | ||
| 939 | 965 | ||
| 940 | void | 966 | void |
| 941 | request_sigio () | 967 | request_sigio () |
| @@ -1053,6 +1079,7 @@ unrequest_sigio () | |||
| 1053 | #endif /* STRIDE */ | 1079 | #endif /* STRIDE */ |
| 1054 | #endif /* FASYNC */ | 1080 | #endif /* FASYNC */ |
| 1055 | #endif /* F_SETFL */ | 1081 | #endif /* F_SETFL */ |
| 1082 | #endif /* SIGIO */ | ||
| 1056 | 1083 | ||
| 1057 | /* Saving and restoring the process group of Emacs's terminal. */ | 1084 | /* Saving and restoring the process group of Emacs's terminal. */ |
| 1058 | 1085 | ||
| @@ -1368,6 +1395,7 @@ nil means don't delete them until `list-processes' is run. */); | |||
| 1368 | #ifdef HAVE_WINDOW_SYSTEM | 1395 | #ifdef HAVE_WINDOW_SYSTEM |
| 1369 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore | 1396 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore |
| 1370 | needs the initialization code below. */ | 1397 | needs the initialization code below. */ |
| 1398 | /* XXX This need to be revised for X+tty session support. */ | ||
| 1371 | if (tty_out->input != stdin || (!read_socket_hook && EQ (Vwindow_system, Qnil))) | 1399 | if (tty_out->input != stdin || (!read_socket_hook && EQ (Vwindow_system, Qnil))) |
| 1372 | #endif | 1400 | #endif |
| 1373 | { | 1401 | { |
| @@ -1641,6 +1669,8 @@ nil means don't delete them until `list-processes' is run. */); | |||
| 1641 | #else | 1669 | #else |
| 1642 | setbuf (TTY_OUTPUT (tty_out), (char *) _sobuf); | 1670 | setbuf (TTY_OUTPUT (tty_out), (char *) _sobuf); |
| 1643 | #endif | 1671 | #endif |
| 1672 | |||
| 1673 | #if 0 /* We always need this with multi-tty support. */ | ||
| 1644 | #ifdef HAVE_WINDOW_SYSTEM | 1674 | #ifdef HAVE_WINDOW_SYSTEM |
| 1645 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore | 1675 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore |
| 1646 | needs the initialization code below. */ | 1676 | needs the initialization code below. */ |
| @@ -1652,6 +1682,8 @@ nil means don't delete them until `list-processes' is run. */); | |||
| 1652 | #endif | 1682 | #endif |
| 1653 | ) | 1683 | ) |
| 1654 | #endif | 1684 | #endif |
| 1685 | #endif | ||
| 1686 | tty_set_terminal_modes (tty_out); | ||
| 1655 | 1687 | ||
| 1656 | if (!tty_out->term_initted) | 1688 | if (!tty_out->term_initted) |
| 1657 | { | 1689 | { |
| @@ -1750,7 +1782,6 @@ get_tty_size (int fd, int *widthp, int *heightp) | |||
| 1750 | *widthp = 0; | 1782 | *widthp = 0; |
| 1751 | *heightp = 0; | 1783 | *heightp = 0; |
| 1752 | #endif | 1784 | #endif |
| 1753 | |||
| 1754 | #endif /* not VMS */ | 1785 | #endif /* not VMS */ |
| 1755 | #endif /* not SunOS-style */ | 1786 | #endif /* not SunOS-style */ |
| 1756 | #endif /* not BSD-style */ | 1787 | #endif /* not BSD-style */ |
| @@ -1815,6 +1846,7 @@ reset_sys_modes (tty_out) | |||
| 1815 | } | 1846 | } |
| 1816 | if (!tty_out->term_initted) | 1847 | if (!tty_out->term_initted) |
| 1817 | return; | 1848 | return; |
| 1849 | #if 0 /* We always need to do this with multi-tty support. */ | ||
| 1818 | #ifdef HAVE_WINDOW_SYSTEM | 1850 | #ifdef HAVE_WINDOW_SYSTEM |
| 1819 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore | 1851 | /* Emacs' window system on MSDOG uses the `internal terminal' and therefore |
| 1820 | needs the clean-up code below. */ | 1852 | needs the clean-up code below. */ |
| @@ -1828,7 +1860,8 @@ reset_sys_modes (tty_out) | |||
| 1828 | )) | 1860 | )) |
| 1829 | return; | 1861 | return; |
| 1830 | #endif | 1862 | #endif |
| 1831 | 1863 | #endif | |
| 1864 | |||
| 1832 | cmgoto (tty_out, FrameRows (tty_out) - 1, 0); | 1865 | cmgoto (tty_out, FrameRows (tty_out) - 1, 0); |
| 1833 | tty_clear_end_of_line (tty_out, FrameCols (tty_out)); | 1866 | tty_clear_end_of_line (tty_out, FrameCols (tty_out)); |
| 1834 | cmgoto (tty_out, FrameRows (tty_out) - 1, 0); | 1867 | cmgoto (tty_out, FrameRows (tty_out) - 1, 0); |