-;; Terminal emulator for GNU Emacs.
+;;; terminal.el --- terminal emulator for GNU Emacs.
+
;; Copyright (C) 1986, 1987, 1988, 1989 Free Software Foundation, Inc.
-;; Written by Richard Mlynarik, November 1986.
+
+;; Author: Richard Mlynarik <mly@eddie.mit.edu>
+;; Maintainer: FSF
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Code:
+
;;>>TODO
;;>> terminfo?
;;>> ** Nothing can be done about emacs' meta-lossage **
;;>> One probably wants to do setenv MORE -c when running with
;;>> more-processing enabled.
-(provide 'terminal)
(require 'ehelp)
(defvar terminal-escape-char ?\C-^
(if terminal-map
nil
(let ((map (make-keymap)))
- (fillarray map 'te-pass-through)
+ (fillarray (car (cdr map)) 'te-pass-through)
;(define-key map "\C-l"
; '(lambda () (interactive) (te-pass-through) (redraw-display)))
(setq terminal-map map)))
nil
(let ((map (make-keymap)))
;(fillarray map 'te-escape-extended-command-unread)
- (fillarray map 'undefined)
+ (fillarray (car (cdr map)) 'undefined)
(let ((s "0"))
(while (<= (aref s 0) ?9)
(define-key map s 'digit-argument)
(if terminal-more-break-map
nil
(let ((map (make-keymap)))
- (fillarray map 'te-more-break-unread)
+ (fillarray (car (cdr map)) 'te-more-break-unread)
(define-key map (char-to-string help-char) 'te-more-break-help)
(define-key map " " 'te-more-break-resume)
(define-key map "\C-l" 'redraw-display)
(interactive "cSet escape character to: ")
(let ((o terminal-escape-char))
(message (if (= o c)
- "\"%s\" is escape char"
- "\"%s\" is now escape; \"%s\" passes though")
+ "\"%s\" is the escape char"
+ "\"%s\" is now the escape; \"%s\" passes through")
(single-key-description c)
(single-key-description o))
(setq terminal-escape-char c)))
;;-- For disgusting programs.
;; (VI? What losers need these, I wonder?)
"im=:ei=:dm=:ed=:mi:do=^p^j:nl=^p^j:bs:")))
- (if (fboundp 'start-subprocess)
- ;; this winning function would do everything, except that
- ;; rms doesn't want it.
- (setq te-process (start-subprocess "terminal-emulator"
- program args
- 'channel-type 'terminal
- 'filter 'te-filter
- 'buffer (current-buffer)
- 'sentinel 'te-sentinel
- 'modify-environment
- (list (cons "TERM" "emacs-virtual")
- (cons "TERMCAP" termcap))))
- ;; so instead we resort to this...
- (setq te-process (start-process "terminal-emulator" (current-buffer)
- "/bin/sh" "-c"
- ;; Yuck!!! Start a shell to set some terminal
- ;; control characteristics. Then start the
- ;; "env" program to setup the terminal type
- ;; Then finally start the program we wanted.
- (format "%s; exec %s TERM=emacs-virtual %s %s"
- te-stty-string
- (te-quote-arg-for-sh
- (concat exec-directory "env"))
- (te-quote-arg-for-sh
- (concat "TERMCAP=" termcap))
- (mapconcat 'te-quote-arg-for-sh
- (cons program args) " "))))
- (set-process-filter te-process 'te-filter)
- (set-process-sentinel te-process 'te-sentinel)))
+ (let ((process-environment
+ (cons "TERM=emacs-virtual"
+ (cons (concat "TERMCAP=" termcap)
+ process-environment))))
+ (setq te-process
+ (start-process "terminal-emulator" (current-buffer)
+ "/bin/sh" "-c"
+ ;; Yuck!!! Start a shell to set some terminal
+ ;; control characteristics. Then start the
+ ;; "env" program to setup the terminal type
+ ;; Then finally start the program we wanted.
+ (format "%s; exec %s"
+ te-stty-string
+ (mapconcat 'te-quote-arg-for-sh
+ (cons program args) " ")))))
+ (set-process-filter te-process 'te-filter)
+ (set-process-sentinel te-process 'te-sentinel))
(error (fundamental-mode)
(signal (car err) (cdr err))))
;; sigh
(1+ end)))
start (1+ end)))
(concat "\"" harder "\"")))))
+
+(provide 'terminal)
+
+;;; terminal.el ends here