diff options
| author | Richard M. Stallman | 1993-04-29 14:23:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-04-29 14:23:22 +0000 |
| commit | 24fdffaaa02bc39ef94045bf98ced92968f8a1df (patch) | |
| tree | d77e62ab9fb01a3679cc99236fc28af2673df54d /lisp/shell.el | |
| parent | dff7d67f2623e60434b5fe22161d2dc1c0255187 (diff) | |
| download | emacs-24fdffaaa02bc39ef94045bf98ced92968f8a1df.tar.gz emacs-24fdffaaa02bc39ef94045bf98ced92968f8a1df.zip | |
(shell-prompt-pattern): Undo last change.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 97 |
1 files changed, 14 insertions, 83 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 349da38448d..dbe5fcccca8 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; shell.el --- specialized comint.el for running the shell. | 1 | ;;; shell.el --- specialized comint.el for running the shell. |
| 2 | ;;; Copyright (C) 1988 Free Software Foundation, Inc. | 2 | ;;; Copyright (C) 1988, 1993 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | ;; Author: Olin Shivers <shivers@cs.cmu.edu> | 4 | ;; Author: Olin Shivers <shivers@cs.cmu.edu> |
| 5 | ;; Keywords: processes | 5 | ;; Keywords: processes |
| @@ -144,13 +144,13 @@ | |||
| 144 | (require 'comint) | 144 | (require 'comint) |
| 145 | 145 | ||
| 146 | ;;;###autoload | 146 | ;;;###autoload |
| 147 | (defconst shell-prompt-pattern "^[^#$%>;]*[#$%>;] *" | 147 | (defconst shell-prompt-pattern "^[^#$%>]*[#$%>] *" |
| 148 | "Regexp to match prompts in the inferior shell. | 148 | "Regexp to match prompts in the inferior shell. |
| 149 | Defaults to \"^[^#$%>]*[#$%>] *\", which works pretty well. | 149 | Defaults to \"^[^#$%>]*[#$%>] *\", which works pretty well. |
| 150 | This variable is used to initialise comint-prompt-regexp in the | 150 | This variable is used to initialise `comint-prompt-regexp' in the |
| 151 | shell buffer. | 151 | shell buffer. |
| 152 | 152 | ||
| 153 | This is a fine thing to set in your .emacs file.") | 153 | This is a fine thing to set in your `.emacs' file.") |
| 154 | 154 | ||
| 155 | (defvar shell-popd-regexp "popd" | 155 | (defvar shell-popd-regexp "popd" |
| 156 | "*Regexp to match subshell commands equivalent to popd.") | 156 | "*Regexp to match subshell commands equivalent to popd.") |
| @@ -184,7 +184,7 @@ Thus, this does not include the shell's current directory.") | |||
| 184 | "Keep track of last directory for ksh `cd -' command.") | 184 | "Keep track of last directory for ksh `cd -' command.") |
| 185 | 185 | ||
| 186 | (defvar shell-dirstack-query "dirs" | 186 | (defvar shell-dirstack-query "dirs" |
| 187 | "Command used by shell-resync-dirlist to query shell.") | 187 | "Command used by `shell-resync-dir' to query the shell.") |
| 188 | 188 | ||
| 189 | (defvar shell-mode-map '()) | 189 | (defvar shell-mode-map '()) |
| 190 | (cond ((not shell-mode-map) | 190 | (cond ((not shell-mode-map) |
| @@ -193,7 +193,7 @@ Thus, this does not include the shell's current directory.") | |||
| 193 | (define-key shell-mode-map "\M-?" 'comint-dynamic-list-completions))) | 193 | (define-key shell-mode-map "\M-?" 'comint-dynamic-list-completions))) |
| 194 | 194 | ||
| 195 | (defvar shell-mode-hook '() | 195 | (defvar shell-mode-hook '() |
| 196 | "*Hook for customising shell mode") | 196 | "*Hook for customising Shell mode.") |
| 197 | 197 | ||
| 198 | 198 | ||
| 199 | ;;; Basic Procedures | 199 | ;;; Basic Procedures |
| @@ -219,11 +219,11 @@ M-x dirs queries the shell and resyncs Emacs' idea of what the current | |||
| 219 | M-x dirtrack-toggle turns directory tracking on and off. | 219 | M-x dirtrack-toggle turns directory tracking on and off. |
| 220 | 220 | ||
| 221 | \\{shell-mode-map} | 221 | \\{shell-mode-map} |
| 222 | Customization: Entry to this mode runs the hooks on comint-mode-hook and | 222 | Customization: Entry to this mode runs the hooks on `comint-mode-hook' and |
| 223 | shell-mode-hook (in that order). | 223 | `shell-mode-hook' (in that order). |
| 224 | 224 | ||
| 225 | Variables shell-cd-regexp, shell-pushd-regexp and shell-popd-regexp are used | 225 | Variables `shell-cd-regexp', `shell-pushd-regexp' and `shell-popd-regexp' |
| 226 | to match their respective commands." | 226 | are used to match their respective commands." |
| 227 | (interactive) | 227 | (interactive) |
| 228 | (comint-mode) | 228 | (comint-mode) |
| 229 | (setq comint-prompt-regexp shell-prompt-pattern) | 229 | (setq comint-prompt-regexp shell-prompt-pattern) |
| @@ -245,7 +245,7 @@ to match their respective commands." | |||
| 245 | If buffer exists but shell process is not running, make new shell. | 245 | If buffer exists but shell process is not running, make new shell. |
| 246 | If buffer exists and shell process is running, | 246 | If buffer exists and shell process is running, |
| 247 | just switch to buffer `*shell*'. | 247 | just switch to buffer `*shell*'. |
| 248 | Program used comes from variable explicit-shell-file-name, | 248 | Program used comes from variable `explicit-shell-file-name', |
| 249 | or (if that is nil) from the ESHELL environment variable, | 249 | or (if that is nil) from the ESHELL environment variable, |
| 250 | or else from SHELL if there is no ESHELL. | 250 | or else from SHELL if there is no ESHELL. |
| 251 | If a file `~/.emacs_SHELLNAME' exists, it is given as initial input | 251 | If a file `~/.emacs_SHELLNAME' exists, it is given as initial input |
| @@ -334,8 +334,8 @@ default directory to track these commands. | |||
| 334 | You may toggle this tracking on and off with M-x dirtrack-toggle. | 334 | You may toggle this tracking on and off with M-x dirtrack-toggle. |
| 335 | If emacs gets confused, you can resync with the shell with M-x dirs. | 335 | If emacs gets confused, you can resync with the shell with M-x dirs. |
| 336 | 336 | ||
| 337 | See variables shell-cd-regexp, shell-pushd-regexp, and shell-popd-regexp. | 337 | See variables `shell-cd-regexp', `shell-pushd-regexp', and `shell-popd-regexp'. |
| 338 | Environment variables are expanded, see function substitute-in-file-name." | 338 | Environment variables are expanded, see function `substitute-in-file-name'." |
| 339 | (condition-case err | 339 | (condition-case err |
| 340 | (cond (shell-dirtrackp | 340 | (cond (shell-dirtrackp |
| 341 | (string-match "^\\s *" str) ; skip whitespace | 341 | (string-match "^\\s *" str) ; skip whitespace |
| @@ -460,7 +460,7 @@ Environment variables are expanded, see function substitute-in-file-name." | |||
| 460 | (defun shell-resync-dirs () | 460 | (defun shell-resync-dirs () |
| 461 | "Resync the buffer's idea of the current directory stack. | 461 | "Resync the buffer's idea of the current directory stack. |
| 462 | This command queries the shell with the command bound to | 462 | This command queries the shell with the command bound to |
| 463 | shell-dirstack-query (default \"dirs\"), reads the next | 463 | `shell-dirstack-query' (default \"dirs\"), reads the next |
| 464 | line output and parses it to form the new directory stack. | 464 | line output and parses it to form the new directory stack. |
| 465 | DON'T issue this command unless the buffer is at a shell prompt. | 465 | DON'T issue this command unless the buffer is at a shell prompt. |
| 466 | Also, note that if some other subprocess decides to do output | 466 | Also, note that if some other subprocess decides to do output |
| @@ -556,75 +556,6 @@ This is a good place to put keybindings.") | |||
| 556 | 556 | ||
| 557 | (run-hooks 'shell-load-hook) | 557 | (run-hooks 'shell-load-hook) |
| 558 | 558 | ||
| 559 | ;;; Change Log | ||
| 560 | ;;; =========================================================================== | ||
| 561 | ;;; Olin 8/88 | ||
| 562 | ;;; Created. | ||
| 563 | ;;; | ||
| 564 | ;;; Olin 5/26/90 | ||
| 565 | ;;; - Split cmulisp and cmushell modes into separate files. | ||
| 566 | ;;; Not only is this a good idea, it's apparently the way it'll be rel 19. | ||
| 567 | ;;; - Souped up the directory tracking; it now can handle pushd, pushd +n, | ||
| 568 | ;;; and popd +n. | ||
| 569 | ;;; - Added cmushell-dirtrack-toggle command to toggle the directory | ||
| 570 | ;;; tracking that cmushell tries to do. This is useful, for example, | ||
| 571 | ;;; when you are running ftp -- it prevents the ftp "cd" command from | ||
| 572 | ;;; spoofing the tracking machinery. This command is also named | ||
| 573 | ;;; dirtrack-toggle, so you need only type M-x dirtrack to run it. | ||
| 574 | ;;; - Added cmushell-resync-dirs command. This queries the shell | ||
| 575 | ;;; for the current directory stack, and resets the buffer's stack | ||
| 576 | ;;; accordingly. This command is also named dirs, so you need only type | ||
| 577 | ;;; M-x dirs to run it. | ||
| 578 | ;;; - Bits of the new directory tracking code were adapted from source | ||
| 579 | ;;; contributed by Vince Broman, Jeff Peck, and Barry Warsaw. | ||
| 580 | ;;; - See also the improvements made to comint.el at the same time. | ||
| 581 | ;;; - Renamed several variables. Mostly this comprised changing "shell" | ||
| 582 | ;;; to "cmushell" in the names. The only variables that are not prefixed | ||
| 583 | ;;; with "cmushell-" are the ones that are common with shell.el: | ||
| 584 | ;;; explicit-shell-file-name shell-prompt-pattern explicit-csh-args | ||
| 585 | ;;; and shell-cd/popd/pushd-regexp | ||
| 586 | ;;; The variables and functions that were changed to have "cmushell-" | ||
| 587 | ;;; prefixes are: | ||
| 588 | ;;; shell-directory-stack (v), shell-directory-tracker (f) | ||
| 589 | ;;; This should not affect users, only Emacs Lisp hackers. Hopefully | ||
| 590 | ;;; one day shell.el will just go away, and we can drop all this | ||
| 591 | ;;; "cmushell" bullshit. | ||
| 592 | ;;; - Upgraded process sends to use comint-send-string instead of | ||
| 593 | ;;; process-send-string. | ||
| 594 | ;;; | ||
| 595 | ;;; Olin 6/14/90 | ||
| 596 | ;;; - If your shell is named <shellname>, and a variable named | ||
| 597 | ;;; explicit-<shellname>-args exists, cmushell is supposed | ||
| 598 | ;;; to use its value as the arglist to the shell invocation. | ||
| 599 | ;;; E.g., if you define explicit-csh-args to be | ||
| 600 | ;;; ("-ifx"), then when cmushell cranks up a csh, it execs it | ||
| 601 | ;;; as "csh -ifx". This is what is documented. What has actually | ||
| 602 | ;;; been the case is that the variable checked is | ||
| 603 | ;;; explicit-<shellname>-arguments, not explicit-<shellname>-args. | ||
| 604 | ;;; The documentation has been changed to conform to the code (for | ||
| 605 | ;;; backwards compatibility with shell.el). This bug is inherited from | ||
| 606 | ;;; the same bug in shell.el. | ||
| 607 | ;;; This bug reported by Stephen Anderson. | ||
| 608 | ;;; | ||
| 609 | ;;; Olin 9/5/90 | ||
| 610 | ;;; - Arguments to cd, popd, and pushd now have their env vars expanded | ||
| 611 | ;;; out by the tracking machinery. So if you say "cd $SRCDIR/funs", the | ||
| 612 | ;;; $SRCDIR var will be replaced by its value *in emacs' process | ||
| 613 | ;;; environment*. If this is different from the shell's binding of the | ||
| 614 | ;;; variable, you lose. Several users needed this feature, fragile | ||
| 615 | ;;; though it may be. The fix was contributed by sk@thp.Uni-Koeln.DE. | ||
| 616 | ;;; | ||
| 617 | ;;; Olin 3/12/91 | ||
| 618 | ;;; - Moved comint-dynamic-complete (filename completion) from M-tab to tab. | ||
| 619 | ;;; | ||
| 620 | ;;; Jim Blandy 10/30/91 | ||
| 621 | ;;; - Removed the "cmu" prefix from names, renamed file to shell.el, | ||
| 622 | ;;; to become the standard shell package. | ||
| 623 | ;;; | ||
| 624 | ;;; Eric Raymond 3/23/93 | ||
| 625 | ;;; - Merged in Brent Benson's patch to handle cd -. Made some more | ||
| 626 | ;;; cmushell -> shell changes. | ||
| 627 | |||
| 628 | (provide 'shell) | 559 | (provide 'shell) |
| 629 | 560 | ||
| 630 | ;;; shell.el ends here | 561 | ;;; shell.el ends here |