diff options
| author | Richard M. Stallman | 1996-03-27 00:11:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-03-27 00:11:39 +0000 |
| commit | 099cffd4df2e5395acd8dd049e4dda072f5eac1c (patch) | |
| tree | 718e83ed86342c01a0054e6b6f5e5e73d7f24c11 | |
| parent | 730cdbb27ec6f299783d278975501c1287709d9e (diff) | |
| download | emacs-099cffd4df2e5395acd8dd049e4dda072f5eac1c.tar.gz emacs-099cffd4df2e5395acd8dd049e4dda072f5eac1c.zip | |
(te-terminal-name-prefix): Change from
"emacs-virtual" to "emacs-em", so that things will work on systems
which allow only short terminal-type names.
(terminal-emulator): Delete the hyphen between
te-terminal-name-prefix and the width and height of the window.
(te-create-terminfo): Reformat the terminfo entry slightly.
(te-terminfo-directory): New variable.
(te-create-terminfo, te-tic-sentinel): Use te-terminfo-directory.
| -rw-r--r-- | lisp/terminal.el | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/terminal.el b/lisp/terminal.el index eaa4edd0787..8f8da8a14f6 100644 --- a/lisp/terminal.el +++ b/lisp/terminal.el | |||
| @@ -172,7 +172,10 @@ performance.") | |||
| 172 | (defvar te-pending-output-info nil) | 172 | (defvar te-pending-output-info nil) |
| 173 | 173 | ||
| 174 | ;; Required to support terminfo systems | 174 | ;; Required to support terminfo systems |
| 175 | (defconst te-terminal-name-prefix "emacs-virtual") | 175 | (defconst te-terminal-name-prefix "emacs-em" |
| 176 | "Prefix used for terminal type names for Terminfo.") | ||
| 177 | (defconst te-terminfo-directory "/tmp/emacs-terminfo/" | ||
| 178 | "Directory used for run-time terminal definition files for Terminfo.") | ||
| 176 | (defvar te-terminal-name nil) | 179 | (defvar te-terminal-name nil) |
| 177 | 180 | ||
| 178 | ;;;; escape map | 181 | ;;;; escape map |
| @@ -1100,7 +1103,7 @@ subprocess started." | |||
| 1100 | (if (null height) (setq height (- (window-height (selected-window)) 1))) | 1103 | (if (null height) (setq height (- (window-height (selected-window)) 1))) |
| 1101 | (terminal-mode) | 1104 | (terminal-mode) |
| 1102 | (setq te-width width te-height height) | 1105 | (setq te-width width te-height height) |
| 1103 | (setq te-terminal-name (concat te-terminal-name-prefix "-" te-width | 1106 | (setq te-terminal-name (concat te-terminal-name-prefix te-width |
| 1104 | te-height)) | 1107 | te-height)) |
| 1105 | (setq mode-line-buffer-identification | 1108 | (setq mode-line-buffer-identification |
| 1106 | (list (format "Emacs terminal %dx%d: %%b " te-width te-height) | 1109 | (list (format "Emacs terminal %dx%d: %%b " te-width te-height) |
| @@ -1242,22 +1245,25 @@ of the terminal-emulator" | |||
| 1242 | 1245 | ||
| 1243 | (defun te-create-terminfo () | 1246 | (defun te-create-terminfo () |
| 1244 | "Create and compile a terminfo entry for the virtual terminal. This is kept | 1247 | "Create and compile a terminfo entry for the virtual terminal. This is kept |
| 1245 | in the /tmp directory" | 1248 | in the directory specified by `te-terminfo-directory'." |
| 1246 | (if (and system-uses-terminfo | 1249 | (if (and system-uses-terminfo |
| 1247 | (not (file-exists-p (concat "/tmp/" | 1250 | (not (file-exists-p (concat te-terminfo-directory |
| 1248 | (substring te-terminal-name-prefix 0 1) | 1251 | (substring te-terminal-name-prefix 0 1) |
| 1249 | "/" te-terminal-name)))) | 1252 | "/" te-terminal-name)))) |
| 1250 | (let ( (terminfo | 1253 | (let ( (terminfo |
| 1251 | (concat | 1254 | (concat |
| 1252 | (format "%s,mir, xon,cols#%d, lines#%d," | 1255 | ;; The first newline avoids trouble with ncurses. |
| 1256 | (format "%s,\n\tmir, xon,cols#%d, lines#%d," | ||
| 1253 | te-terminal-name te-width te-height) | 1257 | te-terminal-name te-width te-height) |
| 1254 | "bel=^P^G, clear=^P\\f, cr=^P^A, cub1=^P^B, cud1=^P\\n," | 1258 | "bel=^P^G, clear=^P\\f, cr=^P^A, cub1=^P^B, cud1=^P\\n," |
| 1255 | "cuf1=^P^F, cup=^P=%p1%'\\s'%+%c%p2%'\\s'%+%c," | 1259 | "cuf1=^P^F, cup=^P=%p1%'\\s'%+%c%p2%'\\s'%+%c," |
| 1256 | "dch=^Pd%p1%'\\s'%+%c, dch1=^Pd!, dl=^P^K%p1%'\\s'%+%c," | 1260 | "dch=^Pd%p1%'\\s'%+%c, dch1=^Pd!, dl=^P^K%p1%'\\s'%+%c," |
| 1257 | "dl1=^P^K!, ed=^PC, el=^Pc, home=^P=\\s\\s," | 1261 | "dl1=^P^K!, ed=^PC, el=^Pc, home=^P=\\s\\s," |
| 1258 | "ich=^P_%p1%'\\s'%+%c, ich1=^P_!, il=^P^O%p1%'\\s'%+%c," | 1262 | "ich=^P_%p1%'\\s'%+%c, ich1=^P_!, il=^P^O%p1%'\\s'%+%c," |
| 1259 | "il1=^P^O!, ind=^P\\n, nel=\\n,")) | 1263 | "il1=^P^O!, ind=^P\\n, nel=\\n,\n")) |
| 1260 | (file-name (concat "/tmp/" te-terminal-name ".tif")) ) | 1264 | ;; The last newline avoids trouble with ncurses. |
| 1265 | (file-name (concat te-terminfo-directory te-terminal-name ".tif")) ) | ||
| 1266 | (make-directory te-terminfo-directory t) | ||
| 1261 | (save-excursion | 1267 | (save-excursion |
| 1262 | (set-buffer (create-file-buffer file-name)) | 1268 | (set-buffer (create-file-buffer file-name)) |
| 1263 | (insert terminfo) | 1269 | (insert terminfo) |
| @@ -1265,11 +1271,12 @@ in the /tmp directory" | |||
| 1265 | (kill-buffer nil) | 1271 | (kill-buffer nil) |
| 1266 | ) | 1272 | ) |
| 1267 | (let ( (process-environment | 1273 | (let ( (process-environment |
| 1268 | (cons (concat "TERMINFO=" "/tmp") | 1274 | (cons (concat "TERMINFO=" |
| 1275 | (directory-file-name te-terminfo-directory)) | ||
| 1269 | process-environment)) ) | 1276 | process-environment)) ) |
| 1270 | (set-process-sentinel (start-process "tic" nil "tic" file-name) | 1277 | (set-process-sentinel (start-process "tic" nil "tic" file-name) |
| 1271 | 'te-tic-sentinel)))) | 1278 | 'te-tic-sentinel)))) |
| 1272 | "/tmp" | 1279 | (directory-file-name te-terminfo-directory) |
| 1273 | ) | 1280 | ) |
| 1274 | 1281 | ||
| 1275 | (defun te-create-termcap () | 1282 | (defun te-create-termcap () |
| @@ -1306,7 +1313,7 @@ in the /tmp directory" | |||
| 1306 | "If tic has finished, delete the .tif file" | 1313 | "If tic has finished, delete the .tif file" |
| 1307 | (if (equal state-change "finished | 1314 | (if (equal state-change "finished |
| 1308 | ") | 1315 | ") |
| 1309 | (delete-file (concat "/tmp/" te-terminal-name ".tif")))) | 1316 | (delete-file (concat te-terminfo-directory te-terminal-name ".tif")))) |
| 1310 | 1317 | ||
| 1311 | (provide 'terminal) | 1318 | (provide 'terminal) |
| 1312 | 1319 | ||