Function: make-term

make-term is an autoloaded and byte-compiled function defined in term.el.gz.

Signature

(make-term NAME PROGRAM &optional STARTFILE &rest SWITCHES)

Documentation

Make a term process NAME in a buffer, running PROGRAM.

The name of the buffer is made by surrounding NAME with *s. If there is already a running process in that buffer, it is not restarted. Optional third arg STARTFILE is the name of a file to send the contents of to the process. Any more args are arguments to PROGRAM.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
;;;###autoload
(defun make-term (name program &optional startfile &rest switches)
"Make a term process NAME in a buffer, running PROGRAM.
The name of the buffer is made by surrounding NAME with `*'s.
If there is already a running process in that buffer, it is not restarted.
Optional third arg STARTFILE is the name of a file to send the contents of to
the process.  Any more args are arguments to PROGRAM."
  (let ((buffer (get-buffer-create (concat "*" name "*"))))
    ;; If no process, or nuked process, crank up a new one and put buffer in
    ;; term mode.  Otherwise, leave buffer and existing process alone.
    (cond ((not (term-check-proc buffer))
	   (with-current-buffer buffer
	     (term-mode)) ; Install local vars, mode, keymap, ...
	   (term-exec buffer name program startfile switches)))
    buffer))