aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-09-20 21:58:11 +0000
committerStefan Monnier2007-09-20 21:58:11 +0000
commit385312c9949fce9befa05235ccb25215a20aa32f (patch)
tree0430f48e388f018c05a9f4d51622b344edebf17f
parent371fed4ea49cb23061a39549c0e74aeed85e84df (diff)
downloademacs-385312c9949fce9befa05235ccb25215a20aa32f.tar.gz
emacs-385312c9949fce9befa05235ccb25215a20aa32f.zip
Remove.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/termdev.el196
2 files changed, 7 insertions, 196 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0b728f43456..13425b16b63 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> 12007-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * termdev.el: Remove.
4
5 * frame.el (get-device-terminal): New function. Moved from termdev.el.
6 (frames-on-display-list): Use it.
7
8 * bindings.el: Bind C-z to suspend-frame instead of suspend-emacs.
9
3 * termdev.el (terminal-id): Ask terminal-live-p before giving up. 10 * termdev.el (terminal-id): Ask terminal-live-p before giving up.
4 11
52007-09-20 Richard Stallman <rms@gnu.org> 122007-09-20 Richard Stallman <rms@gnu.org>
diff --git a/lisp/termdev.el b/lisp/termdev.el
deleted file mode 100644
index 679b88d1b9f..00000000000
--- a/lisp/termdev.el
+++ /dev/null
@@ -1,196 +0,0 @@
1;;; termdev.el --- functions for dealing with terminals
2
3;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
4
5;; Author: Karoly Lorentey <karoly@lorentey.hu>
6;; Created: 2005-12-22
7;; Keywords: internal
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 3, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
25
26(substitute-key-definition 'suspend-emacs 'suspend-frame global-map)
27
28(defun terminal-id (&optional terminal)
29 "Return the numerical id of terminal TERMINAL.
30
31TERMINAL can be a terminal id (an integer), a frame, or
32nil (meaning the selected frame's terminal). Alternatively,
33TERMINAL may be the name of an X display
34device (HOST.SERVER.SCREEN) or a tty device file."
35 (cond
36 ((integerp terminal)
37 (if (terminal-live-p terminal)
38 terminal
39 (signal 'wrong-type-argument (list 'terminal-live-p terminal))))
40 ((or (null terminal) (framep terminal))
41 (frame-terminal terminal))
42 ((stringp terminal)
43 (let ((f (car (filtered-frame-list (lambda (frame)
44 (or (equal (frame-parameter frame 'display) terminal)
45 (equal (frame-parameter frame 'tty) terminal)))))))
46 (or f (error "Display %s does not exist" terminal))
47 (frame-terminal f)))
48 ((terminal-live-p terminal) terminal)
49 (t
50 (error "Invalid argument %s in `terminal-id'" terminal))))
51
52;; (defun terminal-getenv (variable &optional terminal global-ok)
53;; "Get the value of VARIABLE in the client environment of TERMINAL.
54;; VARIABLE should be a string. Value is nil if VARIABLE is undefined in
55;; the environment. Otherwise, value is a string.
56
57;; If TERMINAL has an associated emacsclient process, then
58;; `terminal-getenv' looks up VARIABLE in the environment of that
59;; process; otherwise the function consults the global environment,
60;; i.e., the environment of the Emacs process itself.
61
62;; If GLOBAL-OK is non-nil, and VARIABLE is not defined in the
63;; terminal-local environment, then `terminal-getenv' will return
64;; its value in the global environment instead.
65
66;; TERMINAL can be a terminal id, a frame, or nil (meaning the
67;; selected frame's terminal)."
68;; (setq terminal (terminal-id terminal))
69;; (if (null (terminal-parameter terminal 'environment))
70;; (getenv variable)
71;; (if (multibyte-string-p variable)
72;; (setq variable (encode-coding-string variable locale-coding-system)))
73;; (let ((env (terminal-parameter terminal 'environment))
74;; result entry)
75;; (while (and env (null result))
76;; (setq entry (car env)
77;; env (cdr env))
78;; (if (and (> (length entry) (length variable))
79;; (eq ?= (aref entry (length variable)))
80;; (equal variable (substring entry 0 (length variable))))
81;; (setq result (substring entry (+ (length variable) 1)))))
82;; (if (and global-ok (null result))
83;; (getenv variable)
84;; (and result (decode-coding-string result locale-coding-system))))))
85
86;; (defun terminal-setenv (variable &optional value terminal)
87;; "Set the value of VARIABLE in the environment of TERMINAL.
88;; VARIABLE should be string. VALUE is optional; if not provided or
89;; nil, the environment variable VARIABLE is removed. Returned
90;; value is the new value of VARIABLE, or nil if it was removed from
91;; the environment.
92
93;; If TERMINAL was created by an emacsclient invocation, then the
94;; variable is set in the environment of the emacsclient process;
95;; otherwise the function changes the environment of the Emacs
96;; process itself.
97
98;; TERMINAL can be a terminal id, a frame, or nil (meaning the
99;; selected frame's terminal)."
100;; (if (null (terminal-parameter terminal 'environment))
101;; (setenv variable value)
102;; (with-terminal-environment terminal variable
103;; (setenv variable value))))
104
105;; (defun terminal-setenv-internal (variable value terminal)
106;; "Set the value of VARIABLE in the environment of TERMINAL.
107;; The caller is responsible to ensure that both VARIABLE and VALUE
108;; are usable in environment variables and that TERMINAL is a
109;; remote terminal."
110;; (if (multibyte-string-p variable)
111;; (setq variable (encode-coding-string variable locale-coding-system)))
112;; (if (and value (multibyte-string-p value))
113;; (setq value (encode-coding-string value locale-coding-system)))
114;; (let ((env (terminal-parameter terminal 'environment))
115;; found)
116;; (while (and env (not found))
117;; (if (and (> (length (car env)) (length variable))
118;; (eq ?= (aref (car env) (length variable)))
119;; (equal variable (substring (car env) 0 (length variable))))
120;; (progn
121;; (if value
122;; (setcar env (concat variable "=" value))
123;; (set-terminal-parameter terminal 'environment
124;; (delq (car env)
125;; (terminal-parameter terminal
126;; 'environment))))
127;; (setq found t))
128;; (setq env (cdr env))))
129;; (cond
130;; ((and value found)
131;; (setcar env (concat variable "=" value)))
132;; ((and value (not found))
133;; (set-terminal-parameter terminal 'environment
134;; (cons (concat variable "=" value)
135;; (terminal-parameter terminal
136;; 'environment))))
137;; ((and (not value) found)
138;; (set-terminal-parameter terminal 'environment
139;; (delq (car env)
140;; (terminal-parameter terminal
141;; 'environment)))))))
142
143;; (defmacro with-terminal-environment (terminal vars &rest body)
144;; "Evaluate BODY with environment variables VARS set to those of TERMINAL.
145;; The environment variables are then restored to their previous values.
146
147;; VARS should be a single string, a list of strings, or t for all
148;; environment variables.
149
150;; TERMINAL can be a terminal id, a frame, or nil (meaning the
151;; selected frame's terminal).
152
153;; If BODY uses `setenv' to change environment variables in VARS,
154;; then the new variable values will be remembered for TERMINAL, and
155;; `terminal-getenv' will return them even outside BODY."
156;; (declare (indent 2))
157;; (let ((var (make-symbol "var"))
158;; (term (make-symbol "term"))
159;; (v (make-symbol "v"))
160;; (old-env (make-symbol "old-env")))
161;; `(let ((,term ,terminal) ; Evaluate arguments only once.
162;; (,v ,vars))
163;; (if (stringp ,v)
164;; (setq ,v (list ,v)))
165;; (cond
166;; ((null (terminal-parameter ,term 'environment))
167;; ;; Not a remote terminal; nothing to do.
168;; (progn ,@body))
169;; ((eq ,v t)
170;; ;; Switch the entire process-environment.
171;; (let (,old-env process-environment)
172;; (setq process-environment (terminal-parameter ,term 'environment))
173;; (unwind-protect
174;; (progn ,@body)
175;; (set-terminal-parameter ,term 'environment process-environment)
176;; (setq process-environment ,old-env))))
177;; (t
178;; ;; Do only a set of variables.
179;; (let (,old-env)
180;; (dolist (,var ,v)
181;; (setq ,old-env (cons (cons ,var (getenv ,var)) ,old-env))
182;; (setenv ,var (terminal-getenv ,var ,term)))
183;; (unwind-protect
184;; (progn ,@body)
185;; ;; Split storing new values and restoring old ones so
186;; ;; that we DTRT even if a variable is specified twice in
187;; ;; VARS.
188;; (dolist (,var ,v)
189;; (terminal-setenv-internal ,var (getenv ,var) ,term))
190;; (dolist (,var ,old-env)
191;; (setenv (car ,var) (cdr ,var))))))))))
192
193(provide 'termdev)
194
195;; arch-tag: 4c4df277-1ec1-4f56-bfde-7f156fe62fb2
196;;; termdev.el ends here