Mercurial > emacs
annotate oldXMenu/Post.c @ 82995:039bd6989d29
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
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 03 Jan 2004 08:31:14 +0000 |
parents | f0eb34e60705 |
children | 8e5779acd195 |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
53224
f0eb34e60705
tag of miles@gnu.org--gnu-2003/emacs--cvs-trunk--0--patch-137
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
3 /* $Header: /cvsroot/emacs/emacs/oldXMenu/Post.c,v 1.4 2003/09/01 15:45:47 miles Exp $ */ |
25858 | 4 /* Copyright Massachusetts Institute of Technology 1985 */ |
5 | |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenuPost - Maps a given menu to the display and activates | |
10 * the menu for user selection. The user is allowed to | |
11 * specify the mouse button event mask that will be used | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
12 * to identify a selection request. When a selection |
25858 | 13 * request is received (i.e., when the specified mouse |
14 * event occurs) the data returned will be either the | |
15 * data associated with the particular selection active | |
16 * at the time of the selection request or NULL if no | |
17 * selection was active. A menu selection is shown to | |
18 * be active by placing a highlight box around the | |
19 * selection as the mouse cursor enters its active | |
20 * region. Inactive selections will not be highlighted. | |
21 * As the mouse cursor moved from one menu pane | |
22 * to another menu pane the pane being entered is raised | |
23 * and activated and the pane being left is deactivated. | |
24 * If an error occurs NULL will be returned with the | |
25 * p_num set to POST_ERROR, s_num set to | |
26 * NO_SELECTION and _XMErrorCode set to an | |
27 * appropriate value. | |
28 * Every time the routine returns successfully the | |
29 * p_num and s_num indices will be set to indicate | |
30 * the currently active pane and/or selection. If the | |
31 * mouse was not in a selection window at the time | |
32 * s_num will be set to NO_SELECTION. | |
33 * | |
34 * Author: Tony Della Fera, DEC | |
35 * August, 1984 | |
36 * | |
37 */ | |
38 | |
39 #include "XMenuInt.h" | |
40 | |
41 char * | |
42 XMenuPost(display, menu, p_num, s_num, x_pos, y_pos, event_mask) | |
43 register Display *display; /* Previously opened display. */ | |
44 register XMenu *menu; /* Menu to post. */ | |
45 register int *p_num; /* Pane number selected. */ | |
46 register int *s_num; /* Selection number selected. */ | |
47 register int x_pos; /* X coordinate of menu position. */ | |
48 register int y_pos; /* Y coordinate of menu position. */ | |
49 int event_mask; /* Mouse button event mask. */ | |
50 { | |
51 register int stat; /* Routine call return status. */ | |
52 char *data; /* Return data. */ | |
53 | |
54 /* | |
55 * Set up initial pane and selection assumptions. | |
56 */ | |
57 | |
58 /* | |
59 * Make the procedure call. | |
60 */ | |
61 stat = XMenuActivate( | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
62 display, |
25858 | 63 menu, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
64 p_num, s_num, |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
65 x_pos, y_pos, |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
66 event_mask, |
27456
4a9ea0d1735b
(XMenuPost): Pass null help callback to XMenuActivate.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
67 &data, 0); |
25858 | 68 |
69 /* | |
70 * Check the return value and return accordingly. | |
71 */ | |
72 switch (stat) { | |
73 case XM_FAILURE: | |
74 *p_num = POST_ERROR; | |
75 *s_num = NO_SELECTION; | |
76 return(NULL); | |
77 case XM_NO_SELECT: | |
78 case XM_IA_SELECT: | |
79 *s_num = NO_SELECTION; | |
80 return(NULL); | |
81 case XM_SUCCESS: | |
82 default: | |
83 return(data); | |
84 } | |
85 } | |
52401 | 86 |
87 /* arch-tag: 7b6104e5-fa32-4342-aa17-05296a30dd70 | |
88 (do not change this comment) */ |