aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1996-06-09 20:31:51 +0000
committerRichard M. Stallman <[email protected]>1996-06-09 20:31:51 +0000
commit32d012127609e52c0fc3d1f82d765a0b45739e9e (patch)
treee34f92029b12406c2679bb6971dff6c3ab752382 /lisp/shell.el
parent7a35a067a3fbdafdb683a153a8094f63458a688f (diff)
(shell-directory-tracker): Use comint-substitute-in-file-name to
handle system-specific syntax. (shell-chdrive-regexp): New variable. (shell-mode): Update doc string. (shell-directory-tracker): Detect drive changes. Update doc string.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el32
1 files changed, 22 insertions, 10 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 5807f62b38..867c291934 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -186,6 +186,13 @@ This mirrors the optional behavior of tcsh.")
(defvar shell-cd-regexp "cd"
"*Regexp to match subshell commands equivalent to cd.")
+(defvar shell-chdrive-regexp
+ (if (memq system-type '(ms-dos windows-nt))
+ ; NetWare allows the five chars between upper and lower alphabetics.
+ "[]a-zA-Z^_`\\[\\\\]:"
+ nil)
+ "*If non-nil, is regexp used to track drive changes.")
+
(defvar explicit-shell-file-name nil
"*If non-nil, is file name to use for explicitly requested inferior shell.")
@@ -287,10 +294,10 @@ Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
`comint-input-filter-functions' are run. After each shell output, the hooks
on `comint-output-filter-functions' are run.
-Variables `shell-cd-regexp', `shell-pushd-regexp' and `shell-popd-regexp'
-are used to match their respective commands, while `shell-pushd-tohome',
-`shell-pushd-dextract' and `shell-pushd-dunique' control the behavior of the
-relevant command.
+Variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp'
+and `shell-popd-regexp' are used to match their respective commands,
+while `shell-pushd-tohome', `shell-pushd-dextract' and `shell-pushd-dunique'
+control the behavior of the relevant command.
Variables `comint-completion-autolist', `comint-completion-addsuffix',
`comint-completion-recexact' and `comint-completion-fignore' control the
@@ -441,9 +448,9 @@ default directory to track these commands.
You may toggle this tracking on and off with M-x dirtrack-toggle.
If emacs gets confused, you can resync with the shell with M-x dirs.
-See variables `shell-cd-regexp', `shell-pushd-regexp', and `shell-popd-regexp',
-while `shell-pushd-tohome', `shell-pushd-dextract' and `shell-pushd-dunique'
-control the behavior of the relevant command.
+See variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp',
+and `shell-popd-regexp', while `shell-pushd-tohome', `shell-pushd-dextract',
+and `shell-pushd-dunique' control the behavior of the relevant command.
Environment variables are expanded, see function `substitute-in-file-name'."
(if shell-dirtrackp
@@ -459,15 +466,20 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(cond ((string-match (concat "\\`\\(" shell-popd-regexp
"\\)\\($\\|[ \t]\\)")
cmd)
- (shell-process-popd (substitute-in-file-name arg1)))
+ (shell-process-popd (comint-substitute-in-file-name arg1)))
((string-match (concat "\\`\\(" shell-pushd-regexp
"\\)\\($\\|[ \t]\\)")
cmd)
- (shell-process-pushd (substitute-in-file-name arg1)))
+ (shell-process-pushd (comint-substitute-in-file-name arg1)))
((string-match (concat "\\`\\(" shell-cd-regexp
"\\)\\($\\|[ \t]\\)")
cmd)
- (shell-process-cd (substitute-in-file-name arg1))))
+ (shell-process-cd (comint-substitute-in-file-name arg1)))
+ ((and shell-chdrive-regexp
+ (string-match (concat "\\`\\(" shell-chdrive-regexp
+ "\\)\\($\\|[ \t]\\)")
+ cmd))
+ (shell-process-cd (comint-substitute-in-file-name cmd))))
(setq start (progn (string-match "[; \t]*" str end) ; skip again
(match-end 0)))))
(error "Couldn't cd"))))