Mercurial > emacs
annotate oldXMenu/ChgSel.c @ 83421:bb2edc915032
Implement automatic terminal-local environment variables via `local-environment-variables'.
* lisp/env.el (setenv, getenv): Add optional terminal parameter. Update docs.
(setenv): Handle `local-environment-variables'.
(read-envvar-name): Also allow (and complete) local
environment variables on the current terminal.
* src/callproc.c: Include frame.h and termhooks.h, for terminal parameters.
(Qenvironment): New constant.
(Vlocal_environment_variables): New variable.
(syms_of_callproc): Register and initialize them.
(child_setup): Handle Vlocal_environment_variables.
(getenv_internal): Add terminal parameter. Handle
Vlocal_environment_variables.
(Fgetenv_internal): Add terminal parameter.
* src/termhooks.h (get_terminal_param): Declare.
* src/Makefile.in (callproc.o): Update dependencies.
* mac/makefile.MPW (callproc.c.x): Update dependencies.
* lisp/termdev.el (terminal-id): Make parameter optional.
(terminal-getenv, terminal-setenv, with-terminal-environment):
Disable functions.
* lisp/mule-cmds.el (set-locale-environment): Convert `terminal-getenv' calls
to `getenv'.
* lisp/rxvt.el (rxvt-set-background-mode): Ditto.
* lisp/x-win.el (x-initialize-window-system): Ditto.
* lisp/xterm.el (terminal-init-xterm): Ditto.
* lisp/server.el (server-process-filter): Fix reference to the 'display frame
parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-461
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 26 Dec 2005 02:14:10 +0000 |
parents | 532e0a9335a9 |
children | d04d8ccb3c41 |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* Copyright Massachusetts Institute of Technology 1985 */ | |
65000
3861ff8f4bf1
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54770
diff
changeset
|
4 /* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. */ |
25858 | 5 |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenuChangeSelection - Change a menu selection. | |
10 * | |
11 * Author: Tony Della Fera, DEC | |
12 * December 19, 1985 | |
13 * | |
14 */ | |
15 | |
16 #include "XMenuInt.h" | |
17 | |
18 int | |
19 XMenuChangeSelection(display, menu, p_num, s_num, data, data_sw, label, label_sw) | |
20 Display *display; /* previously opened display. */ | |
21 register XMenu *menu; /* Menu object to be modified. */ | |
22 register int p_num; /* Pane number to be modified. */ | |
23 register int s_num; /* Selection number to modified. */ | |
24 char *data; /* Data value. */ | |
25 int data_sw; /* Change to new data value? */ | |
26 char *label; /* Selection label. */ | |
27 int label_sw; /* Change to new label? */ | |
28 { | |
29 register XMPane *p_ptr; /* XMPane pointer. */ | |
30 register XMSelect *s_ptr; /* XMSelect pointer. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
31 |
25858 | 32 int label_length; /* Label length in characters. */ |
33 int label_width; /* Label width in pixels. */ | |
34 | |
35 /* | |
36 * Check for NULL pointers! | |
37 */ | |
38 if (label == NULL) { | |
39 _XMErrorCode = XME_ARG_BOUNDS; | |
40 return(XM_FAILURE); | |
41 } | |
42 | |
43 /* | |
44 * Find the right pane. | |
45 */ | |
46 p_ptr = _XMGetPanePtr(menu, p_num); | |
47 if (p_ptr == NULL) return(XM_FAILURE); | |
48 | |
49 /* | |
50 * Find the right selection. | |
51 */ | |
52 s_ptr = _XMGetSelectionPtr(p_ptr, s_num); | |
53 if (s_ptr == NULL) return(XM_FAILURE); | |
54 | |
55 /* | |
56 * Reset the label? | |
57 */ | |
58 if (label_sw) { | |
59 /* | |
60 * Determine label size. | |
61 */ | |
62 label_length = strlen(label); | |
63 label_width = XTextWidth(menu->s_fnt_info, label, label_length); | |
64 | |
65 /* | |
66 * Change the selection data. | |
67 */ | |
68 s_ptr->label = label; | |
69 s_ptr->label_width = label_width; | |
70 s_ptr->label_length = label_length; | |
71 | |
72 /* | |
73 * Schedule a recompute. | |
74 */ | |
75 menu->recompute = 1; | |
76 } | |
77 | |
78 /* | |
79 * Reset the data? | |
80 */ | |
81 if (data_sw) s_ptr->data = data; | |
82 | |
83 /* | |
84 * Return successfully. | |
85 */ | |
86 _XMErrorCode = XME_NO_ERROR; | |
87 return(s_num); | |
88 } | |
52401 | 89 |
90 /* arch-tag: 229732a6-46bf-4a3a-ad90-3d8ed65c0841 | |
91 (do not change this comment) */ |