aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2000-10-27 08:01:52 +0000
committerMiles Bader2000-10-27 08:01:52 +0000
commitfd1035aaf78d1a77aa172ffa9ae9e81924e5e7b3 (patch)
tree1d7d45ce3b1cc119470b5b396b82b5caafd4e15c
parenta7fd458a8c8548929ac0c499a42ffa7dc6c2c7a1 (diff)
downloademacs-fd1035aaf78d1a77aa172ffa9ae9e81924e5e7b3.tar.gz
emacs-fd1035aaf78d1a77aa172ffa9ae9e81924e5e7b3.zip
(shell): Add BUFFER argument.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/shell.el24
2 files changed, 19 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5257328d944..611e0606008 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12000-10-27 Miles Bader <miles@lsi.nec.co.jp> 12000-10-27 Miles Bader <miles@lsi.nec.co.jp>
2 2
3 * shell.el (shell): Add BUFFER argument.
4 * comint.el (make-comint-in-buffer): New function.
5 (make-comint): Use it.
6
3 * faces.el (face-spec-choose): Change syntax so that the list of 7 * faces.el (face-spec-choose): Change syntax so that the list of
4 attribute-value pairs is now the cdr of each clause, not the cadr. 8 attribute-value pairs is now the cdr of each clause, not the cadr.
5 Detect old-style entries, and handle them. Use pop. 9 Detect old-style entries, and handle them. Use pop.
diff --git a/lisp/shell.el b/lisp/shell.el
index b7c27b7778a..966afc0a660 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1,6 +1,6 @@
1;;; shell.el --- specialized comint.el for running the shell. 1;;; shell.el --- specialized comint.el for running the shell.
2 2
3;; Copyright (C) 1988, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 93, 94, 95, 96, 1997, 2000 Free Software Foundation, Inc.
4 4
5;; Author: Olin Shivers <shivers@cs.cmu.edu> then 5;; Author: Olin Shivers <shivers@cs.cmu.edu> then
6;; Simon Marshall <simon@gnu.org> 6;; Simon Marshall <simon@gnu.org>
@@ -456,10 +456,11 @@ Sentinels will always get the two parameters PROCESS and EVENT."
456 (insert (format "\nProcess %s %s\n" process event)))) 456 (insert (format "\nProcess %s %s\n" process event))))
457 457
458;;;###autoload 458;;;###autoload
459(defun shell () 459(defun shell (&optional buffer)
460 "Run an inferior shell, with I/O through buffer *shell*. 460 "Run an inferior shell, with I/O through BUFFER (which defaults to `*shell*').
461If buffer exists but shell process is not running, make new shell. 461Interactively, a prefix arg means to prompt for BUFFER.
462If buffer exists and shell process is running, just switch to buffer `*shell*'. 462If BUFFER exists but shell process is not running, make new shell.
463If BUFFER exists and shell process is running, just switch to BUFFER.
463Program used comes from variable `explicit-shell-file-name', 464Program used comes from variable `explicit-shell-file-name',
464 or (if that is nil) from the ESHELL environment variable, 465 or (if that is nil) from the ESHELL environment variable,
465 or else from SHELL if there is no ESHELL. 466 or else from SHELL if there is no ESHELL.
@@ -483,8 +484,13 @@ its value is used as a list of arguments when invoking the shell.
483Otherwise, one argument `-i' is passed to the shell. 484Otherwise, one argument `-i' is passed to the shell.
484 485
485\(Type \\[describe-mode] in the shell buffer for a list of commands.)" 486\(Type \\[describe-mode] in the shell buffer for a list of commands.)"
486 (interactive) 487 (interactive
487 (if (not (comint-check-proc "*shell*")) 488 (list
489 (and current-prefix-arg
490 (read-buffer "Shell buffer: " "*shell*"))))
491 (when (null buffer)
492 (setq buffer "*shell*"))
493 (if (not (comint-check-proc buffer))
488 (let* ((prog (or explicit-shell-file-name 494 (let* ((prog (or explicit-shell-file-name
489 (getenv "ESHELL") 495 (getenv "ESHELL")
490 (getenv "SHELL") 496 (getenv "SHELL")
@@ -494,7 +500,7 @@ Otherwise, one argument `-i' is passed to the shell.
494 (xargs-name (intern-soft (concat "explicit-" name "-args"))) 500 (xargs-name (intern-soft (concat "explicit-" name "-args")))
495 shell-buffer) 501 shell-buffer)
496 (save-excursion 502 (save-excursion
497 (set-buffer (apply 'make-comint "shell" prog 503 (set-buffer (apply 'make-comint-in-buffer "shell" buffer prog
498 (if (file-exists-p startfile) startfile) 504 (if (file-exists-p startfile) startfile)
499 (if (and xargs-name (boundp xargs-name)) 505 (if (and xargs-name (boundp xargs-name))
500 (symbol-value xargs-name) 506 (symbol-value xargs-name)
@@ -502,7 +508,7 @@ Otherwise, one argument `-i' is passed to the shell.
502 (setq shell-buffer (current-buffer)) 508 (setq shell-buffer (current-buffer))
503 (shell-mode)) 509 (shell-mode))
504 (pop-to-buffer shell-buffer)) 510 (pop-to-buffer shell-buffer))
505 (pop-to-buffer "*shell*"))) 511 (pop-to-buffer buffer)))
506 512
507;;; Don't do this when shell.el is loaded, only while dumping. 513;;; Don't do this when shell.el is loaded, only while dumping.
508;;;###autoload (add-hook 'same-window-buffer-names "*shell*") 514;;;###autoload (add-hook 'same-window-buffer-names "*shell*")